Skip to main content
POST
/
api
/
v1
/
clusters
/
{cluster_id}
/
stacks
/
draft
Create Cluster Stack Draft Endpoint
import requests

url = "https://platform.ankra.app/api/v1/clusters/{cluster_id}/stacks/draft"

payload = { "spec": {
        "git_repository": {
            "credential_name": "<string>",
            "branch": "<string>",
            "repository": "<string>",
            "provider": "github"
        },
        "prometheus_metrics": {
            "endpoint": "<string>",
            "credential_name": "<string>",
            "flavor": "<string>"
        },
        "prometheus_credential": {
            "name": "<string>",
            "username": "<string>",
            "password": "<string>",
            "token": "<string>"
        },
        "stacks": [],
        "kubernetes": { "version": "0.0.0" },
        "provider": "imported",
        "argo_cd": {
            "namespace": "<string>",
            "version": "<string>"
        }
    } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
{
  "draft_id": "<string>",
  "version": 1,
  "errors": []
}

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

Path Parameters

cluster_id
string<uuid4>
required

Body

application/json
spec
ResourceSpecification · object
required

Response

Successful Response

draft_id
string<uuid4>
required
version
integer
default:1
errors
ResourceError · object[]