import requests
url = "https://platform.ankra.app/api/v1/clusters/{cluster_id}/gitops/status"
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/clusters/{cluster_id}/gitops/status', 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/clusters/{cluster_id}/gitops/status \
--header 'Authorization: Bearer <token>'{
"sync_status": "<string>",
"last_synced_at": "2023-11-07T05:31:56Z",
"last_synced_from": "<string>",
"last_commit_sha": "<string>",
"last_commit_timestamp": "2023-11-07T05:31:56Z",
"pending_commit_sha": "<string>",
"sync_phase": "<string>",
"sync_progress_message": "<string>",
"applied_with_failed_members": false,
"error": {
"error_type": "<string>",
"resource_type": "<string>",
"resource_name": "<string>",
"missing_fields": [
{
"field": "<string>",
"description": "<string>",
"example": "<string>"
}
],
"invalid_fields": [
"<string>"
],
"message": "<string>"
},
"retry_count": 0,
"cluster_name": "<string>",
"cluster_short_id": "<string>",
"git_repo": {
"provider": "<string>",
"branch": "<string>",
"web_url": "<string>",
"repo_owner": "<string>",
"repo_name": "<string>",
"workspace": "<string>",
"repo_slug": "<string>",
"project_key": "<string>",
"instance_url": "<string>",
"credential_name": "<string>"
},
"credential_missing": false,
"open_conflict_count": 0,
"open_conflict_keys": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Get cluster GitOps status
Returns which GitOps repository, branch and credential the cluster syncs from, together with the last synced commit. A cluster without GitOps configured returns a not_configured status.
import requests
url = "https://platform.ankra.app/api/v1/clusters/{cluster_id}/gitops/status"
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/clusters/{cluster_id}/gitops/status', 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/clusters/{cluster_id}/gitops/status \
--header 'Authorization: Bearer <token>'{
"sync_status": "<string>",
"last_synced_at": "2023-11-07T05:31:56Z",
"last_synced_from": "<string>",
"last_commit_sha": "<string>",
"last_commit_timestamp": "2023-11-07T05:31:56Z",
"pending_commit_sha": "<string>",
"sync_phase": "<string>",
"sync_progress_message": "<string>",
"applied_with_failed_members": false,
"error": {
"error_type": "<string>",
"resource_type": "<string>",
"resource_name": "<string>",
"missing_fields": [
{
"field": "<string>",
"description": "<string>",
"example": "<string>"
}
],
"invalid_fields": [
"<string>"
],
"message": "<string>"
},
"retry_count": 0,
"cluster_name": "<string>",
"cluster_short_id": "<string>",
"git_repo": {
"provider": "<string>",
"branch": "<string>",
"web_url": "<string>",
"repo_owner": "<string>",
"repo_name": "<string>",
"workspace": "<string>",
"repo_slug": "<string>",
"project_key": "<string>",
"instance_url": "<string>",
"credential_name": "<string>"
},
"credential_missing": false,
"open_conflict_count": 0,
"open_conflict_keys": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Response
Successful Response
Outcome of the latest GitOps sync attempt: synced, conflict, syncing, error, cancelled, or not_configured. conflict means GitOps sync is paused on a merge conflict: the latest attempt found the same resource changed in Git and on the cluster and applied nothing, or conflicts still await a decision (see open_conflict_count).
Commit of the last attempt that synced. An attempt that stopped on a merge conflict applied nothing and is not counted.
- ValidationErrorInfo
- MultipleValidationErrorsInfo
- GeneralErrorInfo
Show child attributes
Show child attributes
Show child attributes
Show child attributes
True when the cluster's GitOps repository row names a credential that no longer resolves to a stored credential of that provider - a dangling binding whose pushes fail as 404 while git_repo still reads as configured.
Number of GitOps merge conflicts awaiting an operator decision. While it is above zero GitOps sync is paused: nothing pushed to Git is applied to the cluster until each conflict is resolved. Conflicts that already carry a decision are not counted; the next sync applies them.
Resource keys of the conflicts counted by open_conflict_count, in key order and capped at 20. open_conflict_count is always the full total, so a shorter list was capped; the conflicts listing enumerates every conflict with both sides.