All Products
Search
Document Center

MaxCompute:ListComputeMetricsByInstance

Last Updated:Sep 18, 2026

Lists job compute usage at the instance level.

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:ListComputeMetricsByInstance

list

*All Resource

*

None None

Request syntax

POST /api/v1/computeMetrics/listByInstance HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request body parameters.

projectNames

array

No

The project name.

string

No

The project name.

odps_porject

startDate

integer

No

The start date. This value is a UNIX timestamp in milliseconds.

1715393576201

endDate

integer

No

The end date. This value is a UNIX timestamp in milliseconds.

1718590596556

instanceId

string

No

The job ID.

20240730****ddlr

jobOwner

string

No

The job owner.

ALIYUN$7632***@aliyun.com

signature

string

No

The SQL job signature.

ghijkl789012

pageNumber

integer

No

The page number.

1

pageSize

integer

No

The number of entries per page. Default value: 10.

10

types

array

No

The metering types.

string

No

The metering type. Valid values:

  • ComputationSql: metering data of SQL jobs that operate on internal tables.

  • ComputationSqlOTS: metering data of SQL jobs that operate on OTS external tables.

  • ComputationSqlOSS: metering data of SQL jobs that operate on OSS external tables.

  • MapReduce: metering data of MapReduce jobs.

  • spark: metering data of Spark jobs.

  • mars: metering data of Mars jobs.

SQL

specCodes

array

No

The specification types.

string

No

The specification type. Valid values:

  • OdpsStandard: the pay-as-you-go billing method Standard Edition.

  • OdpsSpot: the pay-as-you-go billing method Off-peak Edition.

OdpsStandard

Response elements

Element

Type

Description

Example

object

The response. Example: { "data":{ "instanceComputeMetrics":[ { "unit":"GBCplx", "instanceId":"20260415082755g4af3vobxio", "submitTime":1776241680, "specCode":"OdpsStandard", "signature":"4c504210645f7850cf847c17886bf", "usage":0.8054948877543211, "jobOwner":"RAM$1393348188455728:role/aliyunservicerolefomputemms", "endTime":1776241682, "type":"ComputationSql", "projectName":"dbs_mc" }, { "unit":"GBCplx", "instanceId":"202604150828258gv9abz7unq14", "submitTime":1776241707, "specCode":"OdpsStandard", "signature":"cacb1e31deb**c19e515b59634a", "usage":0.1720797186717391, "jobOwner":"ALIYUN$mc_ma_testcloud_com", "endTime":1776241707, "type":"ComputationSql", "projectName":"webui_139728_hangzhou" } ], "pageNumber":1, "pageSize":10, "totalCount":2808 }, "requestId":"0adb99df17763408113761151d0001" }

requestId

string

The request ID.

0bc059b717363029839908920ea631

httpCode

integer

The HTTP status code. Valid values:

  • 1xx: Informational response. The request has been received and is being processed.

  • 2xx: Success. The request has been successfully received, understood, and accepted by the server.

  • 3xx: Redirection. The request is redirected, and further action is required to complete the request.

  • 4xx: Client error. The request contains invalid parameters, bad syntax, or specific request conditions cannot be fulfilled.

  • 5xx: Server error. The server cannot fulfill the request due to other reasons.

200

data

object

The response data.

instanceComputeMetrics

array<object>

The list of pay-as-you-go job compute usage.

object

instanceId

string

The job ID.

20240730****ddlr

type

string

The metering type. Valid values:

  • ComputationSql: metering data of SQL jobs that operate on internal tables.

  • ComputationSqlOTS: metering data of SQL jobs that operate on OTS external tables.

  • ComputationSqlOSS: metering data of SQL jobs that operate on OSS external tables.

  • MapReduce: metering data of MapReduce jobs.

  • spark: metering data of Spark jobs.

  • mars: metering data of Mars jobs.

ComputationSql

specCode

string

The specification type. Valid values:

  • OdpsStandard: the pay-as-you-go billing method Standard Edition.

  • OdpsSpot: the pay-as-you-go billing method Off-peak Edition.

OdpsStandard

jobOwner

string

The job owner.

ALIYUN$7632***@aliyun.com

projectName

string

The project name.

odps_porject

submitTime

integer

The job submit time. This value is a UNIX timestamp in milliseconds.

1610432000000

endTime

integer

The job end time. This value is a UNIX timestamp in milliseconds.

1710432000000

signature

string

The SQL job signature.

pqrs12345tuv

usage

number

The compute usage.

  • For scan-based billing types, the unit is GB. This includes the ComputationSql, ComputationSqlOTS, and ComputationSqlOSS billing types, which are billed based on the amount of data scanned. The compute usage is calculated as the scan volume × complexity for each job. The complexity for ComputationSqlOTS and ComputationSqlOSS types is fixed at 1.

  • For CU-hour-based billing types, the unit is CU-hours. This includes the MapReduce, spark, and mars billing types, which are billed based on CU-hours.

1024

unit

string

The unit of compute usage.

GB

totalCount

integer

The total number of entries returned.

64

pageNumber

integer

The current page number.

1

pageSize

integer

The number of entries per page.

10

Examples

Success response

JSON format

{
  "requestId": "0bc059b717363029839908920ea631",
  "httpCode": 200,
  "data": {
    "instanceComputeMetrics": [
      {
        "instanceId": "20240730****ddlr",
        "type": "ComputationSql",
        "specCode": "OdpsStandard",
        "jobOwner": "ALIYUN$7632***@aliyun.com",
        "projectName": "odps_porject",
        "submitTime": 1610432000000,
        "endTime": 1710432000000,
        "signature": "pqrs12345tuv",
        "usage": 1024,
        "unit": "GB"
      }
    ],
    "totalCount": 64,
    "pageNumber": 1,
    "pageSize": 10
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.