Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
DataArts Fabric
IoT
IoT Device Access
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
Huawei Cloud Astro Canvas
Huawei Cloud Astro Zero
CodeArts Governance
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance (CCI)
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Cloud Transformation
Well-Architected Framework
Cloud Adoption Framework
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Creating a VPC Channel in a Project

Function

Create a VPC channel and associate it with multiple instances. VPC channel names must be unique in the same project. Note: This parameter is available only when vpc_name_modifiable is set to off.

URI

POST /v2/{project_id}/apic/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.

Request Parameters

Table 2 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).

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

name

Yes

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

Yes

Integer

Port number of the host in the VPC channel.

The value ranges from 1 to 65535.

balance_strategy

Yes

Integer

Distribution algorithm.

  • 1: WRR

  • 2: WLC

  • 3: SH

  • 4: URI hashing

member_type

Yes

String

Member type of the VPC channel.

  • ip

  • ecs

type

No

Integer

VPC channel type.

  • 2: Server

  • 3: Microservice

If vpc_channel_type is empty, the load balance channel type is determined by the type field.

If the value of type is not 3 or the value of microservice_info is empty, the VPC channel type is server by default.

If the value of type is 3 and the value of microservice_info is not empty, the VPC channel type is microservice.

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

This field is to be discarded. Use the vpc_channel_type field to specify the load balance channel type.

vpc_channel_type

No

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

No

String

The dictionary code of a VPC channel.

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

Not supported currently.

member_groups

No

Array of MemberGroupCreate objects

Backend server groups of the VPC channel. If service_type in microservice_info is set to NACOS, the weight of the server group cannot be manually set.

members

No

Array of MemberInfo objects

Backend instances of the VPC channel.

This field will not be used to add or update backend instances for a reference load balance channel.

vpc_health_config

No

VpcHealthConfig object

Health check details.

microservice_info

No

MicroServiceCreate object

Microservice details.

instance_ids

Yes

Array of strings

IDs of associated instances (specify 1 to 10 IDs). To increase the quota, contact technical support to modify PROJECT_VPC_OPERATOR_NUM_LIMIT.

Table 4 MemberGroupCreate

Parameter

Mandatory

Type

Description

member_group_name

Yes

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

No

String

Description of the VPC channel's backend server group.

member_group_weight

No

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

No

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

No

String

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

microservice_port

No

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

No

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

No

String

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

Table 5 MicroserviceLabel

Parameter

Mandatory

Type

Description

label_name

Yes

String

Tag key

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

label_value

Yes

String

Tag value

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

Table 6 MemberInfo

Parameter

Mandatory

Type

Description

host

No

String

Backend server address.

This parameter is valid when the member type is IP address.

weight

No

Integer

Backend server weight.

The higher the weight is, the more requests a cloud server will receive.

It is valid only when the VPC channel type is set to 2.

is_backup

No

Boolean

Indicates whether it is a standby node.

After this parameter is enabled, the corresponding backend service functions as the standby node and works only when all non-standby nodes are faulty.

The instance must be upgraded to the corresponding version to support this function. If the instance does not support this function, contact technical support.

member_group_name

No

String

Name of the backend server group. Select a server group for the backend service address so that the backend addresses of the corresponding server group can be changed in a unified manner.

status

No

Integer

Backend server status.

  • 1: available

  • 2: unavailable

port

No

Integer

Backend server port.

ecs_id

No

String

Backend ECS ID

This parameter is mandatory when the backend instance type is ECS. It can include letters, digits, hyphens (-), and underscores (_) (max. 64 characters).

ecs_name

No

String

Backend ECS name

This parameter is mandatory when the backend instance type is ECS. It can include letters, digits, hyphens (-), underscores (_), and periods (.) (max. 64 characters).

Table 7 VpcHealthConfig

Parameter

Mandatory

Type

Description

protocol

Yes

String

Protocol for performing health checks on backend servers in the VPC channel.

  • TCP

  • HTTP

  • HTTPS

path

No

String

Destination path for health checks. This parameter is required if protocol is set to http.

method

No

String

Request method for health checks.

port

No

Integer

Destination port for health checks. If this parameter is not specified or set to 0, the host port of the VPC channel is used.

If the port has a non-zero value, the port is used for health checks.

threshold_normal

Yes

Integer

Healthy threshold, which refers to the number of consecutive successful checks required for a backend server to be considered healthy.

threshold_abnormal

Yes

Integer

Unhealthy threshold, which refers to the number of consecutive failed checks required for a backend server to be considered unhealthy.

time_interval

Yes

Integer

Interval between consecutive checks. Unit: s. The value must be greater than that of timeout.

http_code

No

String

Response codes for determining a successful HTTP response. The value can be any integer within 100–599 in one of the following formats:

  • Multiple values, for example, 200,201,202

  • Range, for example, 200-299

  • Multiple values and ranges, for example, 201,202,210-299.

    This parameter is required if protocol is set to http.

enable_client_ssl

No

Boolean

Whether to enable two-way authentication. If this function is enabled, the certificate specified by backend_client_certificate in the instance configuration is used.

status

No

Integer

