Skip to main content
POST
/
api
/
v1
/
clusters
/
import
Create Or Update Import Cluster Endpoint
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)
{
  "name": "<string>",
  "cluster_id": "<string>",
  "organisation_id": "<string>",
  "import_command": "<string>",
  "errors": [],
  "commit_sha": "<string>",
  "commit_url": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

authorization
string | null
x-ankra-organisation-id
string | null

Query Parameters

wait
boolean
default:false

Body

application/json
name
string
required
description
string | null
spec
ResourceSpecification · object
expected_git_repository
GitRepository · object

GitHub 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.

Response

Successful Response

name
string
required
cluster_id
string<uuid4>
required
organisation_id
string<uuid4>
required
import_command
string
required
errors
ResourceError · object[]
commit_sha
string | null
commit_url
string | null