调用PushMeteringData推送计量数据。
- 目前不支持子账号调用该接口。
- 请求参数全部需要URLEncode编码。
- 云市场对每个InstanceId的请求限制为60秒一次,每次请求支持写入的计量数据为100条。
- 不支持跨商品的InstanceId批量推送,批量推送时请确保所有InstanceId来自同一个商品。
- 按小时出账的商品,截止出账时间是下一个小时,计量数据必须按时推送过来。比如推送的计量数据是8:10-08:20, 则必须在9.59之前将计量数据推送过来,否则将不会出账。按天出账规则类似,即第二天必须要把前一天的数据推送过来,否则不会出账。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | PushMeteringData | 系统规定参数。取值:PushMeteringData。 |
Metering | String | 否 | [{"InstanceId":"1000001","StartTime":"100000000","EndTime":"100000010","Entities":[{"Key":"PeriodMin","Value":"96","meteringAssit":"cmapi00060317-PeriodMin-4"}]}] | 示例中的参数说明如下:
说明:
|
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Success | Boolean | true | 成功状态标识 |
RequestId | String | 6EF60BEC-0242-43AF-BB20-270359FB54A7 | 请求ID |
示例
请求示例
http(s)://market.aliyuncs.com/?Action=PushMeteringData
&Metering=%5B%7B%22InstanceId%22%3A%221000001%22%2C%22StartTime%22%3A%22100000000%22%2C%22EndTime%22%3A%22100000010%22%2C%22Entities%22%3A%5B%7B%22Key%22%3A%22Frequency%22%2C%22Value%22%3A%2296%22%7D%5D%7D%5D
&<公共请求参数>
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<PushMeteringDataResponse>
<RequestId>6EF60BEC-0242-43AF-BB20-270359FB54A7</RequestId>
<Success>true</Success>
</PushMeteringDataResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "6EF60BEC-0242-43AF-BB20-270359FB54A7",
"Success" : "true"
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
500 | UnknownError | An error occurred while processing your request. | 未知错误 |
500 | Service.Flow.Control | The rate throttling threshold has been exceeded. | 请求超过流控限制 |
500 | Invalid.Parameter | The specified parameter is invalid. | 请求参数错误 |
500 | Invalid.Parameter.Instance | The specified Instance parameter is invalid. | Instance 参数请求错误 |
500 | Invalid.Parameter.Metering | The specified Metering parameter is invalid. | Metering 参数请求错误 |
500 | Metering.Data.Exceeded | The number of metering entities must not exceed 100. | Metering entities 不能超过 100 个 |
500 | Permission.Denied | You are not authorized to call the API operation. Contact the API developer to add your account to the API user whitelist. | 没有调用权限,请联系接口负责人添加白名单 |
访问错误中心查看更多错误码。