Import a stack profile as a draft
import requests
url = "https://platform.ankra.app/api/v1/org/stack-profiles/import-draft"
payload = { "content_base64": "<string>" }
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({content_base64: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/stack-profiles/import-draft', 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/stack-profiles/import-draft \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content_base64": "<string>"
}
'{
"draft": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"spec": {},
"parameters": [
{
"name": "<string>",
"title": "<string>",
"description": "<string>",
"type": "string",
"required": false,
"default": "<string>",
"enum_values": [
"<string>"
],
"pattern": "<string>",
"group": "<string>",
"resource_kind": "<string>",
"resource_name": "<string>",
"path": "<string>",
"options": [
{
"value": "<string>",
"title": "<string>",
"description": "<string>",
"sets": {}
}
]
}
],
"base_version": 123,
"version": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"category": "<string>",
"tags": [
"<string>"
],
"requested_visibility": "<string>",
"suggestion_target_profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"suggestion_base_version": 123
},
"warnings": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Stack Profiles
Import a stack profile as a draft
Opens a builder draft from a base64 ClusterInfrastructureAsCode document instead of publishing it, so the result can be reviewed before publish. Answers 201 with the draft and the import warnings; 409 when a draft with that name, or an open draft for the matching profile, already exists.
POST
/
api
/
v1
/
org
/
stack-profiles
/
import-draft
Import a stack profile as a draft
import requests
url = "https://platform.ankra.app/api/v1/org/stack-profiles/import-draft"
payload = { "content_base64": "<string>" }
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({content_base64: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/stack-profiles/import-draft', 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/stack-profiles/import-draft \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content_base64": "<string>"
}
'{
"draft": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"spec": {},
"parameters": [
{
"name": "<string>",
"title": "<string>",
"description": "<string>",
"type": "string",
"required": false,
"default": "<string>",
"enum_values": [
"<string>"
],
"pattern": "<string>",
"group": "<string>",
"resource_kind": "<string>",
"resource_name": "<string>",
"path": "<string>",
"options": [
{
"value": "<string>",
"title": "<string>",
"description": "<string>",
"sets": {}
}
]
}
],
"base_version": 123,
"version": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"category": "<string>",
"tags": [
"<string>"
],
"requested_visibility": "<string>",
"suggestion_target_profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"suggestion_base_version": 123
},
"warnings": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json