import requests
url = "https://platform.ankra.app/api/v1/org/applications/{application_id}/environments/{environment_id}/clone"
payload = { "target_cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({target_cluster_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://platform.ankra.app/api/v1/org/applications/{application_id}/environments/{environment_id}/clone', 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/applications/{application_id}/environments/{environment_id}/clone \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target_cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'{
"copied_secrets": [
"<string>"
],
"inherited_secrets": [
"<string>"
],
"installation_id": "<string>",
"message": "<string>",
"operation_id": "<string>",
"source_cluster_id": "<string>",
"status": "<string>",
"suppressed_secrets": [
"<string>"
],
"environment_id": "<string>",
"warnings": [
"<string>"
]
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "<string>"
}{
"detail": "<string>"
}Clone an application environment onto another cluster
Clones one environment of the application onto another cluster: the same image, deploy mode and accepted deploy options (replicas, resources, ports, every option but the addresses), queued as a deploy. Hostnames are claimed organisation-wide, so the copy keeps the target’s own address or derives a fresh one. A cluster the application already runs on is overwritten in place. With include_secrets the source’s own secret overrides are re-written under the target’s Vault path, its suppressions are copied, and the target’s other overrides return to the shared value; only key names are returned and each one is audited. environment_id is a stored environment id or the cluster id an unnamed environment is known by. Held to the applications.deploy permission, and applications.write as well when secrets are included. Bearer personal access token; the CLI twin of the browser route (no CSRF header).
import requests
url = "https://platform.ankra.app/api/v1/org/applications/{application_id}/environments/{environment_id}/clone"
payload = { "target_cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({target_cluster_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://platform.ankra.app/api/v1/org/applications/{application_id}/environments/{environment_id}/clone', 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/applications/{application_id}/environments/{environment_id}/clone \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target_cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'{
"copied_secrets": [
"<string>"
],
"inherited_secrets": [
"<string>"
],
"installation_id": "<string>",
"message": "<string>",
"operation_id": "<string>",
"source_cluster_id": "<string>",
"status": "<string>",
"suppressed_secrets": [
"<string>"
],
"environment_id": "<string>",
"warnings": [
"<string>"
]
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "<string>"
}{
"detail": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Response
The deploy the clone queued and the secret keys it wrote.
Override keys written to the target.
Target override keys returned to the shared value.
Keys suppressed on the target, as on the source.