import requests
url = "https://platform.ankra.app/api/v1/clusters/import"
payload = { "name": "<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({name: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/clusters/import', 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/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'{
"cluster_id": "<string>",
"import_command": "<string>",
"name": "<string>",
"organisation_id": "<string>",
"commit_sha": "<string>",
"commit_url": "<string>",
"errors": [],
"warnings": []
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Import or update a cluster
Applies an ImportCluster specification: creates the cluster when no cluster with that name exists in your organisation, otherwise updates it, including its stacks and GitOps settings. By default the apply runs in the background and the call answers 202 with {"status": "accepted", "operation_id": "<id>"} (a 409 means an apply for the same cluster is already running). Follow the operation on /api/v1/org/executions/{execution_id}: it settles success or failed, and its step result carries the status code and body the apply would have answered synchronously, including the reason it was refused. Pass wait=true to run it synchronously and receive the result or the rejection reason directly.
import requests
url = "https://platform.ankra.app/api/v1/clusters/import"
payload = { "name": "<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({name: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/clusters/import', 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/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'{
"cluster_id": "<string>",
"import_command": "<string>",
"name": "<string>",
"organisation_id": "<string>",
"commit_sha": "<string>",
"commit_url": "<string>",
"errors": [],
"warnings": []
}{
"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.
Query Parameters
Body
production, staging, development, disposable 1 - 50GitHub Git repository request shape.
Legacy repository: 'owner/name' format is preserved as the API contract because
ankra-cli releases shipped to end-users send this shape. This class is the
__external_type__ for GithubRepositoryResource; renaming or restructuring
the fields is a permanent breaking change and is forbidden.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Members, as kind/name (kind addon, manifest or application), the caller confirms this apply may remove from the stacks it names because the definition no longer lists them. Without it (or prune) such a removal is refused with 422 STACK_MEMBER_REMOVAL_UNCONFIRMED naming the members, and nothing is written: a definition exported before those members were added looks exactly the same. The browser import route does not apply this check.
200Confirm every removal this apply makes: a member of a stack the definition names that the definition no longer lists is stopped and deleted. Send it only when the definition is the complete, current source of truth for those stacks; otherwise name the members in confirmed_member_removals.
Response
Successful Response
- CreateOrUpdateImportClusterResult
- AsyncWriteAcceptedResponse