Querying the Package Usage (Old)
Function
A customer can query the package usage on the self-built platform.
This API will be taken offline. For details about the new API for querying the usage in a package, see Querying Resource Packages and Querying the Package Usage.
Constraints
This API can be invoked only using the AK/SK or token of the customer.
URI
POST /v2/payments/free-resources/usages/query
Parameter |
Mandatory |
Value Range |
Description |
---|---|---|---|
X-Language |
No |
A maximum of 8 characters |
Language.
If this parameter is not included in the request parameters or is left empty, the value en_US is used. This parameter cannot be set to "" or null. |
Request
Request Parameters
N/A
Example Request
POST https://bss-intl.myhuaweicloud.com/v2/payments/free-resources/usages/query HTTP/1.1 Content-Type: application/json X-Auth-Token: MIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ
Response
Response Parameters
Parameter |
Type |
Value Range |
Description |
---|---|---|---|
error_code |
String |
A maximum of 20 characters |
Error code. For details, see Returned Values. This parameter is returned only when the query failed. |
error_msg |
String |
A maximum of 1000 characters |
Error description. This parameter is returned only when the query failed. |
package_usage_infos |
list<PackageUsageInfo> |
- |
Package usage. For details, see Table 2. |
Parameter |
Type |
Value Range |
Description |
---|---|---|---|
order_instance_id |
String |
A maximum of 255 characters |
Identifier of a subscribed resource package. |
resource_type_name |
String |
A maximum of 255 characters |
Resource type. |
quota_reuse_mode |
Integer |
- |
Use model. The options are as follows:
|
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). If quota_reuse_mode is set to resettable and the value of quota_reuse_cycle_type is null, the quota is reset by calendar period by default.
|
start_time |
String |
A maximum of 64 characters |
Start time. The value is in UTC format.
|
end_time |
String |
A maximum of 64 characters |
End time. The value is in UTC format.
|
balance |
Number |
- |
Remaining resources in a package. |
total |
Number |
- |
Total number of resources in a package. |
measurement_name |
String |
A maximum of 255 characters |
Measurement unit name of a package resource. |
region_code |
String |
A maximum of 255 characters |
Cloud service region code, for example, ap-southeast-1. Obtain the value from the Region column in Regions and Endpoints. |
Example Response
HTTP/1.1 200 OK Content-Type: application/json;charset=UTF-8 Content-Length: length Date: response time { "package_usage_infos": [ { "order_instance_id": "01154-119701448-0", "resource_type_name": "cdn.cdn.flow", "quota_reuse_mode": 1, "quota_reuse_cycle": 1, "quota_reuse_cycle_type": 1, "start_time": "2019-12-26T02:00:00Z", "end_time": "2019-12-26T02:24:11Z", "balance": 100, "total": 100, "measurement_name": "Byte", "region_code": "global-cbc-1" } ] }
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 |
---|---|---|
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