Creating a VPC Channel
Function
This API is used to create a VPC channel from APIG to your private VPC resources. Afterwards, when creating an API, you can configure your backend service to use this VPC channel so that APIG can directly access your private VPC resources.
You can create a maximum of 30 VPC channels.
URI
The following table lists the HTTP/HTTPS request method and URI of the API.
Request Method |
URI |
---|---|
POST |
/v1.0/apigw/vpc-channels |
Request
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
VPC channel name A VPC channel name consists of 3–64 characters, starting with a letter. Only letters, digits, hyphens (-), and underscores (_) are allowed. |
type |
Yes |
Integer |
VPC channel type, which can be:
|
member_type |
Mandatory if type is 2 |
String |
Member type of the VPC channel, which can be:
This parameter is valid only when the VPC channel type is set to 2. The default value is instance. |
port |
Mandatory if type is 2 |
Integer |
Host port of the VPC channel This parameter is valid only when the VPC channel type is set to 2. The value range is 1–65535. |
balance_strategy |
Mandatory if type is 2 |
Integer |
Distribution algorithm, which can be:
This parameter is valid only when the VPC channel type is set to 2. The default value is 1. |
vpc_health_config |
Mandatory if type is 2 |
Dictionary |
Health check details. This parameter is valid only when the VPC channel type is set to 2. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
protocol |
Yes |
String |
Protocol for performing health checks on cloud servers in the VPC channel. The value can be:
|
path |
Required when protocol is set to http. |
String |
Destination path for health checks
NOTE:
The value of this parameter must comply with URI specifications. |
port |
No |
Integer |
Destination port for health checks. By default, the host port of the VPC channel is used. Range: 1–65535 |
threshold_normal |
Yes |
Integer |
Healthy threshold It refers to the number (x) of consecutive successful checks required for a cloud server to be marked as healthy. Range: 2–10 |
threshold_abnormal |
Yes |
Integer |
Unhealthy threshold It refers to the number (x) of consecutive failed checks required for a cloud server to be marked as unhealthy. Range: 2–10 |
time_out |
Yes |
Integer |
Timeout for determining whether a health check fails. Unit: s. The value must be less than the value of time_interval. Range: 2–30 |
time_interval |
Yes |
Integer |
Interval between consecutive checks. Unit: s. The value must be greater than the value of time_out. Range: 5–300 |
http_code |
Required when protocol is set to http. |
String |
HTTP response codes for determining a successful HTTP response The value can be any integer within 100–599 in one of the following formats:
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
instance_name |
Yes |
String |
Backend instance name The name must contain 1–64 characters. Only letters, digits, periods (.), hyphens (-), and underscores (_) are allowed. |
instance_id |
Yes |
String |
Backend instance ID The ID must contain 1–64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. |
weight |
Mandatory if type is 2 |
Integer |
Cloud server weight The larger the weight is, the more requests are forwarded to the backend instance. This parameter is valid only when the VPC channel type is set to 2. The value range is 1–100. |
Example request:
{ "balance_strategy": 1, "name": "vpc_001", "port": 15565, "type": 2, "member_type": "instance", "vpc_health_config": { "http_code": "205", "path": "/hc", "port": 15563, "protocol": "http", "threshold_abnormal": 5, "threshold_normal": 5, "time_interval": 200, "time_out": 30 }, "vpc_instances": [ { "instance_id": "instance01", "instance_name": "instance_name01", "weight": 10 } ] }
Response
Parameter |
Type |
Description |
---|---|---|
id |
String |
VPC channel ID |
name |
String |
VPC channel name |
type |
Integer |
VPC channel type, which can be:
|
member_type |
String |
Member type of the VPC channel, which can be:
This parameter is valid only when the VPC channel type is set to 2. |
status |
Integer |
VPC channel status, which can be:
|
port |
Integer |
Host port of the VPC channel |
balance_strategy |
Integer |
Distribution algorithm, which can be:
|
create_time |
Timestamp |
Time when the VPC channel is created |
Example response:
{ "name": "vpc_001", "type": 2, "member_type": "instance", "port": 15565, "balance_strategy": 1, "id": "c3e6a7d85d9e47be89dfcc3cd37405d7", "create_time": "2018-07-27T12:30:48.027484Z", "status": 1 }
Status Codes
Status Code |
Description |
---|---|
201 |
Created |
400 |
Bad Request |
401 |
Unauthorized |
403 |
Forbidden |
404 |
Not Found |
500 |
Server Internal Error |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot