Trigger a GitOps sync
import requests
url = "https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/gitops/sync"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/gitops/sync', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/gitops/sync \
--header 'Authorization: Bearer <token>'{
"message": "<string>",
"sync_triggered": true
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}Clusters
Trigger a GitOps sync
The bearer twin of the portal’s GitOps sync button, for the Ankra app and scripts. Asks the cluster’s GitOps sync to run now instead of at its next interval. Answers 400 when the cluster has no Git repository. Requires clusters.write on the cluster.
POST
/
api
/
v1
/
org
/
clusters
/
{cluster_id}
/
gitops
/
sync
Trigger a GitOps sync
import requests
url = "https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/gitops/sync"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/gitops/sync', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/gitops/sync \
--header 'Authorization: Bearer <token>'{
"message": "<string>",
"sync_triggered": true
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}