变更配置
更新时间:2026-02-25
接口描述
变更开发机配置
请求结构
Plain Text
1POST ?action=ModifyDevInstance
2HTTP/1.1
3Host:aihc.bj.baidubce.com
4version: v2
5Authorization:authorization string
6{
7 "name": name,
8 "id": id,
9 "conf": {
10 "resources": {
11 "acceleratorType": acceleratorType,
12 "acceleratorCount": acceleratorCount,
13 "cpu": cpus,
14 "memory": memory,
15 "shmSize":shmSize
16 },
17 "access": {
18 "blbId": blbId,
19 "sshEnable": sshEnable,
20 "sshRSAPubKey": sshRSAPubKey,
21 "portInfo": [{
22 "name": name,
23 "port": port,
24 "accessPort": accessPort
25 }]
26 },
27 "scheduleConf": {
28 "priority": priority,
29 "cpuNodeAffinity": cpuNodeAffinity
30 },
31 "envs": envs,
32 "workspaceDir": workspaceDir,
33 "startCmd": startCmd,
34 "image": {
35 "imageType": imageType,
36 "imageUrl": imageUrl,
37 "username": username,
38 "password": password
39 },
40 "volumnConfs": [
41 {
42 "volumnType": volumnType,
43 "pfs": {
44 "instanceId": instanceId,
45 "sourcePath": sourcePath
46 },
47 "dataset": {
48 "datasetId": datasetId,
49 "versionId": versionId,
50 "source": source,
51 "storageType": storageType,
52 "bos": {
53 "version": version,
54 "srcPath": srcPath,
55 "cacheLimitSize": cacheLimitSize
56 },
57 "pfs": {
58 "clientID": clientID,
59 "clusterPort": clusterPort,
60 "pfsParentDir": pfsParentDir,
61 "pfsPath": pfsPath,
62 "instanceType": instanceType,
63 "region": region,
64 "instanceId": instanceId,
65 "clusterIP": clusterIP,
66 "mountTargetId": mountTargetId,
67 "hostMountPath": hostMountPath,
68 "srcPath": srcPath
69 },
70 "mountPath": mountPath
71 },
72 "cfs": {
73 "instanceId": instanceId,
74 "sourcePath": sourcePath,
75 "mountPoint": mountPoint
76 },
77 "cds": {
78 "capacity": capacity
79 },
80 "bos": {
81 "sourcePath": sourcePath
82 }
83 "mountPath": mountPath,
84 "readOnly": readOnly
85 }
86 ]
87 },
88 "visibleScope": {
89 "type": type
90 },
91 "notify": {
92 "notifyRuleId": notifyRuleId,
93 "isOpen": isOpen
94 },
95 "isPublicMgmt": isPublicMgmt,
96 "creator": creator,
97 "creatorId": creatorId
98}
请求头域
除公共头域外,无其它特殊头域。
请求参数
| 参数名称 | 参数类型 | 是否必须 | 参数位置 | 参数说明 |
|---|---|---|---|---|
| name | String | 是 | Body参数 | 开发机名称(需满足正则表达式^[a-z][a-z0-9-]*[a-z0-9]$,长度不高于32 ;不可修改) |
| id | String | 是 | Body参数 | 开发机实例ID |
| conf | DevInstanceConf | 是 | Body参数 | 开发机配置信息 |
| visibleScope | VisibleScope | 否 | Body参数 | 开发机可见范围。 |
| notify | Notify | 否 | Body参数 | 通知配置 |
| isPublicMgmt | Bool | 否 | Body参数 | 是否公开管理,true 为是 |
| creator | String | 是 | Body参数 | 开发机所有者 |
| creatorId | String | 是 | Body参数 | 开发机所有者用户ID |
返回头域
除公共头域,无其它特殊头域。
返回参数
| 参数名称 | 类型 | 说明 |
|---|---|---|
| requestId | string | 请求唯一标识 |
| devInstanceId | string | 开发机ID |
请求示例
Plain Text
1POST ?action=ModifyDevInstance
2HTTP/1.1
3Host:aihc.bj.baidubce.com
4version: v2
5Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2024-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
6{
7 "name": "dingtest-openapi",
8 "id": "dv-64706ff6",
9 "conf": {
10 "resourcePool": {
11 "resourcePoolType": "",
12 "resourcePoolId": "cce-i8zab7dh",
13 "queueName": "default",
14 "resourcePoolName": "bjtest-regress-no-delete-songmingming01"
15 },
16 "resources": {
17 "cpus": 2,
18 "acceleratorCount": 0,
19 "acceleratorType": "",
20 "memory": 2,
21 "shmSize": 0
22 },
23 "image": {
24 "imageType": 0,
25 "imageUrl": "registry.baidubce.com/inference/aibox-ubuntu:v2.0-22.04",
26 "username": "",
27 "password": ""
28 },
29 "access": {
30 "sshEnable": true,
31 "sshRSAPubKey": "xxx",
32 "portInfo": [
33 {
34 "accessPort": 3278,
35 "name": "dev_ssh",
36 "port": 22
37 }
38 ],
39 "blbId": "lb-3f002c91"
40 },
41 "scheduleConf": {
42 "priority": "high",
43 "cpuNodeAffinity": false
44 },
45 "envs": {
46 "ENV1": "ENV1",
47 "ENV2": "ENV2"
48 },
49 "workspaceDir": "/root/workspace",
50 "startCmd": "echo 1",
51 "volumnConfs": [
52 {
53 "volumnType": "cds",
54 "cds": {
55 "capacity": 100
56 },
57 "mountPath": "/.rootfs",
58 "readOnly": true
59 }
60 ]
61 },
62 "visibleScope": {
63 "type": 1
64 },
65 "notify": {
66 "isOpen": false,
67 "notifyRuleId": "notify-3oilatp1b"
68 },
69 "isPublicMgmt": true,
70 "creator": "dingjiachen",
71 "creatorId": "1ac3b20c495f47f59ad18d0615805ac7"
72}
返回示例
Plain Text
1{
2 "devInstanceId": "dv-f458ede5",
3 "requestId": "daa778cc-3625-gray-cce0-bcecanarytag"
4}
