Help Center> VPC Endpoint> API Reference> API> VPC Endpoint Services> Querying Basic Information About a VPC Endpoint Service
Updated on 2024-04-19 GMT+08:00

Querying Basic Information About a VPC Endpoint Service

Function

This API is used to query basic information about a VPC endpoint service. You can use this API to query the target VPC endpoint service. This API can also be used by other users to query basic information about your VPC endpoint service, without exposing your server information.

Calling Method

For details, see Calling APIs.

URI

GET /v1/{project_id}/vpc-endpoint-services/describe

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. Note: Either this field or the id field must be specified. Otherwise, an error occurs.

Minimum: 1

Maximum: 128

id

No

String

Specifies the ID of the VPC endpoint service. The ID is the unique identifier of the VPC endpoint service. Note: Either this parameter or endpoint_service_name must be specified.

Minimum: 1

Maximum: 64

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.

Content-Type

No

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.

Default: application/json

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

id

String

Specifies the unique ID of the VPC endpoint service.

Minimum: 1

Maximum: 64

service_name

String

Specifies the name of the VPC endpoint service.

service_type

String

Specifies the type of the VPC endpoint service. Only your private services can be configured into interface VPC endpoint services.

  • gateway: indicates the VPC endpoint services that are configured by the O&M personnel. You can use them directly without creating them by yourselves.

  • interface: indicates the cloud services configured by the O&M personnel and private services created by yourselves. You cannot configure these cloud services, but can use them. You can create VPC endpoints to connect to gateway and interface VPC endpoint services.

created_at

String

Specifies when the VPC endpoint service was created. The UTC time format YYYY-MMDDTHH:MM:SSZ is used.

is_charge

Boolean

Specifies whether the VPC endpoint connected to the VPC endpoint service is billed.

  • true: The VPC endpoint is billed.

  • false: The VPC endpoint is not billed.

public_border_group

String

Specifies the public border group information about the pool corresponding to the VPC endpoint.

enable_policy

Boolean

Specifies whether the VPC endpoint policy is enabled.

  • false: The VPC endpoint policy cannot be set.

  • true: The VPC endpoint policy can be set. The default value is false. Specifies whether the VPC endpoint policy is enabled.

  • false: The VPC endpoint policy cannot be set.

  • true: The VPC endpoint policy can be set. The default value is false.

Example Requests

Querying basic information about a VPC endpoint service

GET https://{endpoint}/v1/{project_id}/vpc-endpoint-services/describe?id=4189d3c2-8882-4871-a3c2-d380272eed83

Example Responses

Status code: 200

The server has successfully processed the request.

{
  "id" : "9d4c1028-1336-4556-9881-b5d807c1b8a8",
  "service_name" : "test123",
  "service_type" : "interface",
  "created_at" : "2018-09-17T07:28:31Z",
  "is_charge" : "true"
}

SDK Sample Code

The SDK sample code is as follows.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package com.huaweicloud.sdk.test;

import com.huaweicloud.sdk.core.auth.ICredential;
import com.huaweicloud.sdk.core.auth.BasicCredentials;
import com.huaweicloud.sdk.core.exception.ConnectionException;
import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
import com.huaweicloud.sdk.core.exception.ServiceResponseException;
import com.huaweicloud.sdk.vpcep.v1.region.VpcepRegion;
import com.huaweicloud.sdk.vpcep.v1.*;
import com.huaweicloud.sdk.vpcep.v1.model.*;


public class ListServiceDescribeDetailsSolution {

    public static void main(String[] args) {
        // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
        // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
        String ak = System.getenv("CLOUD_SDK_AK");
        String sk = System.getenv("CLOUD_SDK_SK");

        ICredential auth = new BasicCredentials()
                .withAk(ak)
                .withSk(sk);

        VpcepClient client = VpcepClient.newBuilder()
                .withCredential(auth)
                .withRegion(VpcepRegion.valueOf("<YOUR REGION>"))
                .build();
        ListServiceDescribeDetailsRequest request = new ListServiceDescribeDetailsRequest();
        request.withEndpointServiceName("<endpoint_service_name>");
        request.withId("<id>");
        try {
            ListServiceDescribeDetailsResponse response = client.listServiceDescribeDetails(request);
            System.out.println(response.toString());
        } catch (ConnectionException e) {
            e.printStackTrace();
        } catch (RequestTimeoutException e) {
            e.printStackTrace();
        } catch (ServiceResponseException e) {
            e.printStackTrace();
            System.out.println(e.getHttpStatusCode());
            System.out.println(e.getRequestId());
            System.out.println(e.getErrorCode());
            System.out.println(e.getErrorMsg());
        }
    }
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# coding: utf-8

from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkvpcep.v1.region.vpcep_region import VpcepRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkvpcep.v1 import *

if __name__ == "__main__":
    # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak = __import__('os').getenv("CLOUD_SDK_AK")
    sk = __import__('os').getenv("CLOUD_SDK_SK")

    credentials = BasicCredentials(ak, sk) \

    client = VpcepClient.new_builder() \
        .with_credentials(credentials) \
        .with_region(VpcepRegion.value_of("<YOUR REGION>")) \
        .build()

    try:
        request = ListServiceDescribeDetailsRequest()
        request.endpoint_service_name = "<endpoint_service_name>"
        request.id = "<id>"
        response = client.list_service_describe_details(request)
        print(response)
    except exceptions.ClientRequestException as e:
        print(e.status_code)
        print(e.request_id)
        print(e.error_code)
        print(e.error_msg)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package main

import (
	"fmt"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
    vpcep "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/vpcep/v1"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/vpcep/v1/model"
    region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/vpcep/v1/region"
)

func main() {
    // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak := os.Getenv("CLOUD_SDK_AK")
    sk := os.Getenv("CLOUD_SDK_SK")

    auth := basic.NewCredentialsBuilder().
        WithAk(ak).
        WithSk(sk).
        Build()

    client := vpcep.NewVpcepClient(
        vpcep.VpcepClientBuilder().
            WithRegion(region.ValueOf("<YOUR REGION>")).
            WithCredential(auth).
            Build())

    request := &model.ListServiceDescribeDetailsRequest{}
	endpointServiceNameRequest:= "<endpoint_service_name>"
	request.EndpointServiceName = &endpointServiceNameRequest
	idRequest:= "<id>"
	request.Id = &idRequest
	response, err := client.ListServiceDescribeDetails(request)
	if err == nil {
        fmt.Printf("%+v\n", response)
    } else {
        fmt.Println(err)
    }
}

For SDK sample code of more programming languages, see the Sample Code tab in API Explorer. SDK sample code can be automatically generated.

Status Codes

Status Code

Description

200

The server has successfully processed the request.

Error Codes

See Error Codes.