Revoke all access to a cluster
import requests
url = "https://platform.ankra.app/api/v1/clusters/{cluster_id}/access/revoke-all"
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/clusters/{cluster_id}/access/revoke-all', 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/clusters/{cluster_id}/access/revoke-all \
--header 'Authorization: Bearer <token>'{
"revoked_tokens": 123,
"deleted_grants": 123,
"retained_role_grants": 123,
"retained_role_grants_reason": "<string>"
}{
"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"
}Cluster Access
Revoke all access to a cluster
The kill switch: revokes every kubeconfig issued for the cluster and deletes every access grant on it, except the grants organisation roles carry, which the role sync would re-create within about a minute. Those stay, and the response counts them and says why. Requires kube_access.manage in the token’s scopes and an organisation admin. Answers 404 when the cluster is outside the organisation or the project the token acts in, or when the cluster access gateway is not enabled.
POST
/
api
/
v1
/
clusters
/
{cluster_id}
/
access
/
revoke-all
Revoke all access to a cluster
import requests
url = "https://platform.ankra.app/api/v1/clusters/{cluster_id}/access/revoke-all"
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/clusters/{cluster_id}/access/revoke-all', 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/clusters/{cluster_id}/access/revoke-all \
--header 'Authorization: Bearer <token>'{
"revoked_tokens": 123,
"deleted_grants": 123,
"retained_role_grants": 123,
"retained_role_grants_reason": "<string>"
}{
"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"
}Authorizations
Response
Access was revoked.
What revoking all access to a cluster did.