硅云帮助文档中心
搜索文档
热门搜索词:
产品简介
产品定价
入门指南
经典案例
快照
常见问题
知识拓展
名词解释
API参考
创建实例,此接口会自动从用户余额中扣除创建实例所需的费用
/ncs-server/api/v1/host/create
POST
| 字段 | 类型 | 最大长度 | 参数位置 | 默认必填 | 描述 |
| areaMark | string | 32 | RequestBody | 地区标识 | |
| hostProductId | string | 32 | RequestBody | 服务器规格id | |
| hostPass | string | RequestBody | 需要加密,加密规则参考通用说明,密码规则:10到30 个字符,必须包含(大写字母、小写字母、数字、特殊字符),其中特殊字符为 ()`~!@#$%^&*_-+=|{}[]:;’<>,.? 中的特殊符号 | ||
| imageId | string | 64 | RequestBody | 镜像id | |
| bootDisk | disk | RequestBody | 系统盘信息 | ||
| dataDiskList | disk数组 | RequestBody | 选填 | 数据盘信息 | |
| bandwidthProductId | string | 32 | RequestBody | 选填 | 带宽id,不购买带宽没有公网ip |
| bandwidthSize | int | 10 | RequestBody | 选填 | 当bandwidthProductId不为空时,必填 |
| month | int | 10 | RequestBody | 购买月份数,一年传12 | |
| securityGroupId | string | 64 | RequestBody | 选填 | 可以填官方安全组和自己的安全组 官方安全组有 guiyun-system-template-open-all 开放所有端口 和 guiyun-system-template-open-commonly-used 放开常用TCP端口和ICMP协议 |
| networkName | string | 32 | RequestBody | 选填 | vpc,默认vpc-default,基础网络传basic |
| idempotent | string | 64 | RequestBody | 选填 | 幂等Id,防止创建成功但超时的情况,当传递相同的idempotent时,无论调用多少次,只会创建成功一次 |
disk 结构:
| 字段 | 类型 | 描述 |
| productId | string | 磁盘规格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返回服务器实例,实际以真实返回结果为准
{
"status": 2000,
"message": "success",
"data": {
"userAccount": "z8z87878",
"productId": "cvm.g1.c1m1.large",
"projectId": "0",
"projectName": "默认",
"latestOrderId": "1712303052106235907",
"cpuNum": 1,
"memSize": 1024,
"systemDiskInfo": "{\"productId\":\"standard_cloud_disk\",\"productName\":\"高效云盘\",\"diskSize\":20,\"id\":\"disk-3hiukjr2bs222\"}",
"areaMark": "test",
"areaName": "测试环境",
"hostType": "g1",
"hostTypeName": "通用型",
"bandwidthStatus": "OPENING",
"bandwidthProductId": "default",
"bandwidthTypeName": "默认",
"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"
}
}实例数据结构:
| 字段 | 类型 | 描述 |
| id | string | 实例id |
| userAccount | string | 用户名 |
| projectId | string | 实例所属项目id 0为默认项目 |
| projectName | string | 实例项目名 |
| systemDiskInfo | string | json字符串,系统盘信息 |
| status | string | 实例状态 |
| remoteHostStatus | string | 实例运行状态 |
| buildStatus | int | 实例创建状态 |
| bandwidthStatus | string | 带宽设置状态 |
| securityGroupStatus | string | 安全组设置状态 |
| endTime | long | 到期时间时间戳,精确到毫秒 |
| createTime | long | 创建时间时间戳,精确到毫秒 |
您对该文档有什么建议?
本文导航