Allow live orphan removal after a dry run that needs review
curl --request POST \
--url https://api.example.com/api/maintenance/tables/{registration_id}/orphans/approve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_files": 1,
"expected_bytes": 1
}
'import requests
url = "https://api.example.com/api/maintenance/tables/{registration_id}/orphans/approve"
payload = {
"expected_files": 1,
"expected_bytes": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({expected_files: 1, expected_bytes: 1})
};
fetch('https://api.example.com/api/maintenance/tables/{registration_id}/orphans/approve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/maintenance/tables/{registration_id}/orphans/approve",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'expected_files' => 1,
'expected_bytes' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/maintenance/tables/{registration_id}/orphans/approve"
payload := strings.NewReader("{\n \"expected_files\": 1,\n \"expected_bytes\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/maintenance/tables/{registration_id}/orphans/approve")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expected_files\": 1,\n \"expected_bytes\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/maintenance/tables/{registration_id}/orphans/approve")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expected_files\": 1,\n \"expected_bytes\": 1\n}"
response = http.request(request)
puts response.read_body{
"table": {
"registration_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"catalog": "<string>",
"namespace": "<string>",
"table_name": "<string>",
"table": "<string>",
"role": "<string>",
"active": true,
"role_reason": "<string>",
"health": 123,
"last_maintained_at": "<string>",
"last_status": "<string>",
"snapshot_id": 123,
"data_files": 123,
"total_bytes": 123,
"avg_file_bytes": 123
},
"table_uuid": "<string>",
"location": "<string>",
"first_seen": "<string>",
"last_seen": "<string>",
"metrics": [
{
"captured_at": "<string>",
"data_files": 123,
"delete_files": 123,
"total_bytes": 123,
"total_records": 123,
"position_deletes": 123,
"equality_deletes": 123,
"avg_file_bytes": 123,
"manifests": 123,
"manifest_bytes": 123,
"snapshots": 123,
"expirable_snapshots": 123,
"health": 123,
"snapshot_id": 123,
"position_delete_files": 123,
"small_files": 123,
"max_small_files_in_partition": 123,
"oldest_snapshot_age_s": 123
}
],
"operations": [
{
"operation": "<string>",
"last_success_at": "<string>",
"last_attempt_at": "<string>",
"last_status": "<string>",
"consecutive_failures": 0,
"consecutive_conflicts": 0
}
],
"orphans": {
"dry_run_files": 123,
"dry_run_bytes": 123,
"live_approved": false,
"review_required": false,
"blocked_reason": "<string>"
},
"recent_tasks": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"registration_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"catalog": "<string>",
"namespace": "<string>",
"table_name": "<string>",
"operation": "<string>",
"policy_version": "<string>",
"status": "<string>",
"priority": "<string>",
"score": 123,
"est_bytes": 123,
"created_at": "<string>",
"batch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reason": "<string>",
"dry_run": false,
"started_at": "<string>",
"finished_at": "<string>",
"duration_ms": 123,
"before": {},
"after": {},
"result": {},
"error": "<string>",
"engine_app_id": "<string>"
}
],
"effective": {
"scope": {
"scope_type": "catalog",
"catalog": "<string>",
"namespace": "",
"table": ""
},
"values": [
{
"path": "<string>",
"value": "<unknown>",
"source": "<string>"
}
],
"document": {},
"warnings": [
"<string>"
],
"version_tag": "<string>",
"timezone": "UTC"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Iceberg maintenance
Allow live orphan removal after a dry run that needs review
POST
/
api
/
maintenance
/
tables
/
{registration_id}
/
orphans
/
approve
Allow live orphan removal after a dry run that needs review
curl --request POST \
--url https://api.example.com/api/maintenance/tables/{registration_id}/orphans/approve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_files": 1,
"expected_bytes": 1
}
'import requests
url = "https://api.example.com/api/maintenance/tables/{registration_id}/orphans/approve"
payload = {
"expected_files": 1,
"expected_bytes": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({expected_files: 1, expected_bytes: 1})
};
fetch('https://api.example.com/api/maintenance/tables/{registration_id}/orphans/approve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/maintenance/tables/{registration_id}/orphans/approve",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'expected_files' => 1,
'expected_bytes' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/maintenance/tables/{registration_id}/orphans/approve"
payload := strings.NewReader("{\n \"expected_files\": 1,\n \"expected_bytes\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/maintenance/tables/{registration_id}/orphans/approve")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expected_files\": 1,\n \"expected_bytes\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/maintenance/tables/{registration_id}/orphans/approve")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expected_files\": 1,\n \"expected_bytes\": 1\n}"
response = http.request(request)
puts response.read_body{
"table": {
"registration_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"catalog": "<string>",
"namespace": "<string>",
"table_name": "<string>",
"table": "<string>",
"role": "<string>",
"active": true,
"role_reason": "<string>",
"health": 123,
"last_maintained_at": "<string>",
"last_status": "<string>",
"snapshot_id": 123,
"data_files": 123,
"total_bytes": 123,
"avg_file_bytes": 123
},
"table_uuid": "<string>",
"location": "<string>",
"first_seen": "<string>",
"last_seen": "<string>",
"metrics": [
{
"captured_at": "<string>",
"data_files": 123,
"delete_files": 123,
"total_bytes": 123,
"total_records": 123,
"position_deletes": 123,
"equality_deletes": 123,
"avg_file_bytes": 123,
"manifests": 123,
"manifest_bytes": 123,
"snapshots": 123,
"expirable_snapshots": 123,
"health": 123,
"snapshot_id": 123,
"position_delete_files": 123,
"small_files": 123,
"max_small_files_in_partition": 123,
"oldest_snapshot_age_s": 123
}
],
"operations": [
{
"operation": "<string>",
"last_success_at": "<string>",
"last_attempt_at": "<string>",
"last_status": "<string>",
"consecutive_failures": 0,
"consecutive_conflicts": 0
}
],
"orphans": {
"dry_run_files": 123,
"dry_run_bytes": 123,
"live_approved": false,
"review_required": false,
"blocked_reason": "<string>"
},
"recent_tasks": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"registration_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"catalog": "<string>",
"namespace": "<string>",
"table_name": "<string>",
"operation": "<string>",
"policy_version": "<string>",
"status": "<string>",
"priority": "<string>",
"score": 123,
"est_bytes": 123,
"created_at": "<string>",
"batch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reason": "<string>",
"dry_run": false,
"started_at": "<string>",
"finished_at": "<string>",
"duration_ms": 123,
"before": {},
"after": {},
"result": {},
"error": "<string>",
"engine_app_id": "<string>"
}
],
"effective": {
"scope": {
"scope_type": "catalog",
"catalog": "<string>",
"namespace": "",
"table": ""
},
"values": [
{
"path": "<string>",
"value": "<unknown>",
"source": "<string>"
}
],
"document": {},
"warnings": [
"<string>"
],
"version_tag": "<string>",
"timezone": "UTC"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
OAuth2AuthorizationCodeBearerAPIKeyHeader
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
The table's registration id in maintenance.
Body
application/json
Response
Successful Response
A table's maintenance health, state, history and effective policy.
One table registration as maintenance sees it.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?

