更新时间:2023-11-29 GMT+08:00
分享

查询实例列表

功能介绍

获取符合条件的服务实例列表。

调试

您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。

URI

GET /v2/{project_id}/instances

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目ID,获取方式请参见API参考的“附录 > 获取项目ID”章节。

表2 Query参数

参数

是否必选

参数类型

描述

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

实例列表。

表5 instances

参数

参数类型

描述

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

实例运行状态。

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。

状态码: 400

表6 响应Body参数

参数

参数类型

描述

error_code

String

错误码。

error_msg

String

错误消息。

error_details

String

具体错误消息。

request_id

String

请求处理ID。

状态码: 401

表7 响应Body参数

参数

参数类型

描述

error_code

String

错误码。

error_msg

String

错误消息。

error_details

String

具体错误消息。

request_id

String

请求处理ID。

状态码: 403

表8 响应Body参数

参数

参数类型

描述

error_code

String

错误码。

error_msg

String

错误消息。

error_details

String

具体错误消息。

request_id

String

请求处理ID。

状态码: 500

表9 响应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"
  } ]
}

状态码: 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

错误码

请参见错误码

分享:

    相关文档

    相关产品