Lybic Docs

Create Sandbox from Image

Creates a new sandbox from a machine image.

POST
/api/orgs/{orgId}/sandboxes/from-image

Creates a new sandbox from a machine image.

Path Parameters

orgId*string

组织 ID

Request Body

application/json

imageId*string

The machine image ID to create sandbox from.

name*string

沙箱的名称。

Length1 <= length <= 100
maxLifeSeconds*integer

The maximum life time of the sandbox in seconds.

Range300 <= value <= 604800
projectId?string

用于沙箱的项目 ID。如果未提供,则使用默认值。

Response Body

application/json

curl -X POST "https://loading/api/orgs/string/sandboxes/from-image" \  -H "Content-Type: application/json" \  -d '{    "imageId": "string",    "name": "string",    "maxLifeSeconds": 300  }'
{
  "sandbox": {
    "id": "string",
    "name": "string",
    "expiredAt": "2019-08-24T14:15:22Z",
    "expiresAt": "2019-08-24T14:15:22Z",
    "createdAt": "2019-08-24T14:15:22Z",
    "projectId": "string",
    "shapeName": "string",
    "status": "PENDING"
  },
  "bookId": "string"
}