All Products
Search
Document Center

MaxCompute:GetQuotaUsage - 获取Quota资源消耗信息

Last Updated:Aug 20, 2026

获取Quota资源消耗信息

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

一级 Quota 昵称。

os_quota_p

Request parameters

Parameter

Type

Required

Description

Example

tenantId

string

No

租户 ID。可以通过登录 MaxCompute 控制台,在左侧导航栏选择租户管理>租户属性查看。

478403690625249

region

string

No

地域 ID。

cn-chengdu

from

integer

Yes

查询开始时间点。该时间是指写入日志数据时指定的日志时间。

  • 请求参数 fromto 定义的时间区间遵循左闭右开原则,即该时间区间包括区间开始时间点,但不包括区间结束时间点。如果 fromto 的值相同,则为无效区间,函数直接返回错误。

  • Unix 时间戳格式,表示从 1970-1-1 00:00:00 UTC 计算起的秒数。

1669081045

to

integer

Yes

查询结束时间点。该时间是指写入日志数据时指定的日志时间。

  • 请求参数 fromto 定义的时间区间遵循左闭右开原则,即该时间区间包括区间开始时间点,但不包括区间结束时间点。如果 fromto 的值相同,则为无效区间,函数直接返回错误。

  • Unix 时间戳格式,表示从 1970-1-1 00:00:00 UTC 计算起的秒数。

1669360870

subQuotaNickname

string

No

二级 Quota 昵称。

ot_tunnel_quota

aggMethod

string

No

聚合算法。当获取计算 Quota 计算资源消耗数据时,为优化页面体验,每个指标至多支持展示 60 个点,因此当时间范围大于 1h 时,图表默认使用区间范围内(所选时间范围的分钟数/60)的平均值聚合数据,您可以根据自身需求更改聚合算法。

max

productId

string

No

Quota 类型。默认为 odps。

  • ODPS:计算 Quota;

  • TUNNEL:数据传输服务 Quota。

ODPS

plotTypes

array

No

图表类型。

string

No

图表类型。

当 productId 为 ODPS 时支持参数:

  • cpu:CPU 资源;

  • memory:内存资源; 不填表示两个指标均需返回。

当 productId 为 TUNNEL 时必须填写参数,枚举值:

  • request:请求并发数;

  • throughput:吞吐量;

  • error:错误请求数。

cpu

yAxisTypes

array

No

数据指标字段。

string

No

数据指标字段。

当 productId 为 ODPS 时无需填写。

当 productId 为 TUNNEL 时支持填入 project 名称,此时返回的结果是项目维度的信息。

your_project_name

Response elements

Element

Type

Description

Example

object

请求返回参数。

requestId

string

请求 ID。

0b87b7a416652014358483492eea0b

httpCode

integer

HTTP 状态码。

  • 1xx:信息响应 - 请求已接收,正在处理中。

  • 2xx:成功 - 请求动作已被服务端成功接收、理解并接受。

  • 3xx:重定向 - 请求被重定向,采取进一步行动以完成请求。

  • 4xx:客户端错误 - 请求包含错误请求参、语法或特定请求条件无法满足。

  • 5xx:服务端错误 - 服务器由于其他原因无法满足请求。

200

errorCode

string

错误码。

OBJECT_NOT_EXIST

errorMsg

string

错误描述信息。

This object does not exist.

data

object

请求返回结果。

metrics

object

指标结果。

"timestamps": [1668046140000, 1668065220000], //毫秒 "project1#upload#request": [10, 20], "project1#download#request": [20, 30], "project1#upload#throughput": [50, 50], "project1#download#throughput": [60, 70], "pro2#errorNum": [5, 10]

plot

array<object>

图表信息。

object

图表信息。

title

string

图表标题。

项目请求并发数

type

string

图表类型。

request

yAxis

array

数据指标字段。

string

数据指标字段。

当 productId 为 ODPS 时: cpu 具体类型 memory 具体类型

当 productId 为 TUNNEL 且填入 project 名称时: 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": "项目请求并发数",
        "type": "request",
        "yAxis": [
          "project1#download#request"
        ]
      }
    ]
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.