更新开发机实例
PATCH /compute/aicl/v1/subscriptions/{subscription_name}/resourceGroups/{resource_group_name}/zones/{zone}/containerInstances/{container_instance_name}
请求头(Request Header)
请求参数(Request Parameters
| 名称 | 类型 | 必须 | 位置 | 默认值 | 取值范围 | 描述 |
|---|---|---|---|---|---|---|
| subscription_name | string | 是 | path | - | - | 订阅名称. |
| resource_group_name | string | 是 | path | - | - | 资源组. |
| zone | string | 是 | path | - | - | 可用区. |
| container_instance_name | string | 是 | path | - | - | 开发机实例资源名称. |
| update_mask | string | 否 | query | - | - | 更新标记. |
请求体(Request Body)
| 名称 | 类型 | 必须 | 默认值 | 取值范围 | 描述 |
|---|---|---|---|---|---|
| display_name | string | 否 | - | - | 开发机实例资源别名. |
| description | string | 否 | - | - | 开发机实例资源描述. |
| properties | object | 否 | - | - | 开发机实例规格属性. |
其中,properties的参数如下
| 名称 | 类型 | 必须 | 默认值 | 取值范围 | 描述 |
|---|---|---|---|---|---|
| resources | object | 否 | - | - | 规格属性. |
| volume_mounts | array[object] | 否 | - | - | 卷挂载. |
| expose_services | array[object] | 否 | - | - | 公开服务. |
| ssh_public_keys | array[string] | 否 | - | - | SSH公钥. |
| environment | object | 否 | - | - | 环境变量. |
| virtual_cluster | string | 否 | - | - | 虚拟集群. |
| image | object | 否 | - | - | 镜像 |
| commands | array[string] | 否 | - | - | 命令. |
| vpc | object | 否 | - | - | 虚拟专有网络. |
| cache_service | object | 否 | - | - | 缓存服务. |
其中,resources的参数如下
| 名称 | 类型 | 必须 | 默认值 | 取值范围 | 描述 |
|---|---|---|---|---|---|
| compute_type | string | 否 | - | - | 计算类型. |
| gpu_type | string | 否 | - | - | GPU型号. |
| gpu | string | 否 | - | - | GPU卡数. |
| cpu | string | 否 | - | - | CPU核数. |
| memory | string | 否 | - | - | 内存规格,单位GB. |
| storage | string | 否 | - | - | 磁盘容量,单位GB. |
| network | string | 否 | - | - | 带宽限制,单位Mbps/s. |
| dcu_type | string | 否 | - | - | DCU型号. |
| dcu | string | 否 | - | - | DCU设备卡数目. |
| mlu_type | string | 否 | - | - | MLU型号. |
| mlu | string | 否 | - | - | MLU设备卡数目. |
| cpu_type | string | 否 | - | - | CPU型号. |
| cpu_frequency | string | 否 | - | - | CPU频率. |
| gpu_model | string | 否 | - | - | GPU实例模式. |
其中,compute_type有如下情况
| 状态 | 含义 |
|---|---|
| GPU | GPU型 |
| CPU | CPU型 |
| CPU_PRO | CPU专业型 |
| DCU | DCU型 |
| MLU | MLU型 |
其中,gpu_model有如下情况
| 状态 | 含义 |
|---|---|
| SINGLE | 单实例GPU |
| MULTI | 多实例GPU |
其中,volume_mounts的参数如下
| 名称 | 类型 | 必须 | 默认值 | 取值范围 | 描述 |
|---|---|---|---|---|---|
| name | string | 否 | - | - | 卷名称 |
| host_path | string | 否 | - | - | Host地址 |
| mount_path | string | 否 | - | - | 挂载路径 |
| read_only | boolean | 否 | - | - | 是否只读 |
| volume_attributes | object | 否 | - | - | 卷属性 |
其中,volume_attributes的参数如下
| 名称 | 类型 | 必须 | 默认值 | 取值范围 | 描述 |
|---|---|---|---|---|---|
| volume_id | string | 否 | - | - | 卷id |
| zone | string | 否 | - | - | 卷区域 |
| host | string | 否 | - | - | 卷host |
| port | string | 否 | - | - | 卷端口 |
| uri | string | 否 | - | - | 卷uri |
其中,expose_services的参数如下
| 名称 | 类型 | 必须 | 默认值 | 取值范围 | 描述 |
|---|---|---|---|---|---|
| name | string | 否 | - | - | 服务名称 |
| display_name | string | 否 | - | - | 服务别名 |
| protocol | string | 否 | - | - | 协议 |
| port | integer | 否 | - | - | 端口 |
| address | string | 否 | - | - | 地址 |
| diag_code | string | 否 | - | - | 诊断码. |
其中,image的参数如下
| 名称 | 类型 | 必须 | 默认值 | 取值范围 | 描述 |
|---|---|---|---|---|---|
| name | string | 否 | - | - | 镜像名称 |
| display_name | string | 否 | - | - | 镜像别名 |
| description | string | 否 | - | - | 镜像描述 |
| type | string | 否 | - | - | 镜像类型 |
| size | number | 否 | - | - | 镜像大小 |
| labels | object | 否 | - | - | 镜像标签 |
| resource_type | string | 否 | - | - | 资源类型 |
| image_path | string | 否 | - | - | 镜像地址 |
| creator_id | string | 否 | - | - | 镜像创建人 |
| creation_time | string | 否 | - | - | 镜像创建时间 |
| update_time | string | 否 | - | - | 镜像更新时间 |
| deletion_time | string | 否 | - | - | 镜像删除时间 |
其中,type有如下情况
| 状态 | 含义 |
|---|---|
| OFFICIAL | 官方镜像 |
| USER | 用户镜像 |
| SNAPSHOT | 用户快照 |
其中,vpc的参数如下
| 名称 | 类型 | 必须 | 默认值 | 取值范围 | 描述 |
|---|---|---|---|---|---|
| vpc_id | string | 否 | - | - | 专有网络 ID. |
| namespace | string | 否 | - | - | 命名空间. |
其中,cache_service的参数如下
| 名称 | 类型 | 必须 | 默认值 | 取值范围 | 描述 |
|---|---|---|---|---|---|
| enabled | boolean | 否 | - | - | 是否开启缓存服务. |
请求示例(Request Example)
curl --location --request PATCH 'aicl-openapi-zh.sensecoreapi.dev/compute/aicl-openapi-zh/v1/subscriptions/5ca8ea29-75db-4f42-a08e-52ed52fc1348/resourceGroups/default/zones/cn-sh-01a/containerInstances/c4ac55ef-e9e4-409a-b5ed-c9a6d5976697?update_mask=description%2Cproperties.image.image_path' \
--header 'accept-language: zh-CN' \
--header 'Content-Type: application/json' \
--data '{
"display_name": "yxdcuss",
"description": "yx devssss aiclsss2",
"properties": {
"resources": {
"compute_type": "GPU",
"gpu_type": "A100",
"gpu": "1",
"cpu": "12",
"memory": "120GiB",
"storage": "",
"network": "1Mbps",
"gpu_model": 0,
"dcu_type": "",
"dcu": "2",
"mlu_type": "",
"mlu": " ",
"cpu_type": "",
"cpu_frequency": ""
},
"expose_services": [
],
"ssh_public_keys": [
""
],
"commands": [
],
"vpc": {
"vpc_id": "ae54f3ac-3f30-11ed-ab30-6a25dc1220dd"
}
}
}'
响应(Response)
| 名称 | 类型 | 描述 |
|---|---|---|
| id | string | 开发机实例资源id. |
| name | string | 开发机实例资源名称,需符合正则:^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$. |
| display_name | string | 开发机实例资源别名. |
| description | string | 开发机实例资源描述. |
| uid | string | 开发机实例资源uuid. |
| resource_type | string | 开发机实例资源类型, 例子: compute.aicl-openapi-zh.v1.instance. |
| creator_id | string | 开发机实例创建用户id. |
| owner_id | string | 开发机实例所有者id. |
| tenant_id | string | 租户id. |
| zone | string | 可用区. |
| state | string | 开发机实例状态. |
| sku_id | string | 最小库存单元id. |
| tags | object | 开发机实例资源标签. |
| properties | object | 开发机实例规格属性. |
| order_info | object | 订单信息. |
| deleted | boolean | 开发机实例资源是否删除. |
| create_time | string | 开发机实例资源创建时间. |
| update_time | string | 开发机实例资源更新时间. |
其中,state有如下情况
| 状态 | 含义 |
|---|---|
| CREATING | 创建中(默认值) |
| UPDATING | 更新中 |
| ACTIVE | 已激活 |
| SUSPENDING | 暂停中 |
| RESUMING | 恢复中 |
| DELETING | 删除中 |
| SUSPENDED | 已暂停 |
| DELETED | 已删除 |
| FAILED | 失败 |
其中,properties的参数如下
| 名称 | 类型 | 描述 |
|---|---|---|
| resources | object | 规格属性. |
| volume_mounts | array[object] | 卷挂载. |
| expose_services | array[object] | 公开服务. |
| ssh_public_keys | array[string] | SSH公钥. |
| environment | object | 环境变量. |
| virtual_cluster | string | 虚拟集群. |
| image | object | 镜像 |
| commands | array[string] | 命令. |
| vpc | object | 虚拟专有网络. |
| cache_service | object | 缓存服务. |
其中,resources的参数如下
| 名称 | 类型 | 描述 |
|---|---|---|
| compute_type | string | 计算类型. |
| gpu_type | string | GPU型号. |
| gpu | string | GPU卡数. |
| cpu | string | CPU核数. |
| memory | string | 内存规格,单位GB. |
| storage | string | 磁盘容量,单位GB. |
| network | string | 带宽限制,单位Mbps/s. |
| dcu_type | string | DCU型号. |
| dcu | string | DCU设备卡数目. |
| mlu_type | string | MLU型号. |
| mlu | string | MLU设备卡数目. |
| cpu_type | string | CPU型号. |
| cpu_frequency | string | CPU频率. |
| gpu_model | string | GPU实例模式. |
其中,compute_type有如下情况
| 状态 | 含义 |
|---|---|
| GPU | GPU型 |
| CPU | CPU型 |
| CPU_PRO | CPU专业型 |
| DCU | DCU型 |
| MLU | MLU型 |
其中,gpu_model有如下情况
| 状态 | 含义 |
|---|---|
| SINGLE | 单实例GPU |
| MULTI | 多实例GPU |
其中,volume_mounts的参数如下
| 名称 | 类型 | 描述 |
|---|---|---|
| name | string | 卷名称 |
| host_path | string | Host地址 |
| mount_path | string | 挂载路径 |
| read_only | boolean | 是否只读 |
| volume_attributes | object | 卷属性 |
其中,volume_attributes的参数如下
| 名称 | 类型 | 描述 |
|---|---|---|
| volume_id | string | 卷id |
| zone | string | 卷区域 |
| host | string | 卷host |
| port | string | 卷端口 |
| uri | string | 卷uri |
其中,expose_services的参数如下
| 名称 | 类型 | 描述 |
|---|---|---|
| name | string | 服务名称 |
| display_name | string | 服务别名 |
| protocol | string | 协议 |
| port | integer | 端口 |
| address | string | 地址 |
| diag_code | string | 诊断码. |
其中,image的参数如下
| 名称 | 类型 | 描述 |
|---|---|---|
| name | string | 镜像名称 |
| display_name | string | 镜像别名 |
| description | string | 镜像描述 |
| type | string | 镜像类型 |
| size | number | 镜像大小 |
| labels | object | 镜像标签 |
| resource_type | string | 资源类型 |
| image_path | string | 镜像地址 |
| creator_id | string | 镜像创建人 |
| creation_time | string | 镜像创建时间 |
| update_time | string | 镜像更新时间 |
| deletion_time | string | 镜像删除时间 |
其中,type有如下情况
| 状态 | 含义 |
|---|---|
| OFFICIAL | 官方镜像 |
| USER | 用户镜像 |
| SNAPSHOT | 用户快照 |
其中,vpc的参数如下
| 名称 | 类型 | 描述 |
|---|---|---|
| vpc_id | string | 专有网络 ID. |
| namespace | string | 命名空间. |
其中,cache_service的参数如下
| 名称 | 类型 | 描述 |
|---|---|---|
| enabled | boolean | 是否开启缓存服务. |
其中,order_info的参数如下
| 名称 | 类型 | 描述 |
|---|---|---|
| billing_cycle_number | integer | 购买时长. |
| auto_renew | boolean | 自动续费. |
| currency_code | string | 货币代码. |
| payment_channel | string | 支付方式. |
| note | string | 订单备注. |
| order_type | string | 订单类型. |
| order_id | string | 订单id. |
| start_time | string | 订单生效日期. |
| payment_model | string | 付费类型. |
| billing_model | string | 计费类型. |
| original_id | string | 合同包ID. |
| end_time | string | 订单结束时间. |
其中,payment_channel有如下情况
| 状态 | 含义 |
|---|---|
| PC_UNSPECIFIED | 未指定 |
| PC_BALANCE | 余额支付 |
| PC_CREDIT | 信用支付 |
| PC_FROZENACCOUNT | 冻结款支付 |
| PC_REMIT_OFFLINE | 线下汇款 |
| PC_ALIPAY | 支付宝支付 |
| PC_UNIONPAY | 银联支付 |
| PC_REMIT_ONLINE | 在线转账 |
| PC_CONTRACT | 合同包支付 |
其中,order_type有如下情况
| 状态 | 含义 |
|---|---|
| OT_UNSPECIFIED | 未指定 |
| OT_ORIGINAL | 原始订单 |
| OT_RENEW | 续费订单 |
| OT_UPGRADED | 升配订单 |
| OT_DOWNGRADED | 降配订单 |
| OT_CONTRACT | 合同订单 |
| OT_UNSUBSCRIBE | 退订订单 |
| OT_RESIZE | 扩缩容订单 |
其中,payment_model有如下情况
| 状态 | 含义 |
|---|---|
| PM_UNSPECIFIED | 未指定 |
| PM_PREPAID | 预付 |
| PM_POSTPAID | 后付费 |
其中,billing_model有如下情况
| 状态 | 含义 |
|---|---|
| BM_UNSPECIFIED | 未指定 |
| BM_USAGE | 按量计费 |
| BM_MONTHLY | 包月 |
| BM_YEARLY | 包年 |
响应示例(Response Example)
{
"id": "/subscriptions/5ca8ea29-75db-4f42-a08e-52ed52fc1348/resourceGroups/default/zones/cn-sh-01a/containerInstances/c4ac55ef-e9e4-409a-b5ed-c9a6d5976697",
"name": "c4ac55ef-e9e4-409a-b5ed-c9a6d5976697",
"display_name": "A",
"description": "yx devssss aiclsss2",
"uid": "565afb40-c23e-11ed-bd25-c9a6d5976697",
"resource_type": "compute.aicl-openapi-zh.v1.instance",
"creator_id": "df7c446f-2536-4115-b4ec-3aa34e78c493",
"owner_id": "df7c446f-2536-4115-b4ec-3aa34e78c493",
"tenant_id": "5ca8ea29-75db-4f42-a08e-52ed52fc1348",
"zone": "cn-sh-01a",
"state": "SUSPENDED",
"sku_id": "f66dcad7-4e33-4968-882a-a7eb82ea82a6",
"tags": {},
"properties": {
"resources": {
"compute_type": "GPU",
"gpu_type": "A100",
"gpu": "1",
"cpu": "12",
"memory": "120GiB",
"storage": "",
"network": "1Mbps",
"dcu_type": "",
"dcu": "2",
"mlu_type": "",
"mlu": " ",
"cpu_type": "",
"cpu_frequency": "",
"gpu_model": "SINGLE"
},
"volume_mounts": [
{
"name": "test",
"host_path": "/home/mnt",
"mount_path": "/home/mnt",
"read_only": false,
"volume_attributes": {
"volume_id": "volume-1",
"zone": "cn-sh-01a",
"host": "",
"port": "",
"uri": ""
}
},
{
"name": "test",
"host_path": "/home/mnt1",
"mount_path": "/home/mnt1",
"read_only": false,
"volume_attributes": {
"volume_id": "volume-2",
"zone": "cn-sh-01a",
"host": "",
"port": "",
"uri": ""
}
}
],
"expose_services": [],
"ssh_public_keys": [],
"environment": {
"AILAB_ENV": "dev",
"AILAB_IMAGE": "registry.sensetime.com/lepton/cloud-ai-lab/centos7.7-py3.8-cuda11.3-cudnn8.3-torch1.12.1-spring0.7.3:alpha1",
"AILAB_VOLUME_PATH": "volume-1:/home/mnt,volume-2:/home/mnt1",
"COLLECT_ACTION": "false",
"COMMAND": "",
"DEV_GROUPS": "",
"DEV_USER": "root:2000",
"HOSTNAME": "c4ac55ef-e9e4-409a-b5ed-c9a6d5976697",
"JUPYTERLAB_PORT": "9000",
"NAMESPACE": "defaultcn-sh-01aaicl",
"PUBLIC_KEYS": "",
"ROOTABLE": "true",
"SCC_CONTAINER_MOUNTS": "volume-1:/home/mnt,volume-2:/home/mnt1",
"SCC_ENV": "dev",
"SCC_IMAGE": "registry.sensetime.com/lepton/cloud-ai-lab/centos7.7-py3.8-cuda11.3-cudnn8.3-torch1.12.1-spring0.7.3:alpha1",
"SSHD_PASSWORD": "m0llkPvZOr7bfIKr",
"TELEPORT_AUTH_SERVERS": "aicl-openapi-zh-proxy.cn-sh-01.sensecore.dev:33080",
"TELEPORT_ID": "c4ac55ef-e9e4-409a-b5ed-c9a6d5976697",
"VSCODE_PASSWORD": "m0llkPvZOr7bfIKr",
"VSCODE_PORT": "8000",
"devmachine_id": "defaultcn-sh-01aaicl-c4ac55ef-e9e4-409a-b5ed-c9a6d5976697",
"frp_server_addr": "10.198.64.68",
"frp_server_port": "7000"
},
"virtual_cluster": "",
"image": {
"name": "centos7.7-py3.8-cuda11.3-cudnn8.3-torch1.12.1-spring0.7.3",
"display_name": "",
"description": "",
"type": "USER",
"size": 0,
"labels": {},
"resource_type": "",
"image_path": "registry.sensetime.com/lepton/cloud-ai-lab/centos7.7-py3.8-cuda11.3-cudnn8.3-torch1.12.1-spring0.7.3:alpha1",
"creator_id": "",
"creation_time": null,
"update_time": null,
"deletion_time": null
},
"commands": [],
"vpc": {
"vpc_id": "ae54f3ac-3f30-11ed-ab30-6a25dc1220dd",
"namespace": ""
},
"cache_service": null
},
"order_info": {
"billing_cycle_number": 1,
"auto_renew": true,
"currency_code": "CNY",
"payment_channel": "PC_UNSPECIFIED",
"note": "",
"order_type": "OT_ORIGINAL",
"order_id": "do s",
"start_time": "2023-03-13T02:43:14Z",
"payment_model": "PM_PREPAID",
"billing_model": "BM_MONTHLY",
"original_id": "",
"end_time": null
},
"deleted": false,
"create_time": "2023-08-31T09:52:20.224260Z",
"update_time": "2023-09-04T02:56:27.672672Z"
}