查询实例列表 - CheckRomaInstanceListV2
功能介绍
获取符合条件的虚拟化实例列表。
授权信息
账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限,具体权限要求请参见权限和授权项。
URI
GET /v2/{project_id}/instances
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
project_id |
是 |
String |
项目ID,获取方式请参见API参考的“附录 > 获取项目ID”章节。 |
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
status |
否 |
String |
实例状态。
|
|
offset |
否 |
Integer |
偏移量,大于等于0。 |
|
limit |
否 |
Integer |
每页显示的条目数量。 |
请求参数
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
X-Auth-Token |
是 |
String |
用户Token。通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 |
响应参数
状态码:200
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
total |
Integer |
列表总数。 |
|
size |
Integer |
本页数量。 |
|
instances |
Array of instances objects |
实例列表。 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
id |
String |
实例ID。 |
|
name |
String |
实例名称。 |
|
description |
String |
实例描述。 |
|
flavor_id |
String |
实例规格ID。 |
|
flavor_type |
String |
实例规格类型。 - 基础版:basic - 专业版:professional - 企业版:enterprise - 铂金版:platinum |
|
cpu_arch |
String |
CPU架构类型,取值如下:
|
|
vpc_id |
String |
实例指定虚拟私有云ID。 |
|
subnet_id |
String |
实例指定虚拟私有云子网ID。 |
|
security_group_id |
String |
实例指定安全组ID。 |
|
publicip_enable |
Boolean |
是否开启公网访问,开启时publicip_id字段必填。 |
|
publicip_id |
String |
实例绑定的弹性公网地址ID。 |
|
publicip_address |
String |
实例绑定的弹性公网地址。 |
|
status |
String |
实例运行状态。 |
|
error_code |
String |
错误码。 |
|
error_msg |
String |
错误消息。 |
|
charge_type |
String |
实例计费模式。 |
|
project_id |
String |
租户项目ID。 |
|
create_time |
String |
创建时间。 |
|
update_time |
String |
更新时间。 |
|
maintain_begin |
String |
运维开始时间。 |
|
maintain_end |
String |
运维结束时间。 |
|
available_zone_ids |
Array of strings |
创实例使用的可用区列表。 |
|
enterprise_project_id |
String |
实例所属企业项目ID。 |
|
created_user |
created_user object |
创建用户信息。 |
|
last_updated_user |
last_updated_user object |
最后更新用户信息。 |
状态码:400
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
error_code |
String |
错误码。 |
|
error_msg |
String |
错误消息。 |
|
error_details |
String |
具体错误消息。 |
|
request_id |
String |
请求处理ID。 |
状态码:401
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
error_code |
String |
错误码。 |
|
error_msg |
String |
错误消息。 |
|
error_details |
String |
具体错误消息。 |
|
request_id |
String |
请求处理ID。 |
状态码:403
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
error_code |
String |
错误码。 |
|
error_msg |
String |
错误消息。 |
|
error_details |
String |
具体错误消息。 |
|
request_id |
String |
请求处理ID。 |
状态码:500
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
error_code |
String |
错误码。 |
|
error_msg |
String |
错误消息。 |
|
error_details |
String |
具体错误消息。 |
|
request_id |
String |
请求处理ID。 |
请求示例
无
响应示例
状态码:200
OK
{
"total" : 1,
"size" : 1,
"instances" : [ {
"id" : "e34610ca-0a37-4f04-8856-4101b08cc5e2",
"name" : "roma-test",
"description" : " ",
"flavor_id" : "00400-30101-0--0",
"flavor_type" : "basic",
"cpu_arch" : "x86_64",
"vpc_id" : "000c3783-a9c0-4ee4-ac44-93bfdfbf3340",
"subnet_id" : "8e2ee0d5-0f1d-4067-965f-caf00dd65529",
"security_group_id" : "56275464-d5f1-417d-a73b-92ee479e91e2",
"publicip_enable" : true,
"publicip_id" : "55a6ef1b-498d-42fb-bbc7-d01ba1652bfc",
"publicip_address" : "139.9.140.164",
"status" : "RUNNING",
"error_code" : "string",
"error_msg" : "string",
"charge_type" : "prePaid",
"project_id" : "106506b9a92342df9a5025fc12351cfc",
"create_time" : "2019-12-06T06:49:04Z",
"update_time" : "2019-12-06T06:49:04Z",
"maintain_begin" : "22:00:00",
"maintain_end" : "02:00:00",
"available_zone_ids" : [ "9f1c5806706d4c1fb0eb72f0a9b18c77" ],
"enterprise_project_id" : "0",
"created_user" : {
"user_id" : "string",
"user_name" : "string"
},
"last_updated_user" : {
"user_id" : "string",
"user_name" : "string"
}
} ]
}
状态码:400
Bad Request
{
"error_code" : "ROMA.00013000",
"error_msg" : "Invalid parameter value,parameterName:name. Please refer to the support documentation",
"error_details" : "some error details here",
"request_id" : "13760c1fe8655e61209b75665e9bef43"
}
状态码:401
Unauthorized
{
"error_code" : "ROMA.00012000",
"error_msg" : "Incorrect token or token resolution failed",
"error_details" : "some error details here",
"request_id" : "13760c1fe8655e61209b75665e9bef43"
}
状态码:403
Forbidden
{
"error_code" : "ROMA.00012000",
"error_msg" : "No permissions to request this method",
"error_details" : "some error details here",
"request_id" : "13760c1fe8655e61209b75665e9bef43"
}
状态码:500
Internal Server Error
{
"error_code" : "ROMA.00011000",
"error_msg" : "System error",
"error_details" : "some error details here",
"request_id" : "13760c1fe8655e61209b75665e9bef43"
}
状态码
|
状态码 |
描述 |
|---|---|
|
200 |
OK |
|
400 |
Bad Request |
|
401 |
Unauthorized |
|
403 |
Forbidden |
|
500 |
Internal Server Error |
错误码
请参见错误码。