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

Adding or Updating Backend Instances

Function

This API is used to add backend instances to a VPC channel.

If a backend instance with the specified address already exists, the instance information is updated. If the request body contains multiple backend instance definitions with the same address, the first definition is used.

Calling Method

For details, see Calling APIs.

URI

POST /v2/{project_id}/apigw/instances/{instance_id}/vpc-channels/{vpc_channel_id}/members

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.

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

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

members

Yes

Array of MemberInfo objects

Backend instances.

Table 4 MemberInfo

Parameter

Mandatory

Type

Description

host

No

String

Backend server address.

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

Maximum: 64

weight

No

Integer

Weight.

The higher the weight is, the more requests a backend service will receive.

Minimum: 0

Maximum: 10000

is_backup

No

Boolean

Indicates whether the backend service is a standby node.

After you enable this function, the backend service serves as a standby node. It works only when all non-standby nodes are faulty.

This function is supported only when your gateway has been upgraded to the corresponding version. If your gateway does not support this function, contact technical support.

Default: false

member_group_name

No

String

Backend server group name. The server group facilitates backend service address modification.

status

No

Integer

Backend server status.

  • 1: available

  • 2: unavailable

Enumeration values:

  • 1

  • 2

port

No

Integer

Backend server port.

Minimum: 0

Maximum: 65535

ecs_id

No

String

Backend server ID.

This parameter is required if the backend instance type is ecs. The value can contain 1 to 64 characters, including letters, digits, hyphens (-), and underscores (_).

Maximum: 255

ecs_name

No

String

Backend server name.

This parameter is required if the backend instance type is ecs. The value can contain 1 to 64 characters, including letters, digits, hyphens (-), underscores (_), and periods (.).

Maximum: 64

Response Parameters

Status code: 201

Table 5 Response body parameters

Parameter

Type

Description

size

Integer

Length of the returned resource list.

total

Long

Number of resources that match the query conditions.

members

Array of VpcMemberInfo objects

Cloud server list.

Table 6 VpcMemberInfo

Parameter

Type

Description

host

String

Backend server address.

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

Maximum: 64

weight

Integer

Weight.

The higher the weight is, the more requests a backend service will receive.

Minimum: 0

Maximum: 10000

is_backup

Boolean

Indicates whether the backend service is a standby node.

After you enable this function, the backend service serves as a standby node. It works only when all non-standby nodes are faulty.

This function is supported only when your gateway has been upgraded to the corresponding version. If your gateway does not support this function, contact technical support.

Default: false

member_group_name

String

Backend server group name. The server group facilitates backend service address modification.

status

Integer

Backend server status.

  • 1: available

  • 2: unavailable

Enumeration values:

  • 1

  • 2

port

Integer

Backend server port.

Minimum: 0

Maximum: 65535

ecs_id

String

Backend server ID.

This parameter is required if the backend instance type is ecs. The value can contain 1 to 64 characters, including letters, digits, hyphens (-), and underscores (_).

Maximum: 255

ecs_name

String

Backend server name.

This parameter is required if the backend instance type is ecs. The value can contain 1 to 64 characters, including letters, digits, hyphens (-), underscores (_), and periods (.).

Maximum: 64

id

String

Backend instance ID.

vpc_channel_id

String

VPC channel ID.

create_time

String

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

member_group_id

String

Backend server group ID.

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 401

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 403

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 404

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

  • Adding a cloud server IP address to a VPC channel

    {
      "members" : [ {
        "host" : "192.168.2.25",
        "weight" : 1,
        "member_group_name" : "test"
      } ]
    }
  • Adding a cloud server name to a VPC channel

    {
      "members" : [ {
        "ecs_id" : "1082720c-3c15-409c-9ae3-4983ddfb6a9d",
        "ecs_name" : "APIGtest02",
        "weight" : 2
      } ]
    }

Example Responses

Status code: 201

Created

  • Example 1

    {
      "total" : 1,
      "size" : 1,
      "members" : [ {
        "host" : "192.168.2.25",
        "weight" : 1,
        "is_backup" : false,
        "member_group_name" : "test",
        "status" : 1,
        "port" : 22,
        "ecs_id" : "3082720c-3c15-409c-9ae3-4983ddfb6a9d",
        "ecs_name" : "APIGtest",
        "id" : "683b6807cad54122a6777ad047a6178e",
        "vpc_channel_id" : "105c6902457144a4820dff8b1ad63331",
        "create_time" : "2020-07-23T09:13:24Z",
        "member_group_id" : "cf868f0224084710a1e188b7d3057c52"
      } ]
    }
  • Example 2

    {
      "total" : 2,
      "size" : 2,
      "members" : [ {
        "host" : "192.168.0.17",
        "weight" : 2,
        "is_backup" : false,
        "member_group_name" : "test02",
        "status" : 1,
        "port" : 22,
        "ecs_id" : "1082720c-3c15-409c-9ae3-4983ddfb6a9d",
        "ecs_name" : "APIGtest02",
        "id" : "5c868f0224084710a1e188b7d3057c52",
        "vpc_channel_id" : "105c6902457144a4820dff8b1ad63331",
        "create_time" : "2020-07-23T09:03:53Z",
        "member_group_id" : "df868f0224084710a1e188b7d3057c52"
      }, {
        "host" : "192.168.0.39",
        "weight" : 1,
        "is_backup" : false,
        "member_group_name" : "test01",
        "status" : 1,
        "port" : 22,
        "ecs_id" : "ebe1104f-1254-4ac6-8ed7-366bec84f36e",
        "ecs_name" : "APIGtest01",
        "id" : "33ac0e39d005492eb1f4683e66d1a0d1",
        "vpc_channel_id" : "105c6902457144a4820dff8b1ad63331",
        "create_time" : "2020-07-23T07:24:34Z",
        "member_group_id" : "ef868f0224084710a1e188b7d3057c42"
      } ]
    }

Status code: 400

Bad Request

{
  "error_code" : "APIG.2004",
  "error_msg" : "The parameter value is outside the allowable range,parameterName:weight. 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.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

201

Created

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