Querying VPC Channels

Function

This API is used to query the VPC channels under a gateway.

Calling Method

For details, see Calling APIs.

URI

GET /v2/{project_id}/apigw/instances/{instance_id}/vpc-channels

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain it, see Obtaining a Project ID.

instance_id

Yes

String

Gateway ID, which can be obtained from the gateway information on the APIG console.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

offset

No

Long

Offset from which the query starts. If the value is less than 0, it is automatically converted to 0.

Default: 0

limit

No

Integer

Number of items displayed on each page. A value less than or equal to 0 will be automatically converted to 20, and a value greater than 500 will be automatically converted to 500.

Minimum: 1

Maximum: 500

Default: 20

id

No

String

VPC channel ID.

name

No

String

VPC channel name.

dict_code

No

String

Dictionary code of the VPC channel.

The value can contain letters, digits, hyphens (-), underscores (_), and periods (.).

This parameter is currently not supported.

Minimum: 3

Maximum: 64

precise_search

No

String

Parameter name for exact matching. Separate multiple parameter names with commas (,).

Currently, name and member_group_name are supported.

member_host

No

String

Backend service address. By default, exact match is used. Fuzzy match is not supported.

member_port

No

Integer

Backend server port.

Minimum: 0

Maximum: 65535

member_group_name

No

String

Backend server group name.

member_group_id

No

String

Backend server group ID.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is a token.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

size

Integer

Length of the returned resource list.

total

Long

Number of resources that match the query conditions.

vpc_channels

Array of VpcChannelInfo objects

VPC channel list.

Table 5 VpcChannelInfo

Parameter

Type

Description

name

String

VPC channel name.

It can contain 3 to 64 characters, starting with a letter. Only letters, digits, hyphens (-), underscores (_), and periods (.) are allowed.

port

Integer

Host port of the VPC channel.

Range: 1-65535.

balance_strategy

Integer

Distribution algorithm.

  • 1: Weighted round robin (WRR).

  • 2: Weighted least connections (WLC).

  • 3: Source hashing.

  • 4: URI hashing.

Default: 1

Enumeration values:

  • 1

  • 2

  • 3

  • 4

member_type

String

Member type of the VPC channel.

  • ip

  • ecs

Default: ecs

Enumeration values:

  • ip

  • ecs

type

Integer

VPC channel type. The default type is server.

  • 2: Server type.

  • 3: Microservice type.

Default: 2

Enumeration values:

  • 2

  • 3

dict_code

String

Dictionary code of the VPC channel.

The value can contain letters, digits, hyphens (-), underscores (_), and periods (.).

This parameter is currently not supported.

Minimum: 3

Maximum: 64

create_time

String

Time when the VPC channel is created.

id

String

VPC channel ID.

status

Integer

VPC channel status.

  • 1: normal

  • 2: abnormal

Enumeration values:

  • 1

  • 2

member_groups

Array of MemberGroupInfo objects

Backend server groups.

microservice_info

MicroServiceInfo object

Microservice information.

Table 6 MemberGroupInfo

Parameter

Type

Description

member_group_name

String

Name of the VPC channel's backend server group. It can contain 3 to 64 characters, starting with a letter. Only letters, digits, underscores (_), hyphens (-), and periods (.) are allowed.

member_group_remark

String

Description of the backend server group.

Maximum: 255

member_group_weight

Integer

Weight of the backend server group.

If the server group contains servers and a weight has been set for it, the weight is automatically used to assign weights to servers in this group.

Minimum: 0

Maximum: 100

dict_code

String

Dictionary code of the backend server group.

The value can contain letters, digits, hyphens (-), underscores (_), and periods (.).

Currently, this parameter is not supported.

Minimum: 3

Maximum: 64

microservice_version

String

Version of the backend server group. This parameter is supported only when the VPC channel type is microservice.

Maximum: 64

microservice_port

Integer

Port of the backend server group. This parameter is supported only when the VPC channel type is microservice. If the port number is 0, all addresses in the backend server group use the original load balancing port to inherit logic.

Minimum: 0

Maximum: 65535

microservice_labels

Array of MicroserviceLabel objects

Tags of the backend server group. This parameter is supported only when the VPC channel type is microservice.

member_group_id

String

ID of the backend server group of the VPC channel.

create_time

String

Time when the backend server group is created.

update_time

String

Time when the backend server group is updated.

Table 7 MicroserviceLabel

Parameter

Type

Description

label_name

String

Tag name.

Start and end with a letter or digit. Use only letters, digits, hyphens (-), underscores (_), and periods (.). (Max. 63 characters.)

Minimum: 1

Maximum: 63

label_value

String

Tag value.

Start and end with a letter or digit. Use only letters, digits, hyphens (-), underscores (_), and periods (.). (Max. 63 characters.)

Minimum: 1

Maximum: 63

Table 8 MicroServiceInfo

Parameter

Type

Description

id

String

