This API is used to create a VPC endpoint service. Other users can create a VPC endpoint to connect to the endpoint service.
This API is an asynchronous interface. If it is successfully invoked, status code 200 is returned, indicating that the request has been successfully delivered. It takes 1 to 2 minutes to create a VPC endpoint service. You can view the creation result by performing operations in Querying Details of a VPC Endpoint Service.
POST /v1/{project_id}/vpc-endpoint-services
Parameter |
Mandatory |
Description |
---|---|---|
project_id |
Yes |
Specifies the project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
port_id |
Yes |
String |
Specifies the ID for identifying the backend resource of the VPC endpoint service. The ID is in the form of the UUID. The values are as follows:
NOTE:
|
pool_id |
No |
String |
Specifies the ID of the cluster associated with the target VPCEP resource. |
vip_port_id |
No |
String |
Specifies the ID of the virtual NIC to which the virtual IP address is bound. |
service_name |
No |
String |
Specifies the name of the VPC endpoint service. The name can contain a maximum of 16 characters, including letters, digits, underscores (_), and hyphens (-).
|
vpc_id |
Yes |
String |
Specifies the ID of the VPC to which the backend resource of the VPC endpoint service belongs. For details, see response field id in Querying VPC Details in the Virtual Private Cloud API Reference. |
approval_enabled |
No |
Boolean |
Specifies whether connection approval is required.
The default value is true. |
service_type |
No |
String |
Specifies the type of the VPC endpoint service. Only your private services can be configured into interface VPC endpoint services. There are two types of VPC endpoint services: interface and gateway.
You can view those VPC endpoint services that are configured by operations people and are visible and accessible to all users. For detailed steps, see Querying Public VPC Endpoint Services. Perform the operations in Creating a VPC Endpoint to create VPC endpoints for accessing VPC endpoint services of the gateway type and interface type. |
server_type |
Yes |
String |
Specifies the resource type.
|
ports |
Yes |
Array of objects |
Lists the port mappings opened to the VPC endpoint service. For details, see Table 3. Duplicate port mappings are not allowed in the same VPC endpoint service. If multiple VPC endpoint services share the same port_id value, service ports and terminal ports of all these endpoint services cannot be duplicated when the protocol is the same. A maximum of 200 port mappings can be created at a time. |
tcp_proxy |
No |
String |
Specifies whether the client IP address and port number or marker_id information is transmitted to the server. The following methods are supported:
This parameter is available only when the server can parse fields tcp option and tcp payload. The values are as follows:
The default value is close. |
tags |
No |
Array of objects |
Lists the resource tags. For details, see Table 4. A maximum of 20 tags can be added to each VPC endpoint service. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
client_port |
No |
Integer |
Specifies the port for accessing the VPC endpoint. This port is provided by the VPC endpoint, allowing you to access the VPC endpoint service. Supported range: 1 to 65535 |
server_port |
No |
Integer |
Specifies the port for accessing the VPC endpoint service. This port is provided by the backend service to provide services. Supported range: 1 to 65535 |
protocol |
No |
String |
Specifies the protocol used in port mappings. The protocol can be TCP or UDP. The default protocol is TCP. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
key |
No |
String |
Specifies the tag key. A tag key contains a maximum of 36 Unicode characters. This parameter cannot be left blank. It can contain only digits, letters, hyphens (-), underscores (_), and at signs (@). |
value |
No |
String |
Specifies the tag value. A tag value contains a maximum of 43 Unicode characters and can be left blank. It can contain only digits, letters, hyphens (-), underscores (_), and at signs (@). |
POST https://{endpoint}/v1/{project_id}/vpc-endpoint-services
{ "port_id":"4189d3c2-8882-4871-a3c2-d380272eed88", "vpc_id":"4189d3c2-8882-4871-a3c2-d380272eed80", "approval_enabled":false, "service_type":"interface", "server_type":"VM", "ports": [ { "client_port":8080, "server_port":90, "protocol":"TCP" }, { "client_port":8081, "server_port":80, "protocol":"TCP" } ] }
Parameter |
Type |
Description |
---|---|---|
id |
String |
Specifies the unique ID of the VPC endpoint service. |
port_id |
String |
Specifies the ID for identifying the backend resource of the VPC endpoint service. The ID is in the form of the UUID. The values are as follows:
|
vip_port_id |
String |
Specifies the ID of the virtual NIC to which the virtual IP address is bound. This parameter is returned only when port_id is set to VIP. |
service_name |
String |
Specifies the name of the VPC endpoint service. |
service_type |
String |
Specifies the type of the VPC endpoint service. There are two types of VPC endpoint services: interface and gateway.
You can perform the operations in Creating a VPC Endpoint to create VPC endpoints for accessing VPC endpoints of the gateway and interface types. |
server_type |
String |
Specifies the resource type.
|
vpc_id |
String |
Specifies the ID of the VPC to which the backend resource of the VPC endpoint service belongs. |
pool_id |
String |
Specifies the ID of the cluster associated with the target VPCEP resource. |
approval_enabled |
Boolean |
Specifies whether connection approval is required.
|
status |
String |
Specifies the status of the VPC endpoint service.
|
created_at |
String |
Specifies the creation time of the VPC endpoint service. The UTC time format is used: YYYY-MM-DDTHH:MM:SSZ. |
updated_at |
String |
Specifies the update time of the VPC endpoint service. The UTC time format is used: YYYY-MM-DDTHH:MM:SSZ. |
project_id |
String |
Specifies the project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
cidr_type |
String |
Specifies the network segment type. The type can be public or internal.
The default value is internal. |
ports |
Array of objects |
Lists the port mappings opened to the VPC endpoint service. For details, see Table 6. Duplicate port mappings are not allowed in the same VPC endpoint service. If multiple VPC endpoint services share the same port_id value, service ports and terminal ports of all these endpoint services cannot be duplicated when the protocol is the same. |
tcp_proxy |
String |
Specifies whether the client IP address and port number or marker_id information is transmitted to the server. The following methods are supported:
This parameter is available only when the server can parse fields tcp option and tcp payload. The values are as follows:
The default value is close. |
tags |
Array of objects |
Lists the resource tags. For details, see Table 7. |
Parameter |
Type |
Description |
---|---|---|
client_port |
Integer |
Specifies the port for accessing the VPC endpoint. This port is provided by the VPC endpoint, allowing you to access the VPC endpoint service. Supported range: 1 to 65535 |
server_port |
Integer |
Specifies the port for accessing the VPC endpoint service. This port is provided by the backend service to provide services. Supported range: 1 to 65535 |
protocol |
String |
Specifies the protocol used in port mappings. The protocol can be TCPor UDP. The default protocol is TCP. |
Parameter |
Type |
Description |
---|---|---|
key |
String |
Specifies the tag key. A tag key contains a maximum of 36 Unicode characters. This parameter cannot be left blank. It can contain only digits, letters, hyphens (-), and underscores (_). |
value |
String |
Specifies the tag value. A tag value contains a maximum of 43 Unicode characters and can be left blank. It can contain only digits, letters, hyphens (-), and underscores (_). |
{ "id":"4189d3c2-8882-4871-a3c2-d380272eed83", "port_id":"4189d3c2-8882-4871-a3c2-d380272eed88", "vpc_id":"4189d3c2-8882-4871-a3c2-d380272eed80", "pool_id":"5289d3c2-8882-4871-a3c2-d380272eed80", "status":"available", "approval_enabled":false, "service_name":"test123", "service_type":"interface", "server_type":"VM", "project_id":"6e9dfd51d1124e8d8498dce894923a0d", "created_at":"2018-01-30T07:42:01.174", "ports": [ { "client_port":8080, "server_port":90, "protocol":"TCP" }, { "client_port":8081, "server_port":80, "protocol":"TCP" } ] }
For details about status codes, see Status Code.