import requests
url = "https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/zone-move"
payload = {
"zone": "<string>",
"target_cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target_name": "<string>",
"plan_only": False,
"control_plane_count": 123,
"control_plane_plan": "<string>",
"worker_plan": "<string>",
"worker_count": 123,
"soak_days": 15,
"vault": "<string>"
}
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({
zone: '<string>',
target_cluster_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
target_name: '<string>',
plan_only: false,
control_plane_count: 123,
control_plane_plan: '<string>',
worker_plan: '<string>',
worker_count: 123,
soak_days: 15,
vault: '<string>'
})
};
fetch('https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/zone-move', 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/imported/{cluster_id}/zone-move \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"zone": "<string>",
"target_cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target_name": "<string>",
"plan_only": false,
"control_plane_count": 123,
"control_plane_plan": "<string>",
"worker_plan": "<string>",
"worker_count": 123,
"soak_days": 15,
"vault": "<string>"
}
'{
"move": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target_cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"zone": "<string>",
"status": "planned",
"plan": {
"target": {
"name": "<string>",
"zone": "<string>",
"network_mode": "<string>",
"storage_tier": "<string>",
"control_plane": {
"plan": "<string>",
"count": 123
},
"bastion_plan": "<string>",
"node_groups": [
{
"name": "<string>",
"plan": "<string>",
"count": 123
}
],
"existing_cluster_id": "<string>"
},
"stacks": [
{
"name": "<string>",
"carried": true,
"reason": "<string>",
"namespaces": [
"<string>"
],
"seeded": true,
"stopped_with_source": true,
"vault": {
"id": "<string>",
"name": "<string>",
"basis": "request"
}
}
],
"data": [
{
"stack": "<string>",
"namespace": "<string>",
"name": "<string>",
"kind": "<string>",
"engine": "<string>",
"requested_bytes": 123,
"storage_class": "<string>",
"target_storage_class": "<string>"
}
],
"not_carried": [
{
"what": "<string>",
"reason": "<string>"
}
],
"dns": [
{
"hostname": "<string>",
"mechanism": "<string>",
"source_origin": "<string>",
"target_origin": "<string>"
}
],
"storage_class_mapping": {},
"load_balancers": [
{
"service": {
"namespace": "<string>",
"name": "<string>"
},
"source_load_balancer_id": "<string>",
"target_load_balancer_id": "<string>"
}
],
"warnings": [
"<string>"
]
},
"steps": [
{
"name": "<string>",
"status": "pending",
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"message": "<string>"
}
],
"soak_until": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"error_excerpt": "<string>"
}
}{
"move": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target_cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"zone": "<string>",
"status": "planned",
"plan": {
"target": {
"name": "<string>",
"zone": "<string>",
"network_mode": "<string>",
"storage_tier": "<string>",
"control_plane": {
"plan": "<string>",
"count": 123
},
"bastion_plan": "<string>",
"node_groups": [
{
"name": "<string>",
"plan": "<string>",
"count": 123
}
],
"existing_cluster_id": "<string>"
},
"stacks": [
{
"name": "<string>",
"carried": true,
"reason": "<string>",
"namespaces": [
"<string>"
],
"seeded": true,
"stopped_with_source": true,
"vault": {
"id": "<string>",
"name": "<string>",
"basis": "request"
}
}
],
"data": [
{
"stack": "<string>",
"namespace": "<string>",
"name": "<string>",
"kind": "<string>",
"engine": "<string>",
"requested_bytes": 123,
"storage_class": "<string>",
"target_storage_class": "<string>"
}
],
"not_carried": [
{
"what": "<string>",
"reason": "<string>"
}
],
"dns": [
{
"hostname": "<string>",
"mechanism": "<string>",
"source_origin": "<string>",
"target_origin": "<string>"
}
],
"storage_class_mapping": {},
"load_balancers": [
{
"service": {
"namespace": "<string>",
"name": "<string>"
},
"source_load_balancer_id": "<string>",
"target_load_balancer_id": "<string>"
}
],
"warnings": [
"<string>"
]
},
"steps": [
{
"name": "<string>",
"status": "pending",
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"message": "<string>"
}
],
"soak_until": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"error_excerpt": "<string>"
}
}Move a cluster to another zone
Plans a zone move of an Ankra Cloud cluster and, unless plan_only is true, starts it: the target is created (or the existing target_cluster_id is used), the stacks whose data lives on volumes are copied onto it as drafts with their volumes as a rehearsal, and the move waits in ready_for_cutover. Nothing on the target runs until the cutover. plan_only answers 200 with the plan and writes nothing. Requires stacks.read on the source; a start also needs stacks.write and clusters.operate on the source, backups.operate, and clusters.create unless target_cluster_id is given.
import requests
url = "https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/zone-move"
payload = {
"zone": "<string>",
"target_cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target_name": "<string>",
"plan_only": False,
"control_plane_count": 123,
"control_plane_plan": "<string>",
"worker_plan": "<string>",
"worker_count": 123,
"soak_days": 15,
"vault": "<string>"
}
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({
zone: '<string>',
target_cluster_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
target_name: '<string>',
plan_only: false,
control_plane_count: 123,
control_plane_plan: '<string>',
worker_plan: '<string>',
worker_count: 123,
soak_days: 15,
vault: '<string>'
})
};
fetch('https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/zone-move', 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/imported/{cluster_id}/zone-move \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"zone": "<string>",
"target_cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target_name": "<string>",
"plan_only": false,
"control_plane_count": 123,
"control_plane_plan": "<string>",
"worker_plan": "<string>",
"worker_count": 123,
"soak_days": 15,
"vault": "<string>"
}
'{
"move": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target_cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"zone": "<string>",
"status": "planned",
"plan": {
"target": {
"name": "<string>",
"zone": "<string>",
"network_mode": "<string>",
"storage_tier": "<string>",
"control_plane": {
"plan": "<string>",
"count": 123
},
"bastion_plan": "<string>",
"node_groups": [
{
"name": "<string>",
"plan": "<string>",
"count": 123
}
],
"existing_cluster_id": "<string>"
},
"stacks": [
{
"name": "<string>",
"carried": true,
"reason": "<string>",
"namespaces": [
"<string>"
],
"seeded": true,
"stopped_with_source": true,
"vault": {
"id": "<string>",
"name": "<string>",
"basis": "request"
}
}
],
"data": [
{
"stack": "<string>",
"namespace": "<string>",
"name": "<string>",
"kind": "<string>",
"engine": "<string>",
"requested_bytes": 123,
"storage_class": "<string>",
"target_storage_class": "<string>"
}
],
"not_carried": [
{
"what": "<string>",
"reason": "<string>"
}
],
"dns": [
{
"hostname": "<string>",
"mechanism": "<string>",
"source_origin": "<string>",
"target_origin": "<string>"
}
],
"storage_class_mapping": {},
"load_balancers": [
{
"service": {
"namespace": "<string>",
"name": "<string>"
},
"source_load_balancer_id": "<string>",
"target_load_balancer_id": "<string>"
}
],
"warnings": [
"<string>"
]
},
"steps": [
{
"name": "<string>",
"status": "pending",
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"message": "<string>"
}
],
"soak_until": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"error_excerpt": "<string>"
}
}{
"move": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"target_cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"zone": "<string>",
"status": "planned",
"plan": {
"target": {
"name": "<string>",
"zone": "<string>",
"network_mode": "<string>",
"storage_tier": "<string>",
"control_plane": {
"plan": "<string>",
"count": 123
},
"bastion_plan": "<string>",
"node_groups": [
{
"name": "<string>",
"plan": "<string>",
"count": 123
}
],
"existing_cluster_id": "<string>"
},
"stacks": [
{
"name": "<string>",
"carried": true,
"reason": "<string>",
"namespaces": [
"<string>"
],
"seeded": true,
"stopped_with_source": true,
"vault": {
"id": "<string>",
"name": "<string>",
"basis": "request"
}
}
],
"data": [
{
"stack": "<string>",
"namespace": "<string>",
"name": "<string>",
"kind": "<string>",
"engine": "<string>",
"requested_bytes": 123,
"storage_class": "<string>",
"target_storage_class": "<string>"
}
],
"not_carried": [
{
"what": "<string>",
"reason": "<string>"
}
],
"dns": [
{
"hostname": "<string>",
"mechanism": "<string>",
"source_origin": "<string>",
"target_origin": "<string>"
}
],
"storage_class_mapping": {},
"load_balancers": [
{
"service": {
"namespace": "<string>",
"name": "<string>"
},
"source_load_balancer_id": "<string>",
"target_load_balancer_id": "<string>"
}
],
"warnings": [
"<string>"
]
},
"steps": [
{
"name": "<string>",
"status": "pending",
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"message": "<string>"
}
],
"soak_until": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"error_excerpt": "<string>"
}
}Authorizations
Body
A zone move start. zone is required unless target_cluster_id names an existing cluster to move into.
The backup vault, by name or id, every data copy of the move writes its restore point to (the seed's and the final copy's). Default: each stack's own backup policy vault, else the organisation's only ready vault. With several ready vaults and neither, plan_only lists the stack's data under not_carried and the start answers 422.