import requests
url = "https://platform.ankra.app/api/v1/org/credentials/{credential_id}"
payload = { "payload": {} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({payload: {}})
};
fetch('https://platform.ankra.app/api/v1/org/credentials/{credential_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/org/credentials/{credential_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"payload": {}
}'{
"rotated": true,
"result": {
"ok": true,
"code": "<string>",
"message": "<string>",
"hints": [
"<string>"
]
}
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Rotate a credential's secret in place
Replaces the credential’s secret without recreating it, so clusters and other resources that reference it keep working. The supplied fields are probed against the provider first: a refused probe answers 200 with rotated: false and the probe’s code, message and hints, and the stored secret is left unchanged. Connection settings cannot be rotated. Requires credentials.write; a credential pinned to another project answers 404.
import requests
url = "https://platform.ankra.app/api/v1/org/credentials/{credential_id}"
payload = { "payload": {} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({payload: {}})
};
fetch('https://platform.ankra.app/api/v1/org/credentials/{credential_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/org/credentials/{credential_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"payload": {}
}'{
"rotated": true,
"result": {
"ok": true,
"code": "<string>",
"message": "<string>",
"hints": [
"<string>"
]
}
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
The fresh secret fields for the credential's provider, for example api_token for Hetzner, UpCloud and DigitalOcean, token_secret for Proxmox VE, access_token for HPE Morpheus, secret_key for Scaleway, application_key/application_secret/consumer_key for OVHcloud, client_secret for Azure, and access_key_id with secret_access_key for a Hetzner credential's Object Storage keys. Connection settings (api_url, project_id, tls_insecure, ...) cannot be rotated.
Show child attributes
Show child attributes