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

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

payload = { "spec": {
        "git_repository": {
            "provider": "github",
            "credential_name": "<string>",
            "branch": "<string>",
            "repository": "<string>"
        },
        "prometheus_metrics": {
            "endpoint": "<string>",
            "credential_name": "<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)
{
  "stack_name": "<string>",
  "errors": [],
  "commit_sha": "<string>",
  "commit_url": "<string>",
  "operation_id": "<string>",
  "job_count": 0
}

Authorizations

Authorization
string
header
required

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

Headers

authorization
string | null

Path Parameters

cluster_id
string<uuid4>
required

Body

application/json
spec
ResourceSpecification · object
required

Response

Successful Response

stack_name
string
required
errors
ResourceError · object[]
commit_sha
string | null
commit_url
string | null
operation_id
string<uuid4> | null
job_count
integer
default:0