GetQuotaUsage

Updated at:

Queries quota resource consumption information.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

odps:GetQuotaUsage

get

*Quota

acs:odps:{#regionId}:{#accountId}:quotas/{#nickName}

None None

Request syntax

GET /api/v1/quotas/{nickname}/usage HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

nickname

string

Yes

The alias of the level-1 quota.

os_quota_p

Request parameters

Parameter

Type

Required

Description

Example

tenantId

string

No

The ID of the tenant. You can log on to the MaxCompute console, and choose Tenants > Tenant Property from the left-side navigation pane to view the tenant ID.

478403690625249

region

string

No

The region ID.

cn-chengdu

from

integer

Yes

The time when the query starts. The value is the log time that is specified when log data is written.

  • The time range that is specified in this operation is a left-closed, right-open interval. The interval includes the start time specified by the from parameter, but does not include the end time specified by the to parameter. If you set the from and to parameters to the same value, the time range is invalid and an error message is returned.

  • This value is a UNIX timestamp representing the number of seconds that have elapsed since January 1, 1970, 00:00:00 UTC.

1669081045

to

integer

Yes

The time when the query ends. The value is the log time that is specified when log data is written.

  • The time range that is specified in this operation is a left-closed, right-open interval. The interval includes the start time specified by the from parameter, but does not include the end time specified by the to parameter. If you set the from and to parameters to the same value, the time range is invalid and an error message is returned.

  • This value is a UNIX timestamp representing the number of seconds that have elapsed since January 1, 1970, 00:00:00 UTC.

1669360870

subQuotaNickname

string

No

The alias of the level-2 quota.

ot_tunnel_quota

aggMethod

string

No

The aggregation algorithm. For a better page experience, up to 60 points can be displayed for each metric. If you select a time range longer than 1 hour, the chart uses the average value within the range (minutes of the selected time range/60) to aggregate data by default. You can change the aggregation algorithm based on your business requirements.

max

productId

string

No

The quota type. Default value: ODPS.

  • ODPS: computing quota

  • TUNNEL: Tunnel quota

ODPS

plotTypes

array

No

The types of the charts.

string

No

The type of the chart.

When productId is set to ODPS, this parameter is optional and has the following valid values:

  • cpu: CPU resources.

  • memory: memory resources. If this parameter is not configured, both metrics are returned.

When productId is set to TUNNEL, this parameter is required and has the following valid values:

  • request: the request parallelism.

  • throughput: the throughput.

  • error: the number of error requests.

cpu

yAxisTypes

array

No

The data metric fields.

string

No

The data metric field.

You do not need to specify this parameter if the productId parameter is set to ODPS.

You can enter a project name when productId is set to TUNNEL. In this case, the returned result is the information of the project dimension.

your_project_name

Response elements

Element

Type

Description

Example

object

The response parameters.

requestId

string

The request ID.

0b87b7a416652014358483492eea0b

httpCode

integer

The HTTP status code.

  • 1xx: informational response. The request is received and is being processed.

  • 2xx: success. The request is successfully received, understood, and accepted by the server.

  • 3xx: redirection. The request is redirected, and further actions are required to complete the request.

  • 4xx: client error. The request contains invalid request parameters and syntaxes, or specific request conditions cannot be met.

  • 5xx: server error. The server cannot meet requirements due to other reasons.

200

errorCode

string

The error code.

OBJECT_NOT_EXIST

errorMsg

string

The error message.

This object does not exist.

data

object

The data returned.

metrics

object

The metric results.

plot

array<object>

The information about the chart.

object

The information about the chart.

title

string

The title of the chart.

request

type

string

The type of the chart.

request

yAxis

array

The data metric field.

string

The data metric field.

If the productId parameter is set to ODPS: CPU metric type or memory metric type

If the productId parameter is set to TUNNEL and a project name is entered: project#operation#type

project1#download#request

Examples

Success response

JSON format

{
  "requestId": "0b87b7a416652014358483492eea0b",
  "httpCode": 200,
  "errorCode": "OBJECT_NOT_EXIST",
  "errorMsg": "This object does not exist.",
  "data": {
    "metrics": {
      "test": "test",
      "test2": 1
    },
    "plot": [
      {
        "title": "request",
        "type": "request",
        "yAxis": [
          "project1#download#request"
        ]
      }
    ]
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.