Files
doc-exports/docs/vpcep/api-ref/vpcep_06_0201.html
fanqinying 856eead9f0 VPCEP API 20251117 version
Reviewed-by: Hajba, László Antal <laszlo-antal.hajba@t-systems.com>
Co-authored-by: fanqinying <fanqinying@huawei.com>
Co-committed-by: fanqinying <fanqinying@huawei.com>
2026-01-23 11:56:31 +00:00

67 KiB

Creating a VPC Endpoint Service

Function

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 asynchronous. 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 About a VPC Endpoint Service.

URI

POST /v1/{project_id}/vpc-endpoint-services

Table 1 describes the parameter in this URI.
Table 1 URI parameter

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

Request

  • Parameter description
    Table 2 Request parameters

    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 universally unique identifier (UUID) format.

    The values are as follows:

    • If the backend resource is a load balancer, the value is the ID of the port bound to the private IP address of the load balancer. For details, see response field port_id in Querying Details of a Load Balancer and Viewing Details of a Load Balancer.
    • If the backend resource is an ECS, the value is the NIC ID of the ECS where the VPC endpoint service is deployed. For details, see port_id in the response in Querying NICs of an ECS in the Elastic Cloud Server API Reference.
    • If the backend resource is a virtual IP address, the value is the port ID of the physical server where virtual resources are created. (This value will be discarded. The LB type is recommended.)
    • If the backend resource is a BMS, the value is the NIC ID of the BMS where the VPC endpoint service is deployed. (This value will be discarded. The LB type is recommended.)
    NOTE:
    • To create a VPC endpoint service, the CIDR block of the VPC where the VPC endpoint service is deployed cannot overlap with 198.19.128.0/17.
    • The destination address of the custom route in the VPC route table cannot overlap with 198.19.128.0/17.

    pool_id

    No

    String

    Specifies the ID of the cluster associated with the target VPC endpoint resource.

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

    • If you do not specify this parameter, the VPC endpoint service name is in the format: regionName.serviceId.
    • If you specify this parameter, the VPC endpoint service name is in the format: regionName+.+serviceName+.+serviceId.

    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 Virtual Private Cloud API Reference.

    approval_enabled

    No

    Boolean

    Specifies whether connection approval is required.

    • false: Connection approval is not required. The created VPC endpoint is in the accepted state.
    • true: Connection approval is required. The created VPC endpoint is in the pendingAcceptance state until the owner of the associated VPC endpoint service approves the connection.

    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.
    • Gateway: VPC endpoint services of this type are configured by O&M personnel. You can use them directly without the need to create one by yourselves.
    • Interface: VPC endpoint services of this type include cloud services configured by O&M personnel and private services created by yourselves. You cannot configure these cloud services, but can use them.

    You can view those VPC endpoint services that are configured by O&M personnel 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.

    • LB: Select this value if the backend resource is a load balancer. Backend resources of this type suit services that receive high access traffic and demand high reliability and disaster recovery (DR) performance.
    • VM: Select this value if the backend resource is an ECS. Backend resources of this type serve as servers.
    • VIP: Select this value if the backend resource is a virtual IP address. (This value will be discarded. The LB type is recommended.)
    • BMS: Select this value if the backend resource is a BMS. (This value will be discarded. The LB type is recommended.)

    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, either server_port or protocol, or both server_port and protocol of each of these VPC endpoint services must be unique. 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:

    • TCP TOA: The client information is inserted into field tcp option and transmitted to the server.
      NOTE:

      TCP TOA is supported only when the backend resource is OBS.

    • Proxy Protocol: The client information is inserted into field tcp payload and transmitted to the server.

    This parameter is available only when the server can parse fields tcp option and tcp payload.

    The values are as follows:

    • close: The TOA and Proxy Protocol methods are neither used.
    • toa_open: The TOA method is used.
    • proxy_open: The Proxy Protocol method is used.
    • open: The TOA and Proxy Protocol methods are both used.
    • proxy_vni: The TOA Protocol method is not used. Proxy and virtual network ID are used.

    The default value is close.

    ip_version

    No

    String

    Specifies the IP version of the VPC endpoint service. Only professional VPC endpoint services support this parameter. This is a reserved parameter and is not supported currently.

    • ipv4: IPv4
    • ipv6: IPv6

    enable_policy

    No

    Boolean

    Specifies whether the VPC endpoint policy can be customized.

    • false: The VPC endpoint policy cannot be customized.

    • true: The VPC endpoint policy can be customized.

    The default value is false.

    payer

    No

    String

    Specifies the payer of the VPC endpoint service, that is, who pays for the connected VPC endpoints. This is a reserved parameter and is not supported currently.

    • endpoint: paid by the tenant who creates the VPC endpoints
    • endpoint_service: paid by the tenant who creates the VPC endpoint service

    enterprise_project_id

    No

    String

    Specifies the enterprise project ID. When creating a VPC endpoint service, you need to specify an enterprise project ID for it.

    The value is 0 or a string that contains a maximum of 36 bytes in the UUID format with hyphens (-).

    0 indicates the default enterprise project.

    supported_editions

    No

    Array of strings

    Specifies the type of the VPC endpoint service. This is a reserved parameter and is not supported currently.

    The value can be:

    • profession: professional VPC endpoint services
    • basic: basic VPC endpoint services

    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.

    description

    No

    String

    Supplementary information about the VPC endpoint service. The value can contain a maximum of 128 characters, including letters and digits. Angle brackets (< and >) are not allowed.

    Table 3 Port parameters

    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 port mapping protocol. TCP is supported.

    The default value is TCP.

    Table 4 Tags parameters

    Parameter

    Mandatory

    Type

    Description

    key

    No

    String

    Specifies the tag key. The key:
    • Cannot be an empty string.

    • Must be unique for each resource.

    • Can contain a maximum of 128 characters.

    • Cannot start or end with a space, or start with _sys_. Only letters, digits, spaces, and the following special characters are allowed: _.:=+-@

    value

    No

    String

    Specifies the tag value. The value:
    • Can be an empty string.

    • Can contain a maximum of 255 characters.

    • Can contain letters, digits, spaces, and the following special characters: _.:/=+-@

  • Example request
    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"
      } ],
      "payer": "endpoint_service",
      "supported_editions": ["basic"],
      "enterprise_project_id": "0"
    }

Response

  • Parameter description
    Table 5 Response parameters

    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 UUID format. The values are as follows:

    • If the backend resource is a load balancer, the value is the ID of the port bound to the private IP address of the load balancer.
    • If the backend resource is an ECS, the value is the NIC ID of the ECS where the VPC endpoint service is deployed.
    • If the backend resource is a virtual IP address, the value is the port ID of the physical server where virtual resources are created. (This value will be discarded. The LB type is recommended.)
    • If the backend resource is a BMS, the value is the NIC ID of the BMS where the VPC endpoint service is deployed. (This value will be discarded. The LB type is recommended.)

    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.
    • Gateway: VPC endpoint services of this type are configured by O&M personnel. You can use them directly without the need to create one by yourselves.
    • Interface: VPC endpoint services of this type include cloud services configured by O&M personnel and private services created by yourselves. You cannot configure these cloud services, but can use them.

    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.

    • LB: indicates a load balancer.
    • VM: indicates an ECS.
    • VIP: indicates a virtual IP address. (This value has been discarded. The LB type is recommended.)
    • BMS: indicates a BMS. (This value has been discarded. The LB type is recommended.)

    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 VPC endpoint resource.

    approval_enabled

    Boolean

    Specifies whether connection approval is required.

    • false: Connection approval is not required. The created VPC endpoint is in the accepted state.
    • true: Connection approval is required. The created VPC endpoint is in the pendingAcceptance state until the owner of the associated VPC endpoint service approves the connection.

    status

    String

    Specifies the status of the VPC endpoint service.

    • creating: The VPC endpoint service is being created.
    • available: The VPC endpoint service is connectable.
    • failed: The VPC endpoint service failed to be created.

    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.

    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, either server_port or protocol, or both server_port and protocol of each of these endpoint services must be unique.

    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:

    • TCP TOA: The client information is inserted into field tcp option and transmitted to the server.
      NOTE:

      TCP TOA is supported only when the backend resource is OBS.

    • Proxy Protocol: The client information is inserted into field tcp payload and transmitted to the server.

    This parameter is available only when the server can parse fields tcp option and tcp payload.

    The values are as follows:

    • close: The TOA and Proxy Protocol methods are neither used.
    • toa_open: The TOA method is used.
    • proxy_open: The Proxy Protocol method is used.
    • open: The TOA and Proxy Protocol methods are both used.
    • proxy_vni: The TOA Protocol method is not used. Proxy and virtual network ID are used.

    The default value is close.

    ip_version

    String

    Specifies the IP version of the VPC endpoint service. Only professional VPC endpoint services support this parameter. This is a reserved parameter and is not supported currently.

    • ipv4: IPv4
    • ipv6: IPv6

    enable_policy

    Boolean

    Specifies whether the VPC endpoint policy can be customized.

    • false: The VPC endpoint policy cannot be customized.

    • true: The VPC endpoint policy can be customized.

    The default value is false.

    payer

    String

    Specifies the payer of the VPC endpoint service, that is, who pays for the connected VPC endpoints. This is a reserved parameter and is not supported currently.

    • endpoint: paid by the tenant who creates the VPC endpoints
    • endpoint_service: paid by the tenant who creates the VPC endpoint service

    enterprise_project_id

    String

    Specifies the enterprise project ID. When creating a VPC endpoint service, you need to specify an enterprise project ID for it.

    The value is 0 or a string that contains a maximum of 36 bytes in the UUID format with hyphens (-).

    0 indicates the default enterprise project.

    supported_editions

    Array of strings

    Specifies the type of the VPC endpoint service. This is a reserved parameter and is not supported currently.

    The value can be:

    • profession: professional VPC endpoint services
    • basic: basic VPC endpoint services

    tags

    Array of objects

    Lists the resource tags. For details, see Table 7.

    description

    String

    Supplementary information about the VPC endpoint service. The value can contain a maximum of 128 characters, including letters and digits. Angle brackets (< and >) are not allowed.

    ip_version

    String

    Specifies the IP version of the VPC endpoint service. Only professional VPC endpoint services support this parameter. This is a reserved parameter and is not supported currently.

    ipv4: The VPC endpoint can only have an IPv4 address.

    ipv6: The VPC endpoint can have both IPv4 and IPv6 addresses.

    Table 6 Port parameters

    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 port mapping protocol. TCP is supported.

    The default value is TCP.

    Table 7 Tags parameters

    Parameter

    Type

    Description

    key

    String

    Specifies the tag key. The key:
    • Cannot be an empty string.

    • Must be unique for each resource.

    • Can contain a maximum of 128 characters.

    • Cannot start or end with a space, or start with _sys_. Only letters, digits, spaces, and the following special characters are allowed: _.:=+-@

    value

    String

    Specifies the tag value. The value:
    • Can be an empty string.

    • Can contain a maximum of 255 characters.

    • Can contain letters, digits, spaces, and the following special characters: _.:/=+-@

  • Example response
    {
      "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" : "2022-04-14T09:35:47Z",
      "updated_at" : "2022-04-14T09:35:47Z",
      "tcp_proxy": "close",
      "ports" : [ {
        "client_port" : 8080,
        "server_port" : 90,
        "protocol" : "TCP"
      }, {
        "client_port" : 8081,
        "server_port" : 80,
        "protocol" : "TCP"
      } ],
      "tags": [],
      "description": "",
      "payer": "endpoint_service",
      "supported_editions": ["basic"],
      "enterprise_project_id": "0",
      "ip_version": "ipv4",
      "enable_policy": false
    }

Status Codes

See Status Codes.

Error Codes

For details, see Error Codes.