Lybic Docs

从镜像创建沙箱

从镜像创建新的沙箱。

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

从镜像创建新的沙箱。

Path Parameters

orgId*string

组织 ID

Request Body

application/json

imageId*string

用于创建沙箱的镜像 ID。

name*string

沙箱的名称。

Length1 <= length <= 100
maxLifeSeconds*integer

沙箱的最大存活时间(秒)。

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"
}