DevStage API

Query DevStage configuration, templates, and specs, create development environments, and start, stop, or delete them.

These endpoints target development environments created from Grape AI Devspace templates. All are user_only: grape_ API key or web JWT; tk_ returns 403.

Prerequisite: templates, specs, environments, start and stop, and deletion all require the current user to have Huawei Cloud AK/SK configured. Without it, the request returns 400.

Endpoints

Method Path Purpose
GET /api/devstage/config Check configuration status
PUT /api/devstage/config Update configuration
GET /api/devstage/templates Available templates
GET /api/devstage/specs Available specs
GET /api/devstage/environments Development environment list
POST /api/devstage/environments Create an environment
POST /api/devstage/environments/{action} Start / stop
DELETE /api/devstage/environments/{devstage_id} Delete an environment

GET /api/devstage/config

Response

{"base_url":"https://<devstage-host>","configured":true,"ak_exists":true,"sk_exists":true}

PUT /api/devstage/config

Request body

{"base_url":"https://<devstage-host>","ak":"<access-key>","sk":"<secret-key>"}

All three fields are optional. base_url must start with http:// or https://; a non-empty ak / sk is written to the current user's Huawei Cloud credentials.

GET /api/devstage/templates

Response

{"templates":[{"uuid":"...","name":"...","image_name":"...","container_type":"...","is_public":true,"description":"..."}]}

GET /api/devstage/specs

Query: template_id (optional).

Response: {"specs":[...]}.

GET /api/devstage/environments

Returns only environments created from Grape AI Devspace templates. worker_online indicates whether the corresponding Worker is online.

{"environments":[{"id":"...","name":"...","template":"...","spec":"...","status":"running","worker_online":true}]}

POST /api/devstage/environments

Creates an environment but does not start it automatically.

Request body

{"name":"<env-name>","grape_server":"https://<your-domain>","grape_token":"<token>"}

Response

{"devstage_id":"...","message":"Created"}

After creation the status is cde.0004 (ready); call start to power it on.

POST /api/devstage/environments/{action}

action accepts only start / stop.

Request body

{"devstage_id":"..."}

The response passes through the cloud-side result. A missing devstage_id or an invalid action returns 400.

DELETE /api/devstage/environments/{devstage_id}

Deletes the development environment and the corresponding Worker credential.

Common errors

Status Cause
400 Invalid parameter or action, or Huawei Cloud AK/SK is not configured
401 Unauthenticated
403 tk_ was used
404 Environment not found
502 Upstream DevStage failure

Runtime and Worker | Huawei Cloud integration | Authentication and credentials