最新活动 七周年庆典

产品

硅云帮助文档中心

搜索文档

热门搜索词:

创建实例

更新时间:2020-07-14 14:32  版本:v1.2
分享到:
我要反馈 
收藏 我的收藏

简要描述:


    创建实例,此接口会自动从用户余额中扣除创建实例所需的费用


请求url:


/ncs-server/api/v1/host/create


请求方式:


POST


请求参数:


字段
类型最大长度参数位置默认必填
描述
areaMark
string32RequestBody
地区标识
hostProductIdstring32RequestBody
服务器规格id
hostPassstring
RequestBody
需要加密,加密规则参考通用说明,密码规则:10到30 个字符,必须包含(大写字母、小写字母、数字、特殊字符),其中特殊字符为 ()`~!@#$%^&*_-+=|{}[]:;’<>,.? 中的特殊符号
imageIdstring64RequestBody
镜像id
bootDiskdisk
RequestBody
系统盘信息
dataDiskListdisk数组
RequestBody选填数据盘信息
bandwidthProductIdstring32RequestBody选填带宽id,不购买带宽没有公网ip
bandwidthSizeint10RequestBody选填当bandwidthProductId不为空时,必填
month
int10RequestBody
购买月份数,一年传12
securityGroupId
string64RequestBody选填可以填官方安全组和自己的安全组 官方安全组有  guiyun-system-template-open-all   开放所有端口 和  guiyun-system-template-open-commonly-used  放开常用TCP端口和ICMP协议
networkNamestring32RequestBody选填vpc,默认vpc-default,基础网络传basic
idempotentstring64RequestBody选填幂等Id,防止创建成功但超时的情况,当传递相同的idempotent时,无论调用多少次,只会创建成功一次



disk 结构:


字段类型描述
productIdstring磁盘规格id
diskSizeint磁盘容量


请求示例:


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"
    }
}


实例数据结构:


字段类型
描述
idstring实例id
userAccount
string用户名
projectId
string实例所属项目id  0为默认项目
projectNamestring实例项目名
systemDiskInfostringjson字符串,系统盘信息
status
string实例状态
remoteHostStatusstring实例运行状态
buildStatusint实例创建状态
bandwidthStatus
string带宽设置状态
securityGroupStatusstring安全组设置状态
endTimelong到期时间时间戳,精确到毫秒
createTimelong创建时间时间戳,精确到毫秒









您对该文档有什么建议?

您对该文档的评分:

本文导航

简要描述:

请求url:

请求方式:

请求参数:

请求示例:

返回示例:

搜索文档