All Products
Search
Document Center

Compute Nest:PushMeteringData

Last Updated:Oct 23, 2025

This API pushes metering data for pay-as-you-go Compute Nest service instances. The metering items must be predefined by the service provider.

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

computenestsupplier:PushMeteringData

none

*ServiceInstance

acs:computenestsupplier:{#regionId}:{#accountId}:serviceinstance/{#ServiceInstanceId}

None None

Request parameters

Parameter

Type

Required

Description

Example

Metering

string

Yes

The parameters are described as follows:

  • InstanceId: The ID of the Alibaba Cloud Marketplace instance. The parameter type is String.

  • StartTime: The start time of the metering. The unit is seconds. The format is a UNIX timestamp. The parameter type is Long.

  • EndTime: The end time of the metering. The unit is seconds. The format is a UNIX timestamp. The parameter type is Long.

  • Entities: The metering entity object. The parameter type is List<Map>.

    • Key: The name of the metering item property. The parameter type is String.
      • Frequency: The number of times used.

      • Period: The usage duration in seconds. Note: The duration in the request parameter is measured in seconds, but the billing unit is hours. The duration is converted to hours for billing. For example, if you push a usage of 1800 for the period from 19:00 to 20:00 and the price is USD 1/hour, the hourly bill for this period is 1800 / 3600 × 1 = USD 0.5. If the fee is a decimal, it is truncated to two decimal places.

      • Storage: The storage space used, in bytes. Note: The unit in the request parameter is bytes, but the billing unit is MB. The value is converted to MB for billing. For example, if you push a usage of 524288 for the period from 19:00 to 20:00 and the price is USD 1/MB, the hourly bill for this period is 524288 / 1024 / 1024 × 1 = USD 0.5. If the fee is a decimal, it is truncated to two decimal places.

      • NetworkOut: The outbound data transfer, in bits. Note: The unit in the request parameter is bits, but the billing unit is Mb. The value is converted to Mb for billing. For example, if you push a usage of 524288 for the period from 19:00 to 20:00 and the price is USD 1/Mb, the hourly bill for this period is 524288 / 1024 / 1024 × 1 = USD 0.5. If the fee is a decimal, it is truncated to two decimal places.

      • NetworkIn: The inbound data transfer, in bits. Note: The unit in the request parameter is bits, but the billing unit is Mb. The value is converted to Mb for billing. For example, if you push a usage of 524288 for the period from 19:00 to 20:00 and the price is USD 1/Mb, the hourly bill for this period is 524288 / 1024 / 1024 × 1 = USD 0.5. If the fee is a decimal, it is truncated to two decimal places.

      • Character: The number of characters.

      • DailyActiveUser: The number of daily active users (DAU).

      • PeriodMin: The usage duration in minutes.

      • VirtualCpu: The number of vCPU cores.

        • Unit: The number of units.

        • Memory: The memory size in GB.

    • Value: The metering value. The value must be greater than or equal to 0. The parameter type is Integer.

Note:

  • For products with real-time billing, the interval between StartTime and EndTime can be of any length. EndTime must be later than StartTime.

  • For products that are not billed in real-time, such as those billed by the hour, day, or month, the interval between StartTime and EndTime must be longer than 5 minutes.

  • When pushing metering data in batches, the InstanceId property must be for instances of the same product. Pushing data for instances of multiple products at the same time is not supported.

[{\"StartTime\":1681264800,\"EndTime\":1681268400,\"Entities\":[{\"Key\":\"Unit\",\"Value\":\"0\"}]}]

ServiceInstanceId

string

Yes

The service instance ID.

si-0e6fca6a51a54420****

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

94E89857-B994-44B6-9C4F-DBD200E9XXXX

Examples

Success response

JSON format

{
  "RequestId": "94E89857-B994-44B6-9C4F-DBD200E9XXXX"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.