All Products
Search
Document Center

MaxCompute:ListComputeMetricsByInstance

Last Updated:Jun 16, 2025
This topic is generated by a machine translation engine without any human intervention. ALIBABA CLOUD DOES NOT GUARANTEE THE ACCURACY OF MACHINE TRANSLATED CONTENT. To request a human-translated version of this topic or provide feedback on this translation, please include it in the feedback form.

Queries a list of computing resources used by a pay-as-you-go job.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
odps:ListComputeMetricsByInstancelist
*All Resources
*
    none
none

Request syntax

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

Request parameters

ParameterTypeRequiredDescriptionExample
bodyobjectNo

Request body parameters.

regionstringNo

The region ID.

cn-hangzhou
projectNamesarrayNo

The name of MaxCompute project.

projectNamestringNo

The name of MaxCompute project.

odps_porject
startDatelongNo

The start time for the period.

1715393576201
endDatelongNo

The end time for the period.

1718590596556
instanceIdstringNo

The job(instance) ID.

20240730****ddlr
jobOwnerstringNo

The Alibaba Cloud account that is used to run the MaxCompute job.

ALIYUN$7632***@aliyun.com
signaturestringNo

The signature of the SQL job.

ghijkl789012
pageNumberlongNo

The page number.

1
pageSizelongNo

The number of entries per page.

10
typesarrayNo

Metering types.

typestringNo

Metering types.

  • ComputationSql: the metering data of SQL jobs that involve internal tables.

  • ComputationSqlOTS: the metering data of SQL jobs that involve Tablestore external tables.

  • ComputationSqlOSS: the metering data of SQL jobs that involve OSS external tables.

  • MapReduce: the metering data of MapReduce jobs.

  • spark: the metering data of Spark jobs.

  • mars: the metering data of Mars jobs.

SQL
specCodesarrayNo

Specification types.

specCodestringNo

Specifications Type specifies the resource package that you select when you purchase the MaxCompute service.

  • OdpsStandard: the pay-as-you-go resource package.

  • OdpsSpot: the pay-as-you-go spot resource package.

OdpsStandard

Response parameters

ParameterTypeDescriptionExample
object

PopResult<ListResultDTO<InstanceComputeMetricDTO, DefaultPageInfo>>

requestIdstring

The ID of the request.

0bc059b717363029839908920ea631
httpCodeinteger

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 or syntaxes, or specific request conditions cannot be met.
  • 5xx: server error. The server cannot meet requirements due to other reasons.
200
errorCodestring

The error code.

OBJECT_NOT_EXIST
errorMsgstring

The error message.

This object does not exist.
dataobject

The data returned.

instanceComputeMetricsarray<object>

List of pay-as-you-go job compute usage.

instanceComputeMetricsobject
instanceIdstring

The job(instance) ID.

20240730****ddlr
typestring

Metering types.

  • ComputationSql: the metering data of SQL jobs that involve internal tables.

  • ComputationSqlOTS: the metering data of SQL jobs that involve Tablestore external tables.

  • ComputationSqlOSS: the metering data of SQL jobs that involve OSS external tables.

  • MapReduce: the metering data of MapReduce jobs.

  • spark: the metering data of Spark jobs.

  • mars: the metering data of Mars jobs.

ComputationSql
specCodestring

Specifications Type, specifies the resource package that you select when you purchase the MaxCompute service.

  • OdpsStandard: the pay-as-you-go resource package.

  • OdpsSpot: the pay-as-you-go spot resource package.

OdpsStandard
jobOwnerstring

The owner of the job.

ALIYUN$7632***@aliyun.com
projectNamestring

The name of the project.

odps_porject
submitTimelong

The submission time of the job.

1610432000000
endTimelong

The end time of the job execution.

1710432000000
signaturestring

The signature of the SQL job.

pqrs12345tuv
usagedouble

The computing resource usage is calculated based on the following items:

  • Amount of scanned data in the unit of GB. For the jobs whose metering types are ComputationSql, ComputationSqlOTS, or ComputationSqlOSS, they are billed based on the amount of scanned data. The computing resource usage of such a job is calculated by using the following formula: Amount of scanned data × Complexity. The complexity is fixed at 1 for the jobs whose metering types are ComputationSqlOTS or ComputationSqlOSS.

  • CU-hours. For the jobs whose metering types are MapReduce, spark, or mars, they are billed based on CU-hours.

1024
unitstring

The unit of computing resource usage

GB
totalCountlong

The total number of results returned.

64
pageNumberlong

The current page number.

1
pageSizelong

The number of entries per page.

10

Examples

Sample success responses

JSONformat

{
  "requestId": "0bc059b717363029839908920ea631",
  "httpCode": 200,
  "errorCode": "OBJECT_NOT_EXIST",
  "errorMsg": "This object does not exist.",
  "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

For a list of error codes, visit the Service error codes.