跳转到主要内容
模版管理

更新模版

更新指定模版的配置

PUT
/api/v1/agentstudio/sandbox/templates/{templateCode}
cURL
curl --request PUT \
  --url 'https://{workspace_id}.{region}.maas.aliyuncs.com/api/v1/agentstudio/sandbox/templates/{templateCode}' \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "cpuCount": 0,
  "memoryMB": 0,
  "fromImage": "<string>",
  "imageName": "<string>",
  "mntConfig": [
    {
      "originFileName": "<string>",
      "originFileId": "<string>",
      "mountPath": "<string>"
    }
  ],
  "networkConfig": {
    "allowOut": [
      "<string>"
    ],
    "denyOut": [
      "<string>"
    ]
  },
  "envConfig": {},
  "autoPauseTime": 0,
  "maxRunningTimeout": 0,
  "description": "<string>"
}
'
{
  "templateID": "<string>",
  "templateName": "<string>",
  "cpuCount": 0,
  "memoryMB": 0,
  "buildID": "<string>",
  "buildStatus": "<string>",
  "version": 0,
  "createdAt": "<string>",
  "updatedAt": "<string>"
}

鉴权

string
header
必填

路径参数

string
必填

模版唯一 code(即创建接口返回的 templateID)

请求体

application/json
string

模版名称,未传时保留原名称

integer

vCPU 数量,必须与 memoryMB 同时传;未传时保留原规格

integer

内存大小,单位 MB,必须与 cpuCount 同时传;未传时保留原规格

string

基础镜像,未传时保留原镜像

string

镜像展示名称,未传时保留原展示名称

object[]

文件挂载配置,传入时重新校验文件 ID

object

网络规则,与创建模版一致

object

替换为本次传入的环境变量键值对

integer

到期自动暂停时间,单位秒,取值范围 [300,604800]

300 <= x <= 604800
integer

最大运行时间,单位秒,取值范围 [300,604800]

300 <= x <= 604800
string

模版描述

响应

200-application/json
string

模版 ID,更新前后保持不变

string

模版名称

integer

vCPU 数量

integer

内存大小,单位 MB

string

新版本构建 ID,用于查询构建状态

string

构建状态,可能为 building

integer

模版版本号,每次成功更新后递增

string

模版首次创建时间

string

本次更新时间