Help Center/ API Gateway/ API Reference (Paris Region)/ Shared Gateway APIs/ VPC Channel Management/ Querying the Backend Instance List (Cloud Server List)
Updated on 2022-02-21 GMT+08:00

Querying the Backend Instance List (Cloud Server List)

Function

This API is used to query the cloud servers of a specified VPC channel.

URI

The following table lists the HTTP/HTTPS request method and URI of the API.

Table 1 HTTP/HTTPS request method and URI

Request Method

URI

GET

/v1.0/apigw/vpc-channels/{id}/members[?page_size, page_no, name]

  • A combination of different query conditions can be added at the end of the URI by using question marks (?) and ampersands (&).
  • Query conditions include: name, page_size, and page_no.

The following table lists the parameters in the URI.

Table 2 Parameter description

Parameter

Mandatory

Type

Description

id

Yes

String

VPC channel ID

name

No

String

Cloud server name

page_size

No

Integer

Number of cloud servers displayed on each page. The default value is 20.

page_no

No

Integer

Page number. The default value is 1.

Request

N/A

Response

Table 3 Parameter description

Parameter

Type

Description

total

Integer

Total number of cloud servers that match the query conditions

size

Integer

Length of the returned cloud server list

vpc_instances

Dictionary

Cloud server list

Table 4 Backend instance details

Parameter

Type

Description

id

String

Backend instance object ID

vpc_id

String

VPC channel ID

status

Integer

Status of the backend instance object

instance_name

String

Cloud server name

instance_id

String

Cloud server ID

host

String

Cloud server IP address

weight

Integer

Cloud server weight

The larger the weight is, the more requests are forwarded to the cloud server.

Range: 1–100

create_time

Timestamp

Time when the cloud server is added to the VPC channel

Example response:

{
  "total": 2,
  "size": 2,
  "vpc_instances": [
    {
      "instance_id": "instance02",
      "instance_name": "instance_name02",
      "host": "127.0.0.2",
      "weight": 10,
      "id": "680e42fab429447ca23b9623107523d9",
      "vpc_id": "c3e6a7d85d9e47be89dfcc3cd37405d7",
      "status": 1,
      "create_time": "2018-07-27T12:42:32Z"
    },
    {
      "instance_id": "instance01",
      "instance_name": "instance_name01",
      "host": "127.0.0.1",
      "weight": 10,
      "id": "c3bc73605a8b400793363c87574fbad7",
      "vpc_id": "c3e6a7d85d9e47be89dfcc3cd37405d7",
      "status": 1,
      "create_time": "2018-07-27T12:30:48Z"
    }
  ]
}

Status Codes

Table 5 Status codes

Status Code

Description

200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Server Internal Error