Updated on 2024-04-15 GMT+08:00

Querying the Quota

Function

This API is used to query the quota of your resources, including VPC endpoint services and VPC endpoints.

URI

GET /v1/{project_id}/quotas?type={resource_type}

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.

Table 2 Query parameter

Parameter

Mandatory

Type

Description

type

No

String

Specifies the resource type.

  • endpoint_service: indicates the VPC endpoint service.
  • endpoint: indicates the VPC endpoint.

Request

  • Parameter description

    None

  • Example request

    This request is to query the quota of VPC endpoint services.

    GET https://{endpoint}/v1/{project_id}/quotas?type=endpoint_service

Response

  • Parameter description
    Table 3 Response parameter

    Parameter

    Type

    Description

    quotas

    Object

    Specifies quota details. For details, see Table 4.

    Table 4 Quotas parameter

    Parameter

    Type

    Description

    resources

    Array of objects

    Lists the resources. For details, see Table 5.

    Table 5 Resource parameters

    Parameter

    Type

    Description

    type

    String

    Specifies the resource type. You can query the quota of resources of a specified type by configuring this parameter.

    • endpoint_service: indicates the VPC endpoint service.
    • endpoint: indicates the VPC endpoint.

    used

    Integer

    Specifies the number of created resources.

    The value ranges from 0 to the value of quota.

    quota

    Integer

    Specifies the maximum quota of resources.

    The value ranges from the default quota value to the maximum quota value.

  • Example response
    {
    "quotas":{
         "resources":[
                     {
                         "type":"endpoint",
                         "used":4,
                         "quota":150
                    },
                     {
                         "type":"endpoint_service",
                         "used":10,
                         "quota": 100
                    }
                  ]
            }
    }

Status Codes

See Status Codes.