Querying Customer's Yearly/Monthly Resources
Function
A customer can query one or all yearly/monthly resources on the partner sales platform.

If you need to renew resources that already take effect after you successfully invoke this API, you can invoke the API described in Querying the Price of a Yearly/Monthly Product to query the price for the yearly/monthly resources and then invoke the API described in Renewing Subscription to Yearly/Monthly Resources to renew the subscription.
Constraints
- This API can be invoked using the customer AK/SK or token only.
- This API queries resources successfully provisioned only.
URI
POST /v2/orders/suscriptions/resources/query
Request
Request Parameters
Parameter |
Mandatory |
Type |
Value Range |
Description |
---|---|---|---|---|
resource_ids |
No |
list<String> |
Maximum value: 50 |
Resource IDs. Queries resources with the specified resource IDs. When only_main_resource is 0, the system queries the specified resources and their auxiliary resources. A maximum of 50 IDs can be queried at the same time. Use commas (,) to separate multiple IDs. NOTE:
A resource ID is allocated by a cloud service after the resource is provisioned, such as server_id in ECS. |
order_id |
No |
String |
A maximum 64 characters |
Order ID. This parameter can be used for querying the resources in a specified order. NOTE:
When special characters are used for query, perform the URL code conversion. For example, % should be converted to %25. |
only_main_resource |
No |
Integer |
0, 1 |
Whether to query only the primary resources. This parameter is invalid when resource_ids are IDs of attached resources. In this case, the system queries the attached resources.
The default value is 0. NOTE:
A primary resource takes the primary position in the associated resources.
|
status_list |
No |
list<Integer> |
Maximum value: 10 |
Resource status. Queries resources in a specified status. If there are multiple statuses, separate them using commas (,).
|
offset |
No |
Integer |
0 to maximum integer |
Offset, starting from 0. The default value is 0. NOTE:
This parameter is used for pagination. Retain its default value 0 if pagination is not required. offset indicates the offset relative to the first data record among all that meets the conditions configured. If you set offset to 1, the second and subsequent data records are returned. For example, there are 10 data records, and if you set limit to 10 and offset to 1, the second to the tenth data records are returned. |
limit |
No |
Integer |
1 to 500 |
Number of records queried each time. The default value is 10. |
expire_time_begin |
No |
String |
20 |
Used to query the list of expired resources in a specified period. The value is in UTC format. |
expire_time_end |
No |
String |
20 |
Used to query the list of expired resources in a specified period. The value is in UTC format. |
Example Request
POST https://bss-intl.myhuaweicloud.com/v2/orders/suscriptions/resources/query HTTP/1.1 Content-Type: application/json X-Auth-Token: MIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ { "resource_ids":[ "0A063A********BC8548E65D0089A905" ], "order_id":"CS1905251035OA***", "only_main_resource":1, "status_list":[ 2 ], "offset":0, "limit":10, "expire_time_begin":"2021-09-01T08:05:01Z", "expire_time_end":"2021-09-03T08:05:01Z" }
Response
Response Parameters
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. For details, see Returned Values. |
error_msg |
String |
Error description. |
data |
List<OrderInstanceV2> |
Resource list. For details, see Table 2. |
total_count |
Integer |
Total number of records |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Internal ID of the resource to be provisioned. The ID generated after the resource is provisioned is resource_id. |
resource_id |
String |
Resource ID. |
resource_name |
String |
Resource instance name. |
region_code |
String |
Cloud service region code, for example, cn-north-1. Obtain the value from the Region column in Regions and Endpoints. |
service_type_code |
String |
Cloud service type code. For example, the cloud service type code of OBS is hws.service.type.obs. To obtain a specific service type, call the API in Querying Cloud Service Types. |
resource_type_code |
String |
Resource type code. For example, the VM resource type code of ECS is hws.resource.type.vm. To obtain a specific resource type, call the API in Querying Resource Types. |
resource_spec_code |
String |
Specification of a cloud service resource. For example, a VM resource specification is s2.small.1.linux (.win or .linux should be added at the end of the specification). |
project_id |
String |
Resource project ID. |
product_id |
String |
Product ID. |
parent_resource_id |
String |
Parent resource ID |
is_main_resource |
Integer |
Primary resource or not.
|
status |
Integer |
Resource status.
|
effective_time |
String |
Effective time of a resource. UTC time in "yyyy-MM-dd'T'HH:mm:ss'Z'" format, such as 2019-05-06T08:05:01Z |
expire_time |
String |
Expiration time of a resource. UTC time in "yyyy-MM-dd'T'HH:mm:ss'Z'" format, such as 2019-05-06T08:05:01Z |
expire_policy |
Integer |
Billing policy after a resource expires.
NOTE:
Only 3 indicates that the resource is automatically renewed. In other cases, the expiration policy for non-automatic renewal is used. |
Example Response
HTTP/1.1 200 OK Content-Type: application/json;charset=UTF-8 Content-Length: length Date: response time { "data": [ { "id": "01154-54600027-0", "resource_id": "0A063A11905F42BC8548E65D0089A905", "resource_name": "0A063A11905F42BC8548E65D0089A905name", "region_code": "cn-south-1", "service_type_code": "hws.service.type.ebs", "resource_type_code": "hws.resource.type.volume", "resource_spec_code": "SSD", "project_id": "1dd89a5fe99e4cca80edca61e737477a", "product_id": "2fd338aca5ae4a01aac81deaa900e441", "parent_resource_id": "9ad02e1ad3394d1bb3da48890fbc4c06", "is_main_resource": 1, "status": 2, "effective_time": "2020-05-03T09:11:10Z", "expire_time": "2020-06-03T09:11:10Z", "expire_policy": 0 } ], "total_count": 1 }
