硅云幫助文檔中心
搜索文檔
熱門搜索詞:
產(chǎn)品簡介
產(chǎn)品定價
入門指南
經(jīng)典案例
快照
常見問題
知識拓展
名詞解釋
API參考
產(chǎn)品規(guī)格相關(guān)接口
服務(wù)器實例相關(guān)接口
安全組相關(guān)接口
磁盤相關(guān)接口
創(chuàng)建實例
創(chuàng)建實例,此接口會自動從用戶余額中扣除創(chuàng)建實例所需的費用
/ncs-server/api/v1/host/create
POST
字段 | 類型 | 最大長度 | 參數(shù)位置 | 默認(rèn)必填 | 描述 |
areaMark | string | 32 | RequestBody | 地區(qū)標(biāo)識 | |
hostProductId | string | 32 | RequestBody | 服務(wù)器規(guī)格id | |
hostPass | string | RequestBody | 需要加密,加密規(guī)則參考通用說明,密碼規(guī)則:10到30 個字符,必須包含(大寫字母、小寫字母、數(shù)字、特殊字符),其中特殊字符為 ()`~!@#$%^&*_-+=|{}[]:;’<>,.? 中的特殊符號 | ||
imageId | string | 64 | RequestBody | 鏡像id | |
bootDisk | disk | RequestBody | 系統(tǒng)盤信息 | ||
dataDiskList | disk數(shù)組 | RequestBody | 選填 | 數(shù)據(jù)盤信息 | |
bandwidthProductId | string | 32 | RequestBody | 選填 | 帶寬id,不購買帶寬沒有公網(wǎng)ip |
bandwidthSize | int | 10 | RequestBody | 選填 | 當(dāng)bandwidthProductId不為空時,必填 |
month | int | 10 | RequestBody | 購買月份數(shù),一年傳12 | |
securityGroupId | string | 64 | RequestBody | 選填 | 可以填官方安全組和自己的安全組 官方安全組有 guiyun-system-template-open-all 開放所有端口 和 guiyun-system-template-open-commonly-used 放開常用TCP端口和ICMP協(xié)議 |
networkName | string | 32 | RequestBody | 選填 | vpc,默認(rèn)vpc-default,基礎(chǔ)網(wǎng)絡(luò)傳basic |
idempotent | string | 64 | RequestBody | 選填 | 冪等Id,防止創(chuàng)建成功但超時的情況,當(dāng)傳遞相同的idempotent時,無論調(diào)用多少次,只會創(chuàng)建成功一次 |
disk 結(jié)構(gòu):
字段 | 類型 | 描述 |
productId | string | 磁盤規(guī)格id |
diskSize | int | 磁盤容量 |
POST /ncs-server/api/v1/host/create HTTP/1.1 Content-Type: application/json request_id: 2942183558593ffc9d75fb8e16793ff api_key: 1706006863049654272 signature: 6c3d41ac0e7439898e750c337413dbe7660ba95bcfc1dc73f3eca8a4b3328735 Content-Type: application/json { "areaMark": "test", "hostProductId": "cvm.g1.c1m1.large", "hostPass": "MfurT2tADq3kt5h8fUAdUQ==", "bootDisk": { "productId": "standard_cloud_disk", "diskSize": 20 }, "dataDiskList": [ { "productId": "standard_cloud_disk", "diskSize": 20 } ], "bandwidthProductId": "default", "bandwidthSize": 1, "imageId": "CentOS-6-x86_64-6.8", "month": 1, "securityGroupId": "guiyun-system-template-open-all", "idempotent": "123456" }
data返回服務(wù)器實例,實際以真實返回結(jié)果為準(zhǔn)
{ "status": 2000, "message": "success", "data": { "userAccount": "z8z87878", "productId": "cvm.g1.c1m1.large", "projectId": "0", "projectName": "默認(rèn)", "latestOrderId": "1712303052106235907", "cpuNum": 1, "memSize": 1024, "systemDiskInfo": "{\"productId\":\"standard_cloud_disk\",\"productName\":\"高效云盤\",\"diskSize\":20,\"id\":\"disk-3hiukjr2bs222\"}", "areaMark": "test", "areaName": "測試環(huán)境", "hostType": "g1", "hostTypeName": "通用型", "bandwidthStatus": "OPENING", "bandwidthProductId": "default", "bandwidthTypeName": "默認(rèn)", "bandwidth": 1, "imageId": "CentOS-6-x86_64-6.8", "imageName": "CentOS 6.8 64位", "imageType": "public", "securityGroupStatus": "setting", "securityGroupInfo": "guiyun-system-template-open-all", "beginTime": 1594706487313, "endTime": 1597384887313, "status": "OPENING", "remoteHostStatus": "BUILD", "buildStatus": "will_build_volume", "bindDiskCount": 2, "hasBoot": true, "supportNoReasonRefund": true, "refundStatus": "NONE", "configuration": "", "tempPass": "lQsNJKmqAOYFmGhoquNv1bAjo3lzqC3WMTIzNDU2X3FXMQ==lXgTjStr", "createTime": 1594706487316, "updateTime": 1594706487316, "id": "cvm-3hiukjr2bs225" } }
實例數(shù)據(jù)結(jié)構(gòu):
字段 | 類型 | 描述 |
id | string | 實例id |
userAccount | string | 用戶名 |
projectId | string | 實例所屬項目id 0為默認(rèn)項目 |
projectName | string | 實例項目名 |
systemDiskInfo | string | json字符串,系統(tǒng)盤信息 |
status | string | 實例狀態(tài) |
remoteHostStatus | string | 實例運行狀態(tài) |
buildStatus | int | 實例創(chuàng)建狀態(tài) |
bandwidthStatus | string | 帶寬設(shè)置狀態(tài) |
securityGroupStatus | string | 安全組設(shè)置狀態(tài) |
endTime | long | 到期時間時間戳,精確到毫秒 |
createTime | long | 創(chuàng)建時間時間戳,精確到毫秒 |
您對該文檔有什么建議?
本文導(dǎo)航