Create a cluster stack
import requests
url = "https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/stacks"
payload = { "spec": {
"argo_cd": {
"namespace": "<string>",
"version": "<string>"
},
"git_repository": {
"branch": "<string>",
"credential_name": "<string>",
"repository": "<string>",
"provider": "github"
},
"helm_registries": [
{
"name": "<string>",
"url": "<string>",
"credential_name": "<string>",
"exclude_charts": ["<string>"]
}
],
"kubernetes": { "version": "0.0.0" },
"prometheus_credential": {
"name": "<string>",
"password": "<string>",
"token": "<string>",
"username": "<string>"
},
"prometheus_metrics": {
"endpoint": "<string>",
"credential_name": "<string>",
"flavor": "<string>",
"tenant_id": "<string>"
},
"provider": "imported",
"stacks": []
} }
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({
spec: {
argo_cd: {namespace: '<string>', version: '<string>'},
git_repository: {
branch: '<string>',
credential_name: '<string>',
repository: '<string>',
provider: 'github'
},
helm_registries: [
{
name: '<string>',
url: '<string>',
credential_name: '<string>',
exclude_charts: ['<string>']
}
],
kubernetes: {version: '0.0.0'},
prometheus_credential: {
name: '<string>',
password: '<string>',
token: '<string>',
username: '<string>'
},
prometheus_metrics: {
endpoint: '<string>',
credential_name: '<string>',
flavor: '<string>',
tenant_id: '<string>'
},
provider: 'imported',
stacks: []
}
})
};
fetch('https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/stacks', 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}/stacks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"spec": {
"argo_cd": {
"namespace": "<string>",
"version": "<string>"
},
"git_repository": {
"branch": "<string>",
"credential_name": "<string>",
"repository": "<string>",
"provider": "github"
},
"helm_registries": [
{
"name": "<string>",
"url": "<string>",
"credential_name": "<string>",
"exclude_charts": [
"<string>"
]
}
],
"kubernetes": {
"version": "0.0.0"
},
"prometheus_credential": {
"name": "<string>",
"password": "<string>",
"token": "<string>",
"username": "<string>"
},
"prometheus_metrics": {
"endpoint": "<string>",
"credential_name": "<string>",
"flavor": "<string>",
"tenant_id": "<string>"
},
"provider": "imported",
"stacks": []
}
}
'{
"stack_name": "<string>",
"commit_sha": "<string>",
"commit_url": "<string>",
"errors": [],
"job_count": 0,
"noop_count": 0,
"operation_id": "<string>",
"settings_only_count": 0,
"warnings": []
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Imported Clusters
Create a cluster stack
Creates a stack on the cluster from a specification holding exactly one stack, deploys it, and commits it to the cluster’s GitOps repository when one is connected. The response carries validation errors and warnings, the commit, and the operation_id of the deployment; a failed Git push answers 422. On a sandbox cluster the deployment is simulated and settled before the response, so the operation has already succeeded. Requires stacks.write on the cluster; a caller without it is refused with 403.
POST
/
api
/
v1
/
org
/
clusters
/
imported
/
{cluster_id}
/
stacks
Create a cluster stack
import requests
url = "https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/stacks"
payload = { "spec": {
"argo_cd": {
"namespace": "<string>",
"version": "<string>"
},
"git_repository": {
"branch": "<string>",
"credential_name": "<string>",
"repository": "<string>",
"provider": "github"
},
"helm_registries": [
{
"name": "<string>",
"url": "<string>",
"credential_name": "<string>",
"exclude_charts": ["<string>"]
}
],
"kubernetes": { "version": "0.0.0" },
"prometheus_credential": {
"name": "<string>",
"password": "<string>",
"token": "<string>",
"username": "<string>"
},
"prometheus_metrics": {
"endpoint": "<string>",
"credential_name": "<string>",
"flavor": "<string>",
"tenant_id": "<string>"
},
"provider": "imported",
"stacks": []
} }
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({
spec: {
argo_cd: {namespace: '<string>', version: '<string>'},
git_repository: {
branch: '<string>',
credential_name: '<string>',
repository: '<string>',
provider: 'github'
},
helm_registries: [
{
name: '<string>',
url: '<string>',
credential_name: '<string>',
exclude_charts: ['<string>']
}
],
kubernetes: {version: '0.0.0'},
prometheus_credential: {
name: '<string>',
password: '<string>',
token: '<string>',
username: '<string>'
},
prometheus_metrics: {
endpoint: '<string>',
credential_name: '<string>',
flavor: '<string>',
tenant_id: '<string>'
},
provider: 'imported',
stacks: []
}
})
};
fetch('https://platform.ankra.app/api/v1/org/clusters/imported/{cluster_id}/stacks', 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}/stacks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"spec": {
"argo_cd": {
"namespace": "<string>",
"version": "<string>"
},
"git_repository": {
"branch": "<string>",
"credential_name": "<string>",
"repository": "<string>",
"provider": "github"
},
"helm_registries": [
{
"name": "<string>",
"url": "<string>",
"credential_name": "<string>",
"exclude_charts": [
"<string>"
]
}
],
"kubernetes": {
"version": "0.0.0"
},
"prometheus_credential": {
"name": "<string>",
"password": "<string>",
"token": "<string>",
"username": "<string>"
},
"prometheus_metrics": {
"endpoint": "<string>",
"credential_name": "<string>",
"flavor": "<string>",
"tenant_id": "<string>"
},
"provider": "imported",
"stacks": []
}
}
'{
"stack_name": "<string>",
"commit_sha": "<string>",
"commit_url": "<string>",
"errors": [],
"job_count": 0,
"noop_count": 0,
"operation_id": "<string>",
"settings_only_count": 0,
"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.
Path Parameters
Body
application/json
Show child attributes
Show child attributes
Response
Successful Response
Show child attributes
Show child attributes
Show child attributes
Show child attributes