变更配置
更新时间:2025-06-06
接口描述
变更开发机配置
请求结构
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 "image": {
32 "imageType": imageType,
33 "imageUrl": imageUrl,
34 "username": username,
35 "password": password
36 },
37 "volumnConfs": [
38 {
39 "volumnType": volumnType,
40 "pfs": {
41 "instanceId": instanceId,
42 "sourcePath": sourcePath
43 },
44 "dataset": {
45 "datasetId": datasetId,
46 "versionId": versionId,
47 "source": source,
48 "storageType": storageType,
49 "pfs": {
50 "clientID": clientID,
51 "clusterPort": clusterPort,
52 "pfsParentDir": pfsParentDir,
53 "pfsPath": pfsPath,
54 "instanceType": instanceType,
55 "region": region,
56 "instanceId": instanceId,
57 "clusterIP": clusterIP,
58 "mountTargetId": mountTargetId,
59 "hostMountPath": hostMountPath,
60 "srcPath": srcPath
61 },
62 "mountPath": mountPath
63 },
64 "cfs": {
65 "instanceId": instanceId,
66 "sourcePath": sourcePath,
67 "mountPoint": mountPoint
68 },
69 "cds": {
70 "capacity": capacity
71 },
72 "bos": {
73 "sourcePath": sourcePath
74 }
75 "mountPath": mountPath,
76 "readOnly": readOnly
77 }
78 ]
79 },
80 "visibleScope": {
81 "type": type
82 },
83 "notify": {
84 "notifyRuleId": notifyRuleId,
85 "isOpen": isOpen
86 },
87 "isPublicMgmt": isPublicMgmt,
88 "creator": creator,
89 "creatorId": creatorId
90}
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 参数类型 | 是否必须 | 参数位置 | 参数说明 |
---|---|---|---|---|
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 "volumnConfs": [
46 {
47 "volumnType": "cds",
48 "cds": {
49 "capacity": 100
50 },
51 "mountPath": "/.rootfs",
52 "readOnly": true
53 }
54 ]
55 },
56 "visibleScope": {
57 "type": 1
58 },
59 "notify": {
60 "isOpen": false,
61 "notifyRuleId": "notify-3oilatp1b"
62 },
63 "isPublicMgmt": true,
64 "creator": "dingjiachen",
65 "creatorId": "1ac3b20c495f47f59ad18d0615805ac7"
66}
返回示例
Plain Text
1{
2 "devInstanceId": "dv-f458ede5",
3 "requestId": "daa778cc-3625-gray-cce0-bcecanarytag"
4}