Skip to main content
POST
/
api
/
v1
/
clusters
/
validate
Validate Import Cluster Endpoint
import requests

url = "https://platform.ankra.app/api/v1/clusters/validate"

payload = { "spec": {
        "argo_cd": {
            "namespace": "<string>",
            "version": "<string>"
        },
        "git_repository": {
            "branch": "<string>",
            "credential_name": "<string>",
            "repository": "<string>",
            "provider": "github"
        },
        "kubernetes": { "version": "0.0.0" },
        "prometheus_credential": {
            "name": "<string>",
            "password": "<string>",
            "token": "<string>",
            "username": "<string>"
        },
        "prometheus_metrics": {
            "endpoint": "<string>",
            "credential_name": "<string>",
            "flavor": "<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'
},
kubernetes: {version: '0.0.0'},
prometheus_credential: {
name: '<string>',
password: '<string>',
token: '<string>',
username: '<string>'
},
prometheus_metrics: {endpoint: '<string>', credential_name: '<string>', flavor: '<string>'},
provider: 'imported',
stacks: []
}
})
};

fetch('https://platform.ankra.app/api/v1/clusters/validate', 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/validate \
--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"
},
"kubernetes": {
"version": "0.0.0"
},
"prometheus_credential": {
"name": "<string>",
"password": "<string>",
"token": "<string>",
"username": "<string>"
},
"prometheus_metrics": {
"endpoint": "<string>",
"credential_name": "<string>",
"flavor": "<string>"
},
"provider": "imported",
"stacks": []
}
}
'
{
  "errors": [],
  "warnings": []
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<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

cluster_id
string<uuid4> | null

Body

application/json
spec
ResourceSpecification · object
required
strict_secrets
boolean
default:false

Response

Successful Response

errors
ResourceError · object[]
warnings
ValidationWarning · object[]