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
IoT
IoT Device Access
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
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
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
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
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
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
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Updating a VPC Channel

Updated on 2023-06-29 GMT+08:00

Function

This API is used to update the parameters of a VPC channel.

If the VPC channel is overwritten with an empty backend server group list, all the existing backend server groups will be deleted.

For compatibility, if the backend server list is empty, the existing backend servers will not be deleted. To delete the backend servers, use the API for deleting backend servers.

URI

PUT /v2/{project_id}/apic/instances/{instance_id}/vpc-channels/{vpc_channel_id}

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.

vpc_channel_id

Yes

String

VPC channel ID.

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.

The value is a string of 3 to 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. The value must start with an English letter.

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

Default: 1

member_type

Yes

String

Member type of the VPC channel.

  • ip

  • ecs

Default: ecs

dict_code

No

String

The dictionary code of a VPC channel.

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

Not supported currently.

Minimum: 3

Maximum: 64

member_groups

No

Array of MemberGroupCreate objects

List of backend server groups of the VPC channel.

members

No

Array of MemberInfo objects

VPC backend instance list.

vpc_health_config

No

VpcHealthConfig object

Health check details.

Table 4 MemberGroupCreate

Parameter

Mandatory

Type

Description

member_group_name

Yes

String

Name of the backend server group of the VPC channel.

member_group_remark

No

String

Description of the backend server group of the VPC channel.

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.

Minimum: 0

Maximum: 100

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.

Minimum: 3

Maximum: 64

Table 5 MemberInfo

Parameter

Mandatory

Type

Description

host

No

String

Backend server address.

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

Maximum: 64

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.

Minimum: 0

Maximum: 10000

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.

Default: false

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.

Minimum: 0

Maximum: 65535

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

Maximum: 255

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

Maximum: 64

Table 6 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.

Default: GET

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.

Minimum: 0

Maximum: 65535

threshold_normal

Yes

Integer

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

Minimum: 1

Maximum: 10

threshold_abnormal

Yes

Integer

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

Minimum: 1

Maximum: 10

time_interval

Yes

Integer

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

Minimum: 5

Maximum: 300

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.

Default: false

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.

Minimum: 2

Maximum: 30

Response Parameters

Status code: 200

Table 7 Response body parameters

Parameter

Type

Description

name

String

VPC channel name.

The value is a string of 3 to 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. The value must start with an English letter.

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

Default: 1

member_type

String

Member type of the VPC channel.

  • ip

  • ecs

Default: ecs

dict_code

String

The dictionary code of a VPC channel.

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

Not supported currently.

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

member_groups

Array of MemberGroupInfo objects

Backend cloud server groups.

microservice_info

MicroServiceInfo object

Response object of the microservice.

type

Integer

VPC channel type:

2: BUILTIN

3: MICROSERVICE

Table 8 MemberGroupInfo

Parameter

Type

Description

member_group_name

String

Name of the backend server group of the VPC channel.

member_group_remark

String

Description of the backend server group of the VPC channel.

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.

Minimum: 0

Maximum: 100

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.

Minimum: 3

Maximum: 64

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 9 MicroServiceInfo

Parameter

Type

Description

id

String

Microservice ID.

service_type

String

Microservice type:

  • CSE

  • CCE (Not supported yet.)

cse_info

MicroServiceInfoCSE object

CSE information.

cce_info

MicroServiceInfoCCE object

To be supported

update_time

String

Time when the microservice is updated.

create_time

String

Time when the microservice is created.

Table 10 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

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.

Maximum: 64

Table 11 MicroServiceInfoCCE

Parameter

Type

Description

cluster_id

String

CCE cluster ID.

Maximum: 64

namespace

String

Namespace.

Maximum: 64

workload_type

String

Workload type. Options:

  • deployment

  • statefulset

  • daemonset

app_name

String

Application name.

Maximum: 64

label_key

String

Tag name.

Maximum: 64

label_value

String

Tag value.

Maximum: 64

cluster_name

String

CCE cluster name.

Status code: 400

Table 12 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 401

Table 13 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 403

Table 14 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 404

Table 15 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 500

Table 16 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Example Requests

  • Update a server load balance channel.

    {
      "balance_strategy" : 2,
      "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_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"
      } ]
    }
  • Update a microservice load balance channel (to be supported).

    {
      "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_name" : "test",
        "member_group_weight" : 1,
        "member_group_remark" : "remark",
        "microservice_version" : "v1",
        "microservice_port" : 80
      }, {
        "member_group_name" : "default",
        "member_group_weight" : 2,
        "member_group_remark" : "remark",
        "microservice_version" : "v2",
        "microservice_port" : 80
      } ],
      "members" : [ {
        "host" : "192.168.0.5",
        "weight" : 1,
        "member_group_name" : "test"
      }, {
        "host" : "192.168.1.124",
        "weight" : 2,
        "member_group_name" : "default"
      } ]
    }

Example Responses

Status code: 200

OK

  • Example 1

    {
      "name" : "VPC_demo",
      "port" : 22,
      "balance_strategy" : 2,
      "member_type" : "ip",
      "dict_code" : "",
      "create_time" : "2020-07-23T07:11:57Z",
      "id" : "18174f5f4f1a4dc29f33aeadd9788e5f",
      "status" : 1,
      "member_groups" : [ {
        "member_group_id" : "c1ce135c705c4066853a0460b318fe16",
        "member_group_name" : "test",
        "member_group_weight" : 1,
        "member_group_remark" : "remark",
        "create_time" : "2020-07-23T07:11:57.244829604Z",
        "update_time" : "2020-07-23T07:11:57.244829604Z"
      }, {
        "member_group_id" : "c1ce135c705c4066853a0460b318fe17",
        "member_group_name" : "default",
        "member_group_weight" : 2,
        "member_group_remark" : "remark",
        "create_time" : "2020-07-23T07:11:57.244829604Z",
        "update_time" : "2020-07-23T07:11:57.244829604Z"
      } ],
      "type" : 2,
      "microservice_info" : {
        "id" : "",
        "project_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" : ""
      }
    }
  • Example 2

    {
      "name" : "VPC_demo",
      "id" : "105c6902457144a4820dff8b1ad63331",
      "balance_strategy" : 1,
      "dict_code" : "",
      "create_time" : "2020-07-23T07:11:57.244829604Z",
      "member_type" : "ip",
      "port" : 22,
      "status" : 1,
      "member_groups" : [ {
        "member_group_id" : "c1ce135c705c4066853a0460b318fe16",
        "member_group_name" : "test",
        "member_group_weight" : 1,
        "member_group_remark" : "remark",
        "create_time" : "2020-07-23T07:11:57.244829604Z",
        "update_time" : "2020-07-23T07:11:57.244829604Z",
        "microservice_version" : "v1",
        "microservice_port" : 80
      }, {
        "member_group_id" : "c1ce135c705c4066853a0460b318fe17",
        "member_group_name" : "default",
        "member_group_weight" : 2,
        "member_group_remark" : "remark",
        "create_time" : "2020-07-23T07:11:57.244829604Z",
        "update_time" : "2020-07-23T07:11:57.244829604Z",
        "microservice_version" : "v2",
        "microservice_port" : 80
      } ],
      "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.2001",
  "error_msg" : "The request parameters must be specified, parameter name:members"
}

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.3023",
  "error_msg" : "The VPC channel does not exist,id:56a7d7358e1b42459c9d730d65b14e59"
}

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.

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