Health check status

  • 1: available

  • 2: unavailable

timeout

Yes

Integer

Timeout for determining whether a health check fails, in seconds. The value must be less than the value of time_interval.

Table 8 MicroServiceCreate

Parameter

Mandatory

Type

Description

service_type

No

String

Microservice type. Options:

  • CSE: CSE microservice registration center.

  • CCE: CCE (not supported)

  • CCE_SERVICE: CCE service (not supported).

  • NACOS: Nacos registration center. nacos_info is mandatory.

cse_info

No

MicroServiceInfoCSEBase object

CES basic information

cce_info

No

MicroServiceInfoCCEBase object

Not supported

cce_service_info

No

MicroServiceInfoCCEServiceBase object

Not supported currently.

nacos_info

No

MicroServiceInfoNacosBase object

Nacos basic information.

Table 9 MicroServiceInfoCSEBase

Parameter

Mandatory

Type

Description

engine_id

Yes

String

Microservice engine ID.

service_id

Yes

String

Microservice ID.

Table 10 MicroServiceInfoCCEBase

Parameter

Mandatory

Type

Description

cluster_id

Yes

String

CCE cluster ID.

namespace

Yes

String

Namespace.

workload_type

Yes

String

Workload type. Options:

  • deployment

  • statefulset

  • daemonset

app_name

No

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

No

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

No

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.

Table 11 MicroServiceInfoCCEServiceBase

Parameter

Mandatory

Type

Description

cluster_id

Yes

String

CCE cluster ID.

namespace

Yes

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

Yes

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.

Table 12 MicroServiceInfoNacosBase

Parameter

Mandatory

Type

Description

namespace

No

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

No

String

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

group_name

No

String

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

service_name

Yes

String

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

server_config

Yes

Array of NacosServerConfig objects

Nacos server configurations.

user_info

Yes

NacosUserInfo object

Nacos user information.

Table 13 NacosServerConfig

Parameter

Mandatory

Type

Description

ip_address

Yes

String

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

port

Yes

Integer

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

grpc_port

No

Integer

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

Table 14 NacosUserInfo

Parameter

Mandatory

Type

Description

user_name

Yes

String

Nacos username.

password

Yes

String

Nacos password.

Response Parameters

Status code: 201

Table 15 Response body parameters

Parameter

Type

Description

project_vpc_channels

Array of ProjectVpcChannelInfo objects

List of project VPC channels.

Table 16 ProjectVpcChannelInfo

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

String

VPC channel type:

  • BUILTIN

  • 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.

instance_id

String

Instance ID.

instance_name

String

Instance name.

members

Array of VpcMemberInfo objects

Backend instance list.

vpc_health_config

VpcHealthConfigInfo object

Health check details.

microservice_info

MicroServiceInfo object

Response object of the microservice.

Table 17 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 18 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 19 VpcMemberInfo

Parameter

Type

Description

host

String

Backend server address.

This parameter is valid when the member type is IP address.

weight

Integer

Backend server weight.

The higher the weight is, the more requests a cloud server will receive.

It is valid only when the VPC channel type is set to 2.

is_backup

Boolean

Indicates whether it is a standby node.

After this parameter is enabled, the corresponding backend service functions as the standby node and works only when all non-standby nodes are faulty.

The instance must be upgraded to the corresponding version to support this function. If the instance does not support this function, contact technical support.

member_group_name

String

Name of the backend server group. Select a server group for the backend service address so that the backend addresses of the corresponding server group can be changed in a unified manner.

status

Integer

Backend server status.

  • 1: available

  • 2: unavailable

port

Integer

Backend server port.

ecs_id

String

Backend ECS ID

This parameter is mandatory when the backend instance type is ECS. It can include letters, digits, hyphens (-), and underscores (_) (max. 64 characters).

ecs_name

String

Backend ECS name

This parameter is mandatory when the backend instance type is ECS. It can include letters, digits, hyphens (-), underscores (_), and periods (.) (max. 64 characters).

id

String

VPC channel list.

vpc_channel_id

String

Backend instance ID.

create_time

String

VPC channel ID.

member_group_id

String

Time when the backend server is added to the VPC channel.

health_status

String

Health status of the backend instance of the load balance channel. The value can be unknown, healthy, or unhealthy, indicating that no health check is performed, healthy, or unhealthy, respectively.

Table 20 VpcHealthConfigInfo

Parameter

Type

Description

protocol

String

Protocol for performing health checks on backend servers in the VPC channel.

  • TCP

  • HTTP

  • HTTPS

path

String

Destination path for health checks. This parameter is required if protocol is set to http.

method

String

Request method for health checks.

port

Integer

Destination port for health checks. If this parameter is not specified or set to 0, the host port of the VPC channel is used.

If the port has a non-zero value, the port is used for health checks.

threshold_normal

Integer

Healthy threshold, which refers to the number of consecutive successful checks required for a backend server to be considered healthy.

threshold_abnormal

Integer

Unhealthy threshold, which refers to the number of consecutive failed checks required for a backend server to be considered unhealthy.

time_interval

Integer

Interval between consecutive checks. Unit: s. The value must be greater than that of timeout.

