创建开发机
更新时间:2025-06-06
接口描述
创建新的开发机
请求结构
Plain Text
1POST ?action=CreateDevInstance
2HTTP/1.1
3Host:aihc.bj.baidubce.com
4version: v2
5Authorization:authorization string
6
7{
8 "name": name,
9 "conf": {
10 "resourcePool": {
11 "resourcePoolType": resourcePoolType,
12 "resourcePoolId": resourcePoolId,
13 "resourcePoolName": resourcePoolName,
14 "queueName": queueName
15 },
16 "resources": {
17 "acceleratorType": acceleratorType,
18 "acceleratorCount": acceleratorCount,
19 "cpus": cpus,
20 "memory": memory,
21 "shmSize":shmSize,
22 },
23 "image": {
24 "imageType": imageType,
25 "imageUrl": imageUrl,
26 "username": username,
27 "password": password
28 },
29 "access": {
30 "blbId": blbId,
31 "sshEnable": sshEnable,
32 "sshRSAPubKey": sshRSAPubKey,
33 "portInfo": [{
34 "name": name,
35 "port": port,
36 "accessPort": accessPort
37 }]
38 },
39 "scheduleConf": {
40 "cpuNodeAffinity": cpuNodeAffinity,
41 "priority": priority
42 },
43 "volumnConfs": [
44 {
45 "volumnType": volumnType,
46 "pfs": {
47 "instanceId": instanceId,
48 "sourcePath": sourcePath
49 },
50 "dataset": {
51 "datasetId": datasetId,
52 "versionId": versionId,
53 "source": source,
54 "storageType": storageType,
55 "pfs": {
56 "clientID": clientID,
57 "clusterPort": clusterPort,
58 "pfsParentDir": pfsParentDir,
59 "pfsPath": pfsPath,
60 "instanceType": instanceType,
61 "region": region,
62 "instanceId": instanceId,
63 "clusterIP": clusterIP,
64 "mountTargetId": mountTargetId,
65 "hostMountPath": hostMountPath,
66 "srcPath": srcPath
67 },
68 "mountPath": mountPath
69 },
70 "cfs": {
71 "instanceId": instanceId,
72 "sourcePath": sourcePath,
73 "mountPoint": mountPoint
74 },
75 "cds": {
76 "capacity": 100
77 },
78 "bos": {
79 "sourcePath": sourcePath
80 }
81 "mountPath": mountPath,
82 "readOnly": readOnly
83 }
84 ]
85 },
86 "visibleScope": {
87 "type": type
88 },
89 "notify": {
90 "notifyRuleId": notifyRuleId,
91 "isOpen": isOpen
92 },
93 "isPublicMgmt": isPublicMgmt,
94 "creator": creator,
95 "creatorId": creatorId
96}
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 参数类型 | 是否必须 | 参数位置 | 参数说明 | |
---|---|---|---|---|---|
name | string | 是 | Body参数 | 开发机名称,支持大小写字母、数字、中文以及-_ /.特殊字符,且必须以字母开头,字母或数字结尾,长度不超过 256 | |
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=CreateDevInstance
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 "conf": {
9 "resourcePool": {
10 "resourcePoolType": "",
11 "resourcePoolId": "cce-i8zab7dh",
12 "queueName": "default",
13 "resourcePoolName": "bjtest-regress-no-delete-songmingming01"
14 },
15 "resources": {
16 "cpus": 1,
17 "acceleratorCount": 0,
18 "acceleratorType": "",
19 "memory": 2,
20 "shmSize": 0
21 },
22 "image": {
23 "imageType": 0,
24 "imageUrl": "registry.baidubce.com/inference/aibox-ubuntu:v2.0-22.04",
25 "username": "",
26 "password": ""
27 },
28 "access": {
29 "sshEnable": true,
30 "sshRSAPubKey": "xxx",
31 "portInfo": [
32 {
33 "accessPort": 3278,
34 "name": "dev_ssh",
35 "port": 22
36 }
37 ],
38 "blbId": "lb-3f002c91"
39 },
40 "scheduleConf": {
41 "priority": "high",
42 "cpuNodeAffinity": false
43 },
44 "volumnConfs": [
45 {
46 "volumnType": "cds",
47 "cds": {
48 "capacity": 100
49 },
50 "mountPath": "/.rootfs",
51 "readOnly": true
52 }
53 ]
54 },
55 "visibleScope": {
56 "type": 1
57 },
58 "notify": {
59 "isOpen": false,
60 "notifyRuleId": "notify-3oilatp1b"
61 },
62 "isPublicMgmt": true,
63 "creator": "dingjiachen",
64 "creatorId": "1ac3b20c495f47f59ad18d0615805ac7"
65}
返回示例
Plain Text
1{
2 "devInstanceId": "dv-f458ede5",
3 "requestId": "daa778cc-3625-gray-cce0-bcecanarytag"
4}