Microservice ID.

instance_id

String

Gateway ID.

service_type

String

Microservice type. Options:

  • CSE: CSE microservice registration center

  • CCE: CCE workload

Enumeration values:

  • CSE

  • CCE

cse_info

MicroServiceInfoCSE object

CSE microservice details.

cce_info

MicroServiceInfoCCE object

CCE microservice workload details.

update_time

String

Microservice update time.

create_time

String

Microservice creation time.

Table 9 MicroServiceInfoCSE

Parameter

Type

Description

engine_id

String

Microservice engine ID.

Maximum: 64

service_id

String

Microservice ID.

Maximum: 64

engine_name

String

Microservice engine name.

service_name

String

Microservice name.

register_address

String

Registration center address.

cse_app_id

String

App to which the microservice belongs.

version

String

Microservice version, which has been discarded and is reflected in the version of the backend server group.

Maximum: 64

Table 10 MicroServiceInfoCCE

Parameter

Type

Description

cluster_id

String

CCE cluster ID.

Maximum: 64

namespace

String

Namespace.

Maximum: 64

workload_type

String

Workload type.

  • deployment

  • statefulset

  • daemonset

Enumeration values:

  • deployment

  • statefulset

  • daemonset

app_name

String

App name. Start with a letter, and include only letters, digits, periods (.), hyphens (-), and underscores (_). (1 to 64 characters)

Minimum: 1

Maximum: 64

label_key

String

Service label key. Start with a letter or digit, and use only letters, digits, and these special characters: -_./:(). (1 to 64 characters)

Minimum: 1

Maximum: 64

label_value

String

Service label value. Start with a letter, and include only letters, digits, periods (.), hyphens (-), and underscores (_). (1 to 64 characters)

Minimum: 1

Maximum: 64

cluster_name

String

CCE cluster name.

Status code: 400

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 401

Table 12 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 403

Table 13 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 404

Table 14 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 15 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

None

Example Responses

Status code: 200

OK

{
  "total" : 2,
  "size" : 2,
  "vpc_channels" : [ {
    "name" : "channel 1",
    "port" : 8080,
    "balance_strategy" : 1,
    "member_type" : "ip",
    "dict_code" : "",
    "create_time" : "2020-07-23T07:24:33Z",
    "id" : "105c6902457144a4820dff8b1ad63331",
    "status" : 1,
    "member_groups" : [ ],
    "type" : 2,
    "microservice_info" : {
      "id" : "",
      "instance_id" : "",
      "service_type" : "",
      "cse_info" : {
        "cse_app_id" : "",
        "engine_id" : "",
        "engine_name" : "",
        "register_address" : "",
        "service_id" : "",
        "service_name" : ""
      },
      "cce_info" : {
        "cluster_id" : "",
        "cluster_name" : "",
        "namespace" : "",
        "workload_type" : "",
        "app_name" : ""
      },
      "create_time" : "",
      "update_time" : ""
    }
  }, {
    "name" : "channel 2",
    "port" : 8088,
    "balance_strategy" : 2,
    "member_type" : "ip",
    "dict_code" : "",
    "create_time" : "2020-07-23T07:11:57Z",
    "id" : "56a7d7358e1b42459c9d730d65b14e59",
    "status" : 1,
    "member_groups" : [ ],
    "type" : 3,
    "microservice_info" : {
      "id" : "9483afa235be45158a70c19ab817ac65",
      "instance_id" : "eddc4d25480b4cd6b512f270a1b8b341",
      "service_type" : "CCE",
      "cse_info" : {
        "cse_app_id" : "",
        "engine_id" : "",
        "engine_name" : "",
        "register_address" : "",
        "service_id" : "",
        "service_name" : ""
      },
      "cce_info" : {
        "cluster_id" : "ab1485b4f91b45abbcd560be591f7309",
        "cluster_name" : "cce-test",
        "namespace" : "default",
        "workload_type" : "deployment",
        "app_name" : "testapp"
      },
      "create_time" : "2020-07-23T07:11:57.244829604Z",
      "update_time" : "2020-07-23T07:11:57.244829604Z"
    }
  } ]
}

Status code: 400

Bad Request

{
  "error_code" : "APIG.2011",
  "error_msg" : "The request parameters must be specified,parameterName:name. Please refer to the support documentation"
}

Status code: 401

Unauthorized

{
  "error_code" : "APIG.1002",
  "error_msg" : "Incorrect token or token resolution failed"
}

Status code: 403

Forbidden

{
  "error_code" : "APIG.1005",
  "error_msg" : "No permissions to request this method"
}

Status code: 404

Not Found

{
  "error_code" : "APIG.3030",
  "error_msg" : "The instance does not exist;id:eddc4d25480b4cd6b512f270a1b8b341"
}

Status code: 500

Internal Server Error

{
  "error_code" : "APIG.9999",
  "error_msg" : "System error"
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

Error Codes

See Error Codes.