http_code

String

Response codes for determining a successful HTTP response. The value can be any integer within 100–599 in one of the following formats:

  • Multiple values, for example, 200,201,202

  • Range, for example, 200-299

  • Multiple values and ranges, for example, 201,202,210-299.

    This parameter is required if protocol is set to http.

enable_client_ssl

Boolean

Whether to enable two-way authentication. If this function is enabled, the certificate specified by backend_client_certificate in the instance configuration is used.

status

Integer

Health check status

  • 1: available

  • 2: unavailable

timeout

Integer

Timeout for determining whether a health check fails, in seconds. The value must be less than the value of time_interval.

vpc_channel_id

String

VPC channel ID.

id

String

Health check ID.

create_time

String

Creation time.

Table 21 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 22 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 23 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 24 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 25 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 26 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 27 NacosUserInfo

Parameter

Type

Description

user_name

String

Nacos username.

password

String

Nacos password.

Status code: 400

Table 28 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 401

Table 29 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 403

Table 30 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 500

Table 31 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Example Requests

Create a VPC channel in a project with member type as IP, add backend servers, and associate the VPC channel with multiple instances.

{
  "balance_strategy" : 1,
  "member_type" : "ip",
  "name" : "VPC_demo",
  "port" : 22,
  "vpc_health_config" : {
    "http_code" : "200",
    "path" : "/vpc/demo",
    "port" : 22,
    "protocol" : "http",
    "threshold_abnormal" : 5,
    "threshold_normal" : 2,
    "time_interval" : 10,
    "timeout" : 5,
    "enable_client_ssl" : false
  },
  "member_groups" : [ {
    "member_group_name" : "test",
    "member_group_weight" : 1,
    "member_group_remark" : "remark"
  }, {
    "member_group_name" : "default",
    "member_group_weight" : 2,
    "member_group_remark" : "remark"
  } ],
  "members" : [ {
    "host" : "192.168.0.5",
    "weight" : 1,
    "member_group_name" : "test"
  }, {
    "host" : "192.168.1.124",
    "weight" : 2,
    "member_group_name" : "default"
  } ],
  "instance_ids" : [ "eea73cde015940908ae0117d67bf7330", "ddd73cde017890908ae0117d67bf7330" ]
}

Example Responses

Status code: 201

OK

{
  "project_vpc_channels" : [ {
    "balance_strategy" : 1,
    "member_type" : "ip",
    "name" : "VPC_demo",
    "port" : 22,
    "type" : 2,
    "vpc_health_config" : {
      "http_code" : "200",
      "path" : "/vpc/demo",
      "port" : 22,
      "protocol" : "http",
      "threshold_abnormal" : 5,
      "threshold_normal" : 2,
      "time_interval" : 10,
      "timeout" : 5,
      "enable_client_ssl" : false
    },
    "member_groups" : [ {
      "member_group_id" : "ec79066c6f6f462e91ff3f17f0e43f2a",
      "member_group_name" : "test",
      "member_group_remark" : "remark",
      "member_group_weight" : 1,
      "create_time" : "2020-07-23T07:11:57.244829604Z",
      "update_time" : "2020-07-23T07:11:57.244829604Z"
    }, {
      "member_group_id" : "5b26a82cd18547f3ada54b3cfa641df9",
      "member_group_name" : "default",
      "member_group_remark" : "remark",
      "member_group_weight" : 2,
      "create_time" : "2020-07-23T07:11:57.244829604Z",
      "update_time" : "2020-07-23T07:11:57.244829604Z"
    } ],
    "instance_id" : "eea73cde015940908ae0117d67bf7330",
    "instance_name" : "test1"
  }, {
    "balance_strategy" : 1,
    "member_type" : "ip",
    "name" : "VPC_demo",
    "port" : 22,
    "type" : 2,
    "vpc_health_config" : {
      "http_code" : "200",
      "path" : "/vpc/demo",
      "port" : 22,
      "protocol" : "http",
      "threshold_abnormal" : 5,
      "threshold_normal" : 2,
      "time_interval" : 10,
      "timeout" : 5,
      "enable_client_ssl" : false
    },
    "member_groups" : [ {
      "create_time" : "2021-08-30T14:02:25Z",
      "member_group_id" : "ec79066c6f6f462e91ff3f17f0e43f2a",
      "member_group_name" : "test",
      "member_group_remark" : "",
      "member_group_weight" : 1,
      "update_time" : "2021-08-30T14:02:25Z"
    }, {
      "create_time" : "2021-08-04T06:03:47Z",
      "member_group_id" : "5b26a82cd18547f3ada54b3cfa641df9",
      "member_group_name" : "default",
      "member_group_remark" : "",
      "member_group_weight" : 1,
      "update_time" : "2021-08-04T06:03:47Z"
    } ],
    "instance_id" : "ddd73cde017890908ae0117d67bf7330",
    "instance_name" : "test2"
  } ]
}

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: 500

Internal Server Error

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

Status Codes

Status Code

Description

201

OK

400

Bad Request

401

Unauthorized

403

Forbidden

500

Internal Server Error

Error Codes

See Error Codes.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback