Creating a VPC Channel
Function
This API is used to create a VPC channel from ROMA Connect APIC to your private VPC resources. Afterwards, when creating an API, you can configure your backend service to use this VPC channel so that ROMA Connect APIC can directly access your private VPC resources.
You can create a maximum of 30 VPC channels.
URI
POST /v2/{project_id}/apic/instances/{instance_id}/vpc-channels
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. |
Request 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). |
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.
NOTE:
Characters must be encoded using UTF-8 or Unicode. |
type |
Yes |
Integer |
VPC channel type.
|
port |
No |
Integer |
Port number of the host in the VPC channel. The value ranges from 1 to 65535. This parameter is valid only if the VPC channel type is 2. This parameter is mandatory only if the VPC channel type is 2. |
balance_strategy |
No |
Integer |
Distribution algorithm.
This parameter is required if the VPC channel type is set to 2. |
member_type |
No |
String |
Member type of the VPC channel.
This parameter is required if the VPC channel type is set to 2. Default: ecs |
members |
No |
Array of MemberInfo objects |
Backend server list. Only one backend server is included if the VPC channel type is set to 1. |
vpc_health_config |
No |
VpcHealthConfig object |
Health check details. This parameter is valid only when the VPC channel type is set to 2. |
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. The weight is only available for the WRR and WLC algorithms. It is valid only when the VPC channel type is set to 2. Minimum: 0 Maximum: 100 |
ecs_id |
No |
String |
Backend server ID. This parameter is valid only when the backend instance type is instance. 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 valid only when the backend instance type is instance. The value can contain 1 to 64 characters, including letters, digits, hyphens (-), underscores (_), and periods (.). Maximum: 64 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
protocol |
Yes |
String |
Protocol for performing health checks on backend servers in the VPC channel |
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. By default, the host port of the VPC channel is used. 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: 2 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: 2 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 |
timeout |
No |
Integer |
Timeout for determining whether a health check fails. Unit: s. The value must be less than that of time_interval. Minimum: 2 Maximum: 30 |
Response Parameters
Status code: 201
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.
NOTE:
Characters must be encoded using UTF-8 or Unicode. |
type |
Integer |
VPC channel type.
|
port |
Integer |
Port number of the host in the VPC channel. The value ranges from 1 to 65535. This parameter is valid only if the VPC channel type is 2. This parameter is mandatory only if the VPC channel type is 2. |
balance_strategy |
Integer |
Distribution algorithm.
This parameter is required if the VPC channel type is set to 2. |
member_type |
String |
Member type of the VPC channel.
This parameter is required if the VPC channel type is set to 2. Default: ecs |
create_time |
String |
Time when the VPC channel is created |
id |
String |
VPC channel ID. |
status |
Integer |
VPC channel status. |
elb_id |
String |
ID of a private network ELB channel. This parameter is valid only when the VPC channel type is set to 1. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error description. |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error description. |
Status code: 403
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error description. |
Status code: 404
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error description. |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error description. |
Example Requests
{ "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 }, "members" : [ { "host" : "192.168.0.5", "weight" : 1 }, { "host" : "192.168.1.124", "weight" : 2 } ] }
Example Responses
Status code: 201
Created
{ "id" : "105c6902457144a4820dff8b1ad63331", "balance_strategy" : 1, "create_time" : "2020-07-23T07:11:57.244829604Z", "member_type" : "ip", "port" : 22, "status" : 1, "name" : "VPC_demo", "type" : 2 }
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.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 |
---|---|
201 |
Created |
400 |
Bad Request |
401 |
Unauthorized |
403 |
Forbidden |
404 |
Not Found |
500 |
Internal Server Error |
Error Codes
See Error Codes.
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