Updated on 2022-12-13 GMT+08:00

Querying VPC endpoints

Function

Function This API is used to query VPC endpoints.

URI

GET /v1/{project_id}/vpc-endpoints

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

Minimum: 1

Maximum: 64

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

endpoint_service_name

No

String

Specifies the name of the VPC endpoint service. The name is case insensitive and supports fuzzy match.

Minimum: 1

Maximum: 128

vpc_id

No

String

Specifies the ID of the VPC where the VPC endpoint is to be created.

Minimum: 1

Maximum: 64

id

No

String

Specifies the unique ID of the VPC endpoint.

Minimum: 1

Maximum: 64

limit

No

Integer

Specifies the maximum number of VPC endpoints displayed on each page. The value ranges from 0 to 500 and is generally 10, 20, or 50. The default number is 10.

Minimum: 1

Maximum: 1000

Default: 10

offset

No

Integer

Specifies the offset. All VPC endpoint services after this offset will be queried. The offset must be an integer greater than 0 but less than the number of VPC endpoint services.

Minimum: 0

sort_key

No

String

Specifies the sorting field of the VPC endpoints, which can be: ●create_at: VPC endpoints are sorted by creation time. ●update_at: VPC endpoints are sorted by update time. The default field is create_at.

sort_dir

No

String

Specifies the sorting method of VPC endpoints, which can be: ● desc: VPC endpoints are sorted in descending order. ● asc: VPC endpoints are sorted in ascending order. The default method is desc.

public_border_group

No

String

Specifies the VPC endpoint service that matches the edge attribute in the filtering result.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies the user token. It can be obtained by calling the IAM API. The value of X-Subject-Token in the response header is the user token.

Minimum: 1

Maximum: 2048

Content-Type

Yes

String

Specifies the MIME type of the request body. Default value application/json is recommended. For APIs used to upload objects or images, the MIME type varies depending on the flow type.

Minimum: 1

Maximum: 64

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

endpoints

Array of EndpointResp objects

Endpoint list.

total_count

Integer

Specifies the total number of endpoints that meet the search criteria. The number is not affected by the limit and offset parameters.

Table 5 EndpointResp

Parameter

Type

Description

id

String

Specifies the unique ID of the VPC endpoint.

service_type

String

Specifies the type of the VPC endpoint service that is associated with the VPC endpoint. ● gateway: configured by O&M personnel. You can use them directly without creating them by yourselves. ● interface: includes cloud services configured by O&M personnel and private services created by users. You cannot configure these cloud services, but can use them. You can query public VPC endpoint services to view the VPC endpoint services that are visible and accessible to all users configured by O&M personnel. You can also create an interface VPC endpoint service by creating a VPC endpoint service.

status

String

Specifies the connection status of the VPC endpoint. ●pendingAcceptance: The VPC endpoint connection is to be accepted. ● creating: The VPC endpoint connection is being created. ●accepted: The VPC endpoint connection has been accepted. ● failed: The VPC endpoint connection failed.

active_status

Array of strings

Specifies the account status. ● frozen: The account is frozen. ● active: The account is unfrozen.

endpoint_service_name

String

Specifies the name of the VPC endpoint service.

marker_id

Integer

Specifies the packet ID of the VPC endpoint.

endpoint_service_id

String

Specifies the ID of the VPC endpoint service.

enable_dns

Boolean

Specifies whether to create a domain name. ● true: A domain name is required. ● false: A domain name is not required. Note: When you create a VPC endpoint for connecting a gateway VPC endpoint service, no domain name is created if enable_dns is set to true or false.

dns_names

Array of strings

Specifies the domain name for accessing the associated VPC endpoint service. This parameter is only available when enable_dns is set to true.

ip

String

Specifies the IP address for accessing the associated VPC endpoint service. This parameter is returned only when the following conditions are met: You query a VPC endpoint for accessing an interface VPC endpoint service. The connection approval function is enabled for the VPC endpoint service, and the connection has been accepted. The status of the VPC endpoint can be accepted or rejected. The rejected status only appears when the VPC endpoint connection is accepted and then rejected.

vpc_id

String

Specifies the ID of the VPC where the VPC endpoint is to be created.

subnet_id

String

Specifies the ID of the subnet in the VPC based on vpc_id. The ID is in the UUID format.

created_at

String

Specifies the creation time of the VPC endpoint. The applied UTC time format is YYYY-MM-DDTHH:MM:SSZ.

updated_at

String

Specifies the update time of the VPC endpoint. The applied UTC time format is 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".

tags

Array of TagList objects

Specifies the tag list. If there is no tag in the list, tags is taken as an empty array.

error

Array of QueryError objects

Specifies the error message. This field is returned when the VPC endpoint is abnormal, that is, the value of status is failed.

whitelist

Array of strings

Specifies the whitelist for controlling access to the VPC endpoint. If you do not specify this parameter, an empty whitelist is returned. This parameter is available when you create a VPC endpoint for connecting an interface VPC endpoint service.

enable_whitelist

Boolean

Specifies whether to enable network ACL isolation. ● true: The network ACL isolation is enabled. ● false: The network ACL isolation is disabled. If you do not specify this parameter, network ACL isolation is disabled. This parameter is available when you create a VPC endpoint for connecting an interface VPC endpoint service.

routetables

Array of strings

Specifies the IDs of route tables. If you do not specify this parameter, the route table ID of the VPC is returned. This parameter is available when you create a VPC endpoint for connecting a gateway VPC endpoint service.

description

String

Specifies the description field. The value can contain characters such as letters and digits, but cannot contain less than signs (<) and great than signs (>).

policy_statement

Array of PolicyStatement objects

This field is displayed in the response body only for enabling the gateway VPC endpoint with fixed ports at both ends.

endpoint_pool_id

String

Specifies the ID of the pool associated with the VPC endpoint.

public_border_group

String

Specifies the information about the Public Border Group associated with the VPC endpoint. This parameter is returned only when the endpoint is associated with an edge pool.

Table 6 TagList

Parameter

Type

Description

key

String

Specifies the tag key. A tag key contains a maximum of 36 Unicode characters. It cannot be left blank. It cannot contain equal signs (=), asterisks (*), less than signs (<), greater than signs (>), backslashes (), commas (,), vertical bars (|), and slashes (/), and the first and last characters cannot be spaces.

Minimum: 1

Maximum: 36

value

String

Specifies the tag key. A tag value contains a maximum of 43 Unicode characters and can be an empty string. It cannot contain equal signs (=), asterisks (*), less than signs(<), greater than signs (>), backslashes (), commas (,), vertical bars (|), and slashes (/), and the first and last characters cannot be spaces.

Minimum: 1

Maximum: 43

Table 7 QueryError

Parameter

Type

Description

error_code

String

Error code.

error_message

String

Error message.

Table 8 PolicyStatement

Parameter

Type

Description

Effect

String

Specifies whether to accept or reject the OBS permissions or object.

Action

Array of strings

Specifies OBS access permissions.

Resource

Array of strings

Specifies the OBS object.

Status code: 400

Table 9 Response body parameters

Parameter

Type

Description

error

Error object

Specifies the error message returned when a task submission exception occurs.

Table 10 Error

Parameter

Type

Description

message

String

Task error description

code

String

Error code of a task exception.

Status code: 401

Table 11 Response body parameters

Parameter

Type

Description

error

Error object

Specifies the error message returned when a task submission exception occurs.

Table 12 Error

Parameter

Type

Description

message

String

Task error description

code

String

Error code of a task exception.

Status code: 403

Table 13 Response body parameters

Parameter

Type

Description

error

Error object

Specifies the error message returned when a task submission exception occurs.

Table 14 Error

Parameter

Type

Description

message

String

Task error description

code

String

Error code of a task exception.

Status code: 404

Table 15 Response body parameters

Parameter

Type

Description

error

Error object

Specifies the error message returned when a task submission exception occurs.

Table 16 Error

Parameter

Type

Description

message

String

Task error description

code

String

Error code of a task exception.

Status code: 405

Table 17 Response body parameters

Parameter

Type

Description

error

Error object

Specifies the error message returned when a task submission exception occurs.

Table 18 Error

Parameter

Type

Description

message

String

Task error description

code

String

Error code of a task exception.

Status code: 406

Table 19 Response body parameters

Parameter

Type

Description

error

Error object

Specifies the error message returned when a task submission exception occurs.

Table 20 Error

Parameter

Type

Description

message

String

Task error description

code

String

Error code of a task exception.

Status code: 407

Table 21 Response body parameters

Parameter

Type

Description

error

Error object

Specifies the error message returned when a task submission exception occurs.

Table 22 Error

Parameter

Type

Description

message

String

Task error description

code

String

Error code of a task exception.

Status code: 408

Table 23 Response body parameters

Parameter

Type

Description

error

Error object

Specifies the error message returned when a task submission exception occurs.

Table 24 Error

Parameter

Type

Description

message

String

Task error description

code

String

Error code of a task exception.

Status code: 409

Table 25 Response body parameters

Parameter

Type

Description

error

Error object

Specifies the error message returned when a task submission exception occurs.

Table 26 Error

Parameter

Type

Description

message

String

Task error description

code

String

Error code of a task exception.

Status code: 500

Table 27 Response body parameters

Parameter

Type

Description

error

Error object

Specifies the error message returned when a task submission exception occurs.

Table 28 Error

Parameter

Type

Description

message

String

Task error description

code

String

Error code of a task exception.

Status code: 501

Table 29 Response body parameters

Parameter

Type

Description

error

Error object

Specifies the error message returned when a task submission exception occurs.

Table 30 Error

Parameter

Type

Description

message

String

Task error description

code

String

Error code of a task exception.

Status code: 502

Table 31 Response body parameters

Parameter

Type

Description

error

Error object

Specifies the error message returned when a task submission exception occurs.

Table 32 Error

Parameter

Type

Description

message

String

Task error description

code

String

Error code of a task exception.

Status code: 503

Table 33 Response body parameters

Parameter

Type

Description

error

Error object

Specifies the error message returned when a task submission exception occurs.

Table 34 Error

Parameter

Type

Description

message

String

Task error description

code

String

Error code of a task exception.

Status code: 504

Table 35 Response body parameters

Parameter

Type

Description

error

Error object

Specifies the error message returned when a task submission exception occurs.

Table 36 Error

Parameter

Type

Description

message

String

Task error description

code

String

Error code of a task exception.

Example Requests

GET https://{endpoint}/v1/{project_id}/vpc-endpoints?endpoint_service_name={endpoint_service_name}&vpc_id={vpc_id}&limit={limit}&offset={offset}&id={id}&sort_key={sort_key}&sort_dir={sort_dir}

Example Responses

Status code: 200

The server has successfully processed the request.

{
  "endpoints" : [ {
    "id" : "03184a04-95d5-4555-86c4-e767a371ff99",
    "status" : "accepted",
    "ip" : "192.168.0.232",
    "marker_id" : 16777337,
    "active_status" : "active",
    "vpc_id" : "84758cf5-9c62-43ae-a778-3dbd8370c0a4",
    "service_type" : "interface",
    "project_id" : "295dacf46a4842fcbf7844dc2dc2489d",
    "subnet_id" : "68bfbcc1-dff2-47e4-a9d4-332b9bc1b8de",
    "enable_dns" : "true",
    "dns_name" : "test123",
    "created_at" : "2018-10-18T06:49:46Z",
    "updated_at" : "2018-10-18T06:49:50Z",
    "endpoint_service_id" : "5133655d-0e28-4090-b669-13f87b355c78",
    "endpoint_service_name" : "test123",
    "endpoint_pool_id" : "ee38223b-aacb-46f0-ba7e-94fa62e35dde",
    "public_border_group" : "br-iaas-odin1raa",
    "whitelist" : [ "127.0.0.1" ],
    "enable_whitelist" : true
  }, {
    "id" : "43b0e3b0-eec9-49da-866b-6687b75f9fe5",
    "status" : "accepted",
    "ip" : "192.168.0.115",
    "marker_id" : 16777322,
    "active_status" : "active",
    "vpc_id" : "e251b400-2963-4131-b38a-da81e32026ee",
    "service_type" : "interface",
    "project_id" : "295dacf46a4842fcbf7844dc2dc2489d",
    "subnet_id" : "65528a22-59a1-4972-ba64-88984b3207cd",
    "enable_dns" : "true",
    "dns_name" : "test123",
    "created_at" : "2018-10-18T06:36:20Z",
    "updated_at" : "2018-10-18T06:36:24Z",
    "endpoint_service_id" : "5133655d-0e28-4090-b669-13f87b355c78",
    "endpoint_service_name" : "test123",
    "endpoint_pool_id" : "ee38223b-aacb-46f0-ba7e-94fa62e35dde",
    "whitelist" : [ "127.0.0.1" ],
    "enable_whitelist" : true
  } ],
  "total_count" : 2
}

Status Codes

Status Code

Description

200

The server has successfully processed the request.

400

The request could not be understood by the server due to malformed syntax.

401

The requested page requires a user name and password.

403

The server understood the request, but is refusing to fulfill it.

404

The requested page was not found.

405

The method specified in the request line is not allowed for the resource identified by the request URI.

406

The resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request.

407

The client must first authenticate itself with the proxy.

408

The client did not produce a request within the time that the server was prepared to wait.

409

The request could not be completed due to a conflict with the current state of the resource.

500

Failed to complete the request. Service abnormality.

501

Failed to complete the request. The server does not support the requested function.

502

Failed to complete the request. because the server has received an invalid response.

503

Failed to complete the request. because the system is unavailable.

504

Gateway Timeout

Error Codes

See Error Codes.