Viewing Resource Package Usage
Function
Customers can query the resource package usage on the self-built platform by resource.
Customers can log in to Billing center and go to My Packages. Click the Resource Packages tab, and then the resource package name to view the resource usage.
Constraints
This API can be invoked only by the customer AK/SK or token.
If a resource package has expired for more than 18 months, its information cannot be queried.
You can debug the API in API Explorer which supports automatic authentication. API Explorer can automatically generate and debug example SDK code.
URI
POST /v2/payments/free-resources/usages/details/query
Parameter |
Mandatory |
Value Range |
Description |
---|---|---|---|
X-Language |
No |
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 } ] }
Returned Values
- 4xx: This class of HTTP status code is intended for situations in which the error seems to have been caused by the client, for example, the request contains bad syntax or incorrect parameters. You must ensure the request is correct.
- 5xx: This class of HTTP status code is intended for cases in which the Huawei Cloud server is aware that it has encountered an error or is otherwise incapable of performing the request. In this case, contact Huawei Cloud customer service.
HTTP Status Code |
Error Code |
Description |
---|---|---|
400 |
CBC.0100 |
Incorrect parameter. |
403 |
CBC.0151 |
Access denied. |
500 |
CBC.0999 |
Other errors. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot