
# 查询实例列表 - CheckRomaInstanceListV2
#### 功能介绍
获取符合条件的虚拟化实例列表。
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/ROMA/doc?api=CheckRomaInstanceListV2)中调试该接口，支持自动认证鉴权。API Explorer可以自动生成SDK代码示例，并提供SDK代码示例调试功能。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-roma/roma_06_0018.html)。
#### URI
GET /v2/{project_id}/instances
表1路径参数 
| 参数         | 是否必选 | 参数类型   | 描述                                  |
|:---|:---|:---|:---|
| project_id | 是    | String | 项目ID，获取方式请参见API参考的"附录 \> 获取项目ID"章节。 |
   
表2Query参数 
| 参数     | 是否必选 | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
|:---|:---|:---|:---|
| status | 否    | String  | 实例状态。 - CREATING : 实例创建中。   - RUNNING : 实例运行中。   - DELETING : 实例删除中。   - DELETED : 实例已删除。   - ERROR : 实例运行异常。   - CREATE_FAILED : 实例创建异常。   - DELETE_FAILED : 实例删除异常。   - SOFT_DELETED : 实例软删除。    |
| offset | 否    | Integer | 偏移量，大于等于0。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| limit  | 否    | Integer | 每页显示的条目数量。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
   
#### 请求参数
表3请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                       |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | 用户Token。通过调用IAM服务获取用户Token接口获取（响应消息头中X-Subject-Token的值）。 |
   
#### 响应参数
**状态码：200**
表4响应Body参数 
| 参数        | 参数类型                                                                       | 描述    |
|:---|:---|:---|
| total     | Integer                                                                    | 列表总数。 |
| size      | Integer                                                                    | 本页数量。 |
| instances | Array of [instances] objects | 实例列表。 |
   
 表5instances 
| 参数                    | 参数类型                                                                             | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
|:---|:---|:---|
| id                    | String                                                                           | 实例ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| name                  | String                                                                           | 实例名称。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| description           | String                                                                           | 实例描述。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| flavor_id             | String                                                                           | 实例规格ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| flavor_type           | String                                                                           | 实例规格类型。 - 基础版：basic - 专业版：professional - 企业版：enterprise - 铂金版：platinum                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| cpu_arch              | String                                                                           | CPU架构类型，取值如下： - x86_64: x86架构。   - aarch64: arm架构。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| 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                                                                           | 实例运行状态。 - CREATING：实例创建中   - CREATE_FAILED：实例创建失败   - ERROR：实例运行错误   - RUNNING：实例运行中   - FREEZING：实例冻结中   - FROZEN：实例已冻结   - DELETING：实例删除中   - DELETE_FAILED：实例删除失败    |
| error_code            | String                                                                           | 错误码。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| error_msg             | String                                                                           | 错误消息。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| charge_type           | String                                                                           | 实例计费模式。 - prePaid：预付费模式，也称作包周期计费模式。   - postPaid：后付费模式，也称作按需计费模式。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| 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 | 最后更新用户信息。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
   
 表6created_user 
| 参数        | 参数类型   | 描述              |
|:---|:---|:---|
| user_id   | String | 创建应用的用户ID。      |
| user_name | String | 创建应用的用户名称，可能为空。 |
   
 表7last_updated_user 
| 参数        | 参数类型   | 描述              |
|:---|:---|:---|
| user_id   | String | 最后修改者的用户ID。     |
| user_name | String | 最后修改者的用户名，可能为空。 |
   
**状态码：400**
表8响应Body参数 
| 参数            | 参数类型   | 描述      |
|:---|:---|:---|
| error_code    | String | 错误码。    |
| error_msg     | String | 错误消息。   |
| error_details | String | 具体错误消息。 |
| request_id    | String | 请求处理ID。 |
   
**状态码：401**
表9响应Body参数 
| 参数            | 参数类型   | 描述      |
|:---|:---|:---|
| error_code    | String | 错误码。    |
| error_msg     | String | 错误消息。   |
| error_details | String | 具体错误消息。 |
| request_id    | String | 请求处理ID。 |
   
**状态码：403**
表10响应Body参数 
| 参数            | 参数类型   | 描述      |
|:---|:---|:---|
| error_code    | String | 错误码。    |
| error_msg     | String | 错误消息。   |
| error_details | String | 具体错误消息。 |
| request_id    | String | 请求处理ID。 |
   
**状态码：500**
表11响应Body参数 
| 参数            | 参数类型   | 描述      |
|:---|:---|:---|
| 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 |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-roma/ErrorCode.html)。
