Updated on 2025-03-26 GMT+08:00

Querying VPC Channels

Function

This API is used to query the VPC channels.

URI

GET /v2/{project_id}/apic/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 the project ID, see Appendix > Obtaining a Project ID in the ROMA Connect API Reference.

instance_id

Yes

String

Instance ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

offset

No

Long

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

limit

No

Integer

Number of items displayed on each page.

id

No

String

VPC channel ID.

name

No

String

VPC channel name.

dict_code

No

String

The dictionary code of a VPC channel.

The value can contain letters, digits, and special characters (-_).

Not supported currently.

precise_search

No

String

Parameter name for exact matching. If multiple parameters need to support exact match, separate them with commas (,).

Currently, name and member_group_name are supported.

member_host

No

String

Backend server address. By default, exact query is supported and fuzzy query is not supported.]

member_port

No

Integer

Backend server port.

member_group_name

No

String

Name of the backend server group.

member_group_id

No

String

ID of the backend server group.

vpc_channel_type

No

String

VPC channel type.

  • builtin: server type

  • microservice: microservice type

  • reference: reference load balance channel

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token, which can be obtained by calling the IAM API (value of X-Subject-Token in the response header).

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

Backend instance 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.

NOTE:

Chinese characters must be in UTF-8 or Unicode format.

port

Integer

Port number of the host in the VPC channel.

The value ranges from 1 to 65535.

balance_strategy

Integer

Distribution algorithm.

  • 1: WRR

  • 2: WLC

  • 3: SH

  • 4: URI hashing

member_type

String

Member type of the VPC channel.

  • ip

  • ecs

type

Integer

VPC channel type:

2: BUILTIN

3: MICROSERVICE

vpc_channel_type

String

VPC channel type.

  • builtin (server)

  • microservice

  • reference: reference load balance channel

If vpc_channel_type is empty, the load balance channel type depends on the value of the type field.

If vpc_channel_type is non-empty and type is non-empty or non-zero, an error occurs when they are specified.

If vpc_channel_type is non-empty and type is empty or 0, the value of vpc_channel_type is used to specify the load balance channel type.

When you modify a load balance channel, the VPC channel type will remain unchanged.

dict_code

String

The dictionary code of a VPC channel.

The value can contain letters, digits, and special characters (-_).

Not supported currently.

create_time

String

Time when the VPC channel is created.

id

String

VPC channel ID.

status

Integer

VPC channel status.

  • 1: normal

  • 2: abnormal

member_groups

Array of MemberGroupInfo objects

Backend cloud server groups.

microservice_info

MicroServiceInfo object

Response object of the microservice.

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.

NOTE:

Chinese characters must be in UTF-8 or Unicode format.

member_group_remark

String

Description of the VPC channel's backend server group.

member_group_weight

Integer

Weight of the backend server group of the VPC channel.

If servers exist in the current server group and the weight value exists, the weight value is automatically used to assign weights.

dict_code

String

Dictionary code of the backend server group of the VPC channel.

The code can contain letters, digits, and special characters (-_).

Not supported currently.

microservice_version

String

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

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.

microservice_labels

Array of MicroserviceLabel objects

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

reference_vpc_channel_id

String

ID of the reference load balance channel. This parameter is supported only when the VPC channel type is reference (vpc_channel_type=reference).

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 key

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

label_value

String

Tag value

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

Table 8 MicroServiceInfo

Parameter

Type

Description

id

String

Microservice ID.

instance_id

String

Instance ID

service_type

String

Microservice type. Options:

  • CSE: CSE microservice registration center.

  • CCE: CCE (not supported)

  • CCE_SERVICE: CCE service (not supported).

  • NACOS: Nacos engine. nacos_info is mandatory.

cse_info

MicroServiceInfoCSE object

CSE information.

cce_info

MicroServiceInfoCCE object

CCE basic information (not supported).

cce_service_info

MicroServiceInfoCCEService object

CCE microservice service details.

nacos_info

MicroServiceInfoNacosBase object

Nacos basic information.

update_time

String

Time when the microservice is updated.

create_time

String

Time when the microservice is created.

Table 9 MicroServiceInfoCSE

Parameter

Type

Description

engine_id

String

Microservice engine ID.

service_id

String

Microservice ID.

engine_name

String

Microservice engine name.

service_name

String

Microservice name.

register_address

String

Registry center address.

cse_app_id

String

Application to which the microservice belongs.

version

String

Microservice version. This parameter is deprecated and is supported by the backend server group version.

Table 10 MicroServiceInfoCCE

Parameter

Type

Description

cluster_id

String

CCE cluster ID.

namespace

String

Namespace.

workload_type

String

Workload type. Options:

  • deployment

  • statefulset

  • daemonset

app_name

String

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

NOTE:

Chinese characters must be in UTF-8 or Unicode format.

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)

NOTE:

Chinese characters must be in UTF-8 or Unicode format.

label_value

String

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

NOTE:

Chinese characters must be in UTF-8 or Unicode format.

cluster_name

String

CCE cluster name (not supported).

Table 11 MicroServiceInfoCCEService

Parameter

Type

Description

cluster_id

String

CCE cluster ID.

namespace

String

Namespace. 1 to 63 characters. Use lowercase letters, digits, and hyphens (-). Start with a letter and end with a letter or digit.

service_name

String

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

NOTE:

Chinese characters must be in UTF-8 or Unicode format.

cluster_name

String

CCE cluster name.

Table 12 MicroServiceInfoNacosBase

Parameter

Type

Description

namespace

String

Namespace ID. If the default namespace public is used, leave this parameter empty. Only letters, numbers, hyphens (-), underscores (_) are allowed. Max.: 64 characters

cluster_name

String

Cluster name. The default value is DEFAULT. Only letters, numbers, hyphens (-), underscores (_) are allowed. Max.: 64 characters

group_name

String

Group name. The default value is DEFAULT_GROUP. Only letters, numbers, hyphens (-), underscores (_), periods (.), and colons (:) are allowed. Max.: 128 characters

service_name

String

Microservice name. The value cannot start with @ or contain @@. Max.: 512 characters

server_config

Array of NacosServerConfig objects

Nacos server configurations.

user_info

NacosUserInfo object

Nacos user information.

Table 13 NacosServerConfig

Parameter

Type

Description

ip_address

String

IP address of the Nacos server. Do not enter Chinese characters.

port

Integer

Port number of the Nacos server. Range: 1–65535.

grpc_port

Integer

gRPC port number of the Nacos server. Default: port number + 1000 Range: 1–65535.

Table 14 NacosUserInfo

Parameter

Type

Description

user_name

String

Nacos username.

password

String

Nacos password.

Status code: 400

Table 15 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 401

Table 16 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 403

Table 17 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 404

Table 18 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 500

Table 19 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

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" : "",
        "version" : ""
      },
      "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",
      "project_id" : "73d69ae0cfcf460190522d06b60f05ad",
      "instance_id" : "f0fa1789-3b76-433b-a787-9892951c620e",
      "service_type" : "CCE",
      "cse_info" : {
        "cse_app_id" : "",
        "engine_id" : "",
        "engine_name" : "",
        "register_address" : "",
        "service_id" : "",
        "service_name" : "",
        "version" : ""
      },
      "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:f0fa1789-3b76-433b-a787-9892951c620e"
}

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.