PushMeteringData

更新时间:
复制 MD 格式

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.

      • Storage: The storage space used, in bytes.

      • NetworkOut: The outbound data transfer, in bits.

      • NetworkIn: The inbound data transfer, in bits.

      • 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 for a complete list.

Release notes

See Release Notes for a complete list.