import requests
url = "https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/gitops/preserved-paths"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/gitops/preserved-paths', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/gitops/preserved-paths \
--header 'Authorization: Bearer <token>'{
"preserved_paths": [
{
"path": "<string>",
"head_content": "<string>",
"head_content_hash": "<string>",
"render_content": "<string>",
"render_content_hash": "<string>",
"structural_diff": {
"status": "computed",
"values_withheld_reason": "sops_encrypted",
"changes": [
{
"path": "<string>",
"change": "added",
"git_value": "<string>",
"ankra_value": "<string>",
"value_masked": true
}
],
"total": 123,
"truncated": true
},
"content_redacted": false,
"content_redacted_reason": "sops_encrypted",
"content_omitted": false,
"head_commit_sha": "<string>",
"detected_at": "2023-11-07T05:31:56Z",
"last_seen_at": "2023-11-07T05:31:56Z",
"resolution_choice": "git",
"resolved_at": "2023-11-07T05:31:56Z",
"import_refused_reason": "<string>",
"import_refused_at": "2023-11-07T05:31:56Z"
}
],
"total": 123,
"structural_diff_values": "revealed",
"truncated": false
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}List preserved GitOps paths
Lists the files Git and the platform are divided on: each was edited in Git, so Ankra keeps Git’s bytes there instead of overwriting them, and the platform’s later changes to it do not reach Git. Every entry carries both sides - withheld, with the reason, for a file that may carry a secret - and any decision already recorded, in path order and capped at 100 entries and a content budget (truncated says when either cap applied). Unlike a GitOps merge conflict a preserved file pauses nothing. Bearer-PAT twin of the browser route of the same name under /org.
import requests
url = "https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/gitops/preserved-paths"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/gitops/preserved-paths', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/gitops/preserved-paths \
--header 'Authorization: Bearer <token>'{
"preserved_paths": [
{
"path": "<string>",
"head_content": "<string>",
"head_content_hash": "<string>",
"render_content": "<string>",
"render_content_hash": "<string>",
"structural_diff": {
"status": "computed",
"values_withheld_reason": "sops_encrypted",
"changes": [
{
"path": "<string>",
"change": "added",
"git_value": "<string>",
"ankra_value": "<string>",
"value_masked": true
}
],
"total": 123,
"truncated": true
},
"content_redacted": false,
"content_redacted_reason": "sops_encrypted",
"content_omitted": false,
"head_commit_sha": "<string>",
"detected_at": "2023-11-07T05:31:56Z",
"last_seen_at": "2023-11-07T05:31:56Z",
"resolution_choice": "git",
"resolved_at": "2023-11-07T05:31:56Z",
"import_refused_reason": "<string>",
"import_refused_at": "2023-11-07T05:31:56Z"
}
],
"total": 123,
"structural_diff_values": "revealed",
"truncated": false
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}Authorizations
Response
Successful response
Whether the entries' structural differences carry their values: revealed for a caller holding kubernetes.secrets_reveal on the cluster; permission_required for any other caller, who sees every change and its marker with each value masked - and, in an entry whose content is withheld, every key and list-member name outside the allow-listed cluster-index positions masked too; unavailable when the permission could not be checked (treated like permission_required).
revealed, permission_required, unavailable