Querying the Resource Usage
Function
Customers can query the resource usage on the partner sales platform.
Constraints
This API can be invoked only by the customer AK/SK or token.
URI
POST /v2/payments/free-resources/usages/details/query
Parameter |
Mandatory |
Maximum Length of Characters |
Description |
---|---|---|---|
X-Language |
Yes |
A maximum of 8 characters |
Language.
Default value: zh_CN |
Request
Request Parameters
Parameter |
Mandatory |
Type |
Value Range |
Description |
---|---|---|---|---|
free_resource_ids |
Yes |
List<string> |
A maximum of 100 records |
List of resource item IDs. Each ID contains a maximum of 64 bytes. Resource ID. A resource package contains multiple resources, and a resource has a usage type. The resource ID is obtained from the response of the API in Querying Resource Packages. |
Example Request
POST https://bss-intl.myhuaweicloud.com/v2/payments/free-resources/usages/details/query HTTP/1.1 Content-Type: application/json X-Auth-Token: MIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ { "free_resource_ids": [ "d4463497-991b-439d-9ab6-23f9ed197fe9" ] }
Response
Response Parameters
Parameter |
Type |
Maximum Length of Characters |
Description |
---|---|---|---|
error_code |
String |
20 |
Error code. For details, see Returned Values. This parameter is returned only when the query failed. |
error_msg |
String |
1000 |
Error description. This parameter is returned only when the query failed. |
free_resources |
List<FreeResourceDetail> |
- |
Resource information (resource details) in a resource package. For details, see Table 2. |
Parameter |
Type |
Maximum Length of Characters |
Description |
---|---|---|---|
free_resource_id |
String |
A maximum of 64 characters |
Resource ID. A resource package contains multiple resources, and a resource has a usage type. |
free_resource_type_name |
String |
- |
Resource type name. |
quota_reuse_cycle |
Integer |
- |
Reset period. This parameter is valid only when quota_reuse_mode is set to 1 (Resettable).
|
quota_reuse_cycle_type |
Integer |
- |
Reset period type. This field is valid only when quota_reuse_mode is set to 1 (Resettable).
|
usage_type_name |
String |
- |
Usage type name. |
start_time |
String |
- |
Start time. The value is in UTC format.
|
end_time |
String |
- |
End time. The value is in UTC format.
|
amount |
BigDecimal |
- |
Remaining resource quota of a package whose quota_reuse_mode is Resettable, that is, the remaining resource quota in the current reset period. |
original_amount |
BigDecimal |
- |
Original resource quota of a package whose quota_reuse_mode is Resettable, that is, the total resource quota in each reset period. |
measure_id |
Integer |
- |
Measurement unit of the quota of a free resource package. Call the API in Querying Measurement Units to obtain the value. |
Example Response
HTTP/1.1 200 OK Content-Type: application/json;charset=UTF-8 Content-Length: length Date: response time { "free_resources": [ { "free_resource_id": "d4463497-991b-439d-9ab6-23f9ed197fe9", "free_resource_type_name": "test1", "quota_reuse_cycle": 4, "quota_reuse_cycle_type": 1, "usage_type_name": "Duration", "start_time": "2021-04-30T03:30:56Z", "end_time": "2021-05-31T15:59:59Z", "amount": 100, "original_amount": 100, "measure_id": 37 } ] }
