1. 云服务器详细信息
1.1. 描述
查询云服务器详细信息。
1.2. 请求地址
请求地址的格式如下:
https://<区域服务地址>/v1/vm/detail
1.3. 请求参数
参数名称 | 类型 | 是否必须 | 描述 |
---|---|---|---|
projectId | String | 是 | 所属项目ID |
id | String | 是 | 主机ID |
1.4. 请求示例
1.4.1. 请求地址
POST https://cn-east-1.api.yovole.com/v1/vm/detail HTTP/1.1
x-ycs-timestamp: 2019-06-19T14:26:26Z
x-ycs-requestid: 2a49cfa2-925b-11e9-bb3a-6c96cfdcd6b9
x-ycs-security-authorization: Authorization: YCS1-HMAC-SHA1 Credential=08e206fb-7b41-45b7-8076-8d43e8aeea89,SignedHeaders=content-type;x-ycs-requestid;x-ycs-timestamp,Signature=2RFjU7C9gICCrQfpAIfAJHqRRlQ=
1.4.2. 接口请求参数
{
"projectId":"8a83a0966a681da5016a874df50b10ce",
"id":"f75d31d7-f624-44ab-b334-814f23a624d4"
}
1.5. 返回结果
1.5.1. 返回正确结果示例
{
"requestId":"feb7a2cc-b31e-4d2f-9b74-407649b9b1d1",
"success":true,
"code":200,
"model":{
"id":"f6509405-b150-44e6-b903-a7f6cf9bc8c4",
"name":"API TEST",
"sn":"VM-21A-8KP5T",
"regionSn":"CN-EAST-1",
"azSn":"CN-EAST-1-A",
"created":"2019-05-15 15:11:07",
"updated":"2019-05-15 15:11:21",
"status":"ACTIVE",
"azName":"可用区A",
"flavorId":"ecs.c1.small",
"flavorName":"ecs.c1.small",
"cpu":1,
"ram":1,
"gpu":0,
"billingType":"POST_PAID",
"vmProductName":"通用 I型",
"attachVolumeCount":0,
"osTypeName":"普通系统盘",
"sysDiskSize":20,
"sshkeys":[
{
"id":"f8748f25-861d-46f6-a09d-6c39f3d419f0",
"name":"create-test",
"sn":"SSH-8KP29"
},
{
"id":"8f16f25d-b1b6-49d4-ae2a-d320cb9cd3d8",
"name":"approve_test",
"sn":"SSH-8KP2U"
}
],
"portInfos":[
{
"subnetId":"14f78e18-2eb7-4212-9fe0-5322fba5cfe5",
"subnetName":"TEST3",
"subnetSn":"SN-21A-8KP62",
"subnetIp":"172.20.0.7",
"subnetCidr":"172.20.0.0/25",
"masterPortFlag":false,
"eipId":"4ca7c836-4a86-469b-b793-9a1656d64436",
"eipSn":"EIP-218KP4A",
"eipName":"LP_TEST",
"eipAddress":"10.3.28.83",
"eipTypeName":"BGP",
"securityGroups":[
{
"id":"eb667f7f-a0d4-4cc5-908a-e4175c683030",
"name":"默认安全组",
"sn":"SG-218KP3D"
}
]
},
{
"subnetId":"98e6bf98-3283-4bed-80c8-2132a510aebb",
"subnetName":"API Create subnet",
"subnetSn":"SN-21A-8KP4V",
"subnetIp":"172.20.4.8",
"subnetCidr":"172.20.4.0/22",
"masterPortFlag":true,
"securityGroups":[
{
"id":"eb667f7f-a0d4-4cc5-908a-e4175c683030",
"name":"默认安全组",
"sn":"SG-218KP3D"
}
]
}
],
"vpcVO":{
"id":"a611a074-7b60-4a8a-8d43-bff013e0eb64",
"sn":"VPC-218KP44",
"name":"API Create vpc",
"cidr":"172.20.0.0/16",
"natId":"6e5dec8a-8658-4d40-bea4-25d857f3d6d3",
"natSn":"NGW-218KP2D",
"natName":"API按需创建Nat",
"natStatus":"ACTIVE"
}
}
}
1.5.2. 返回错误结果示例
{
"requestId": "2a49cfa2-925b-11e9-bb3a-6c96cfdcd6b9",
"success": false,
"code": 400,
"message": "Required attribute 'projectId' not specified",
"errorCode": "Invalid argument"
}
1.6. 错误码
可以通过错误返回结果中的code、errorCode和message字段了解错误分类和具体的错误原因。
该接口没有特殊错误码,错误码信息和简单的错误分析方法可以参考公共错误码。