Querying RES Quotas

Function

This API is used to query the resource quotas of RES.

URI

GET /v1/{project_id}/quota?type={type}

Table 1 describes the URI parameters.
Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID, which is used for resource isolation. For details about how to obtain the project ID, see Obtaining a Project ID.

type

Yes

String

Type of the resource whose quota is to be queried. The value can be infer_service or infer_flow.

Request

N/A

Response

Table 2 describes the response parameters.

Table 2 Response parameters

Parameter

Type

Description

is_success

Boolean

Whether the request is successful

quotas

object

Table 3 describes the details of resource quotas.

error_code

String

Error code that indicates a request has failed. This parameter is unavailable when a request is successful.

error_msg

String

Error message that indicates a request has failed. This parameter is unavailable when a request is successful.

Table 3 quotas parameters

Parameter

Type

Description

resources

List<Resource>

Table 4 describes the resource parameters.

Table 4 Resource response parameters

Parameter

Type

Description

type

Boolean

Resource type

quota

String

Quota information

unit

String

Unit of the quota

min

Integer

Minimum quota

max

Integer

Maximum quota

used

Integer

Used quota

Example

  • Example of a successful response
    {
        "is_success": true,
        "quotas": {
            "resources": [
                {
                    "type": "infer_service",
                    "quota": "9",
    "unit": "",
                    "min": 1,
                    "max": 100,
                    "used": 9
                }
            ]
        }
    }
  • Example of a failed response
    {
        "is_success": false,
        "error_code": "res.8004",
        "error_msg": "Default quota(infer_service) is null."
    }

Status Code

For details about status codes, see Status Codes.