Logo
OpenScaler

Submit Studio requests

POST
/v1/studio/requests

Submit one or many Studio requests (e.g. create resources). Items in a single request run in parallel. Returns 202 after submission is successful, the action will start executing after that. Running an action on the same node twice will return a 409 (conflict) response.

Authorization

bearer_auth
AuthorizationBearer <token>

Authentication

Create an API token on Profile, or with osctl auth login. Send it in the Authorization header:

Authorization: Bearer os1_...

Do not use the Keycloak web-session JWT as an API token. Keep the secret secure and do not share it.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

text/pain

application/json

application/json

application/json

curl -X POST "https://example.com/v1/studio/requests" \  -H "Content-Type: application/json" \  -d '{    "project_id": "default",    "items": [      {        "action": "computer.create",        "node_id": "pending-computer-1",        "body": {}      }    ]  }'
{  "requests": [    {      "id": "0196f0c0-7a3e-7b33-99a7-85d78d7a3320",      "node_id": "pending-computer-1",      "action": "computer.create",      "status": "pending",      "preview": {},      "resource_id": "string",      "error": "string",      "status_code": 409,      "created_at": "2019-08-24T14:15:22Z",      "completed_at": "2019-08-24T14:15:22Z"    }  ],  "pending_count": 2}
{  "errors": [    {      "message": "'vcpus' field must be an integer",      "field": "resource_id"    }  ]}
"Access denied"
{  "errors": [    {      "message": "'vcpus' field must be an integer",      "field": "resource_id"    }  ]}
{  "errors": [    {      "message": "User not initialized. Send POST /v1/init, then retry the request."    }  ]}
{  "errors": [    {      "message": "VM with ID 23 not found"    }  ]}