Skip to content
Odinex Cloud
API reference

Stacks

List stacks

GET
/stacks

Authorization

headerAuthorizationBearer <token>

Response Body

Stacks

application/json
  1. response
stacks*array<>
curl -X GET "https://example.com/stacks"
{  "stacks": [    {      "id": 0,      "name": "string",      "description": "string",      "location": "string",      "status": "draft",      "spec": {},      "applied_spec": {},      "resources": [        {          "key": "string",          "type": "string",          "id": 0,          "name": "string",          "status": "string"        }      ],      "errors": [        {          "key": "string",          "code": "string",          "message": "string"        }      ],      "labels": {        "property1": "string",        "property2": "string"      },      "created": "2019-08-24T14:15:22Z",      "updated": "2019-08-24T14:15:22Z"    }  ]}

Create stack (draft)

POST
/stacks

Authorization

headerAuthorizationBearer <token>

Request Body

application/json
  1. body
name*string
Length1 <= length <= 64
description?string
Lengthlength <= 1000
location*string
spec?

Stack document; see the Stacks tag for the format

labels?

Up to 64 key/value pairs; keys and values up to 63 characters

Response Body

Created

application/json
  1. response
stack*
curl -X POST "https://example.com/stacks" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "location": "string"  }'
{  "stack": {    "id": 0,    "name": "string",    "description": "string",    "location": "string",    "status": "draft",    "spec": {},    "applied_spec": {},    "resources": [      {        "key": "string",        "type": "string",        "id": 0,        "name": "string",        "status": "string"      }    ],    "errors": [      {        "key": "string",        "code": "string",        "message": "string"      }    ],    "labels": {      "property1": "string",      "property2": "string"    },    "created": "2019-08-24T14:15:22Z",    "updated": "2019-08-24T14:15:22Z"  }}
GET
/stacks/topology

The project's resources in a location as a stack document, for the canvas. Nothing is linked to a stack.

Authorization

headerAuthorizationBearer <token>

Query Parameters

location*string

Response Body

Topology

application/json
  1. response
spec*

Stack document; see the Stacks tag for the format

resources*array<>
curl -X GET "https://example.com/stacks/topology?location=string"
{  "spec": {},  "resources": [    {      "key": "string",      "type": "string",      "id": 0,      "name": "string",      "status": "string"    }  ]}

Assistant availability

GET
/stacks/assistant

Authorization

headerAuthorizationBearer <token>

Response Body

Assistant

application/json
  1. response
enabled*boolean
curl -X GET "https://example.com/stacks/assistant"
{  "enabled": true}
POST
/stacks/assistant

Describe the setup in plain language; the assistant writes a new version of the document (nothing is created). Send the document on the canvas and the earlier turns to refine it. The answer takes up to a couple of minutes: the request returns a draft at once; poll GET /stacks/assistant/drafts/{id} until its status is done or failed.

Authorization

headerAuthorizationBearer <token>

Request Body

application/json
  1. body
location*string
prompt*string
Length1 <= length <= 4000
spec?

Stack document; see the Stacks tag for the format

history?array<>
Itemsitems <= 20

Response Body

Draft started

application/json
  1. response
draft*
curl -X POST "https://example.com/stacks/assistant" \  -H "Content-Type: application/json" \  -d '{    "location": "string",    "prompt": "string"  }'
{  "draft": {    "id": 0,    "status": "running",    "message": "string",    "spec": {},    "problems": [      "string"    ],    "error": {      "code": "string",      "message": "string"    },    "created": "2019-08-24T14:15:22Z"  }}

Get an assistant draft

GET
/stacks/assistant/drafts/{id}

Authorization

headerAuthorizationBearer <token>

Path Parameters

id*integer
Formatint64

Response Body

Draft

application/json
  1. response
draft*
curl -X GET "https://example.com/stacks/assistant/drafts/0"
{  "draft": {    "id": 0,    "status": "running",    "message": "string",    "spec": {},    "problems": [      "string"    ],    "error": {      "code": "string",      "message": "string"    },    "created": "2019-08-24T14:15:22Z"  }}

Get stack

GET
/stacks/{id}

Authorization

headerAuthorizationBearer <token>

Path Parameters

id*integer
Formatint64

Response Body

Stack

application/json
  1. response
stack*
curl -X GET "https://example.com/stacks/0"
{  "stack": {    "id": 0,    "name": "string",    "description": "string",    "location": "string",    "status": "draft",    "spec": {},    "applied_spec": {},    "resources": [      {        "key": "string",        "type": "string",        "id": 0,        "name": "string",        "status": "string"      }    ],    "errors": [      {        "key": "string",        "code": "string",        "message": "string"      }    ],    "labels": {      "property1": "string",      "property2": "string"    },    "created": "2019-08-24T14:15:22Z",    "updated": "2019-08-24T14:15:22Z"  }}

Delete stack

DELETE
/stacks/{id}

Deletes every resource of the stack, then the stack. With keep_resources the resources stay and only the stack goes.

Authorization

headerAuthorizationBearer <token>

Path Parameters

id*integer
Formatint64

Query Parameters

keep_resources?boolean
Defaultfalse

Response Body

Deletion started (or done, with keep_resources)

application/json
  1. response
stack*
plan?
curl -X DELETE "https://example.com/stacks/0"
{  "stack": {    "id": 0,    "name": "string",    "description": "string",    "location": "string",    "status": "draft",    "spec": {},    "applied_spec": {},    "resources": [      {        "key": "string",        "type": "string",        "id": 0,        "name": "string",        "status": "string"      }    ],    "errors": [      {        "key": "string",        "code": "string",        "message": "string"      }    ],    "labels": {      "property1": "string",      "property2": "string"    },    "created": "2019-08-24T14:15:22Z",    "updated": "2019-08-24T14:15:22Z"  },  "plan": {    "items": [      {        "key": "string",        "base_key": "string",        "type": "string",        "name": "string",        "action": "create",        "changes": [          "string"        ],        "resource_id": 0,        "price_monthly": {          "net": "0.0064000000",          "gross": "0.0064000000",          "currency": "EUR"        }      }    ],    "errors": [      "string"    ],    "warnings": [      "string"    ],    "monthly_before": {      "net": "0.0064000000",      "gross": "0.0064000000",      "currency": "EUR"    },    "monthly_after": {      "net": "0.0064000000",      "gross": "0.0064000000",      "currency": "EUR"    }  }}
PUT
/stacks/{id}

Authorization

headerAuthorizationBearer <token>

Path Parameters

id*integer
Formatint64

Request Body

application/json
  1. body
name?string
Length1 <= length <= 64
description?string
Lengthlength <= 1000
spec?

Stack document; see the Stacks tag for the format

labels?

Up to 64 key/value pairs; keys and values up to 63 characters

Response Body

Updated

application/json
  1. response
stack*
curl -X PUT "https://example.com/stacks/0" \  -H "Content-Type: application/json" \  -d '{}'
{  "stack": {    "id": 0,    "name": "string",    "description": "string",    "location": "string",    "status": "draft",    "spec": {},    "applied_spec": {},    "resources": [      {        "key": "string",        "type": "string",        "id": 0,        "name": "string",        "status": "string"      }    ],    "errors": [      {        "key": "string",        "code": "string",        "message": "string"      }    ],    "labels": {      "property1": "string",      "property2": "string"    },    "created": "2019-08-24T14:15:22Z",    "updated": "2019-08-24T14:15:22Z"  }}
POST
/stacks/{id}/plan

Authorization

headerAuthorizationBearer <token>

Path Parameters

id*integer
Formatint64

Response Body

Plan

application/json
  1. response
plan*
curl -X POST "https://example.com/stacks/0/plan"
{  "plan": {    "items": [      {        "key": "string",        "base_key": "string",        "type": "string",        "name": "string",        "action": "create",        "changes": [          "string"        ],        "resource_id": 0,        "price_monthly": {          "net": "0.0064000000",          "gross": "0.0064000000",          "currency": "EUR"        }      }    ],    "errors": [      "string"    ],    "warnings": [      "string"    ],    "monthly_before": {      "net": "0.0064000000",      "gross": "0.0064000000",      "currency": "EUR"    },    "monthly_after": {      "net": "0.0064000000",      "gross": "0.0064000000",      "currency": "EUR"    }  }}

Apply the stack

POST
/stacks/{id}/apply

Starts creating, updating and deleting resources so they match the document. Follow progress through the stack's status and resources.

Authorization

headerAuthorizationBearer <token>

Path Parameters

id*integer
Formatint64

Response Body

Apply started

application/json
  1. response
stack*
plan*
curl -X POST "https://example.com/stacks/0/apply"
{  "stack": {    "id": 0,    "name": "string",    "description": "string",    "location": "string",    "status": "draft",    "spec": {},    "applied_spec": {},    "resources": [      {        "key": "string",        "type": "string",        "id": 0,        "name": "string",        "status": "string"      }    ],    "errors": [      {        "key": "string",        "code": "string",        "message": "string"      }    ],    "labels": {      "property1": "string",      "property2": "string"    },    "created": "2019-08-24T14:15:22Z",    "updated": "2019-08-24T14:15:22Z"  },  "plan": {    "items": [      {        "key": "string",        "base_key": "string",        "type": "string",        "name": "string",        "action": "create",        "changes": [          "string"        ],        "resource_id": 0,        "price_monthly": {          "net": "0.0064000000",          "gross": "0.0064000000",          "currency": "EUR"        }      }    ],    "errors": [      "string"    ],    "warnings": [      "string"    ],    "monthly_before": {      "net": "0.0064000000",      "gross": "0.0064000000",      "currency": "EUR"    },    "monthly_after": {      "net": "0.0064000000",      "gross": "0.0064000000",      "currency": "EUR"    }  }}