Help Center> Cloud Stream Service> API Reference> APIs> APIs Related to Cluster Management> Obtaining User Quota Information About a Tenant

Obtaining User Quota Information About a Tenant

Function

This API allows tenants to query user quota information. The following parameters are involved in this API: name, order, cursor, next, and limit.

Table 1 Parameter description

Parameter

Description

name

Cluster name.

cursor

User ID.

next

Whether to switch to the previous or next page.

limit

Number of returned data records.

order

Query result display. Value asc indicates that the query results are displayed in ascending order, and value desc indicates that the query results are displayed in descending order.

URI

  • URI format

    GET /v1.0/{project_id}/user_quotas

  • Parameter description
    Table 2 URI parameter description

    Parameter

    Mandatory

    Description

    project_id

    Yes

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

Request

None

Response

  • Example response
    {
      "message_id": "CS.21093",
      "message": "Querying of the user quota list succeeds.",
      "payload": {
        "total": 2,
        "users": [
          {
            "user_id": "ac4eaa303639409c8ab099d55eb1538e",
            "user_name": "cs-testuser1",
            "spu_used": 0,
            "spu_quota": 1000,
            "clusters": []
          },
          {
            "user_id": "5138c47cbd3a408ebc997b7791aab411",
            "user_name": "cs-testuser",
            "spu_used": 6,
            "spu_quota": 1000,
            "clusters": [
              {
                "id": 1002703,
                "name": "opsadmtest_cluster"
              },
              {
                "id": 1002684,
                "name": "cs_standalone_tsq"
              },
              {
                "id": 1002640,
                "name": "test-wt"
              },
              {
                "id": 1002444,
                "name": "test-issue-nodel"
              }
            ]
          }
        ],
      "current_time": 1533867744575
     }
    }
  • Parameter description
    Table 3 Response parameters

    Parameter

    Mandatory

    Type

    Description

    message_id

    No

    String

    Message type ID.

    message

    No

    String

    Message content.

    current_time

    No

    Int

    Current time, expressed by milliseconds.

    payload

    No

    None

    User quota information.

    total

    No

    Int

    Number of user quota query results.

    users

    No

    Int

    User quota information.

    user_id

    No

    String

    User ID.

    user_name

    No

    String

    Username.

    spu_used

    No

    Int

    SPU quota used by a user.

    spu_quota

    No

    Int

    Maximum SPU quota of a user.

    clusters

    No

    None

    User cluster.

    id

    No

    Int

    Cluster ID.

    name

    No

    String

    Cluster name.

Status Code

Table 4 describes the status code.

Table 4 Status code

Status Code

Description

200

Querying user quota information about a tenant succeeds.

400

The input parameters are invalid.

Error Code

For details, see Error Codes.