Querying Resource Specifications and Prices of a Cloud Service Type
Function
This API is used to query resource specifications and prices of a cloud service type on the customer self-built platform.
- This API returns only the resource specifications and prices of available cloud service types on Huawei Cloud.
- Parameters marker and limit are used for pagination query. These two parameters take effect only when they are used together.
Constraints
This API can be invoked using the customer AK/SK or token.
Debugging
You can debug the API in API Explorer which supports automatic authentication. API Explorer can automatically generate and debug example SDK code.
Authorization
This API does not require authorization.
URI
POST /v2/products/resource-specs-price/query
| Parameter | Mandatory | Description |
|---|---|---|
| X-Language | No | Definition: Language. Constraints: N/A Range:
Default Value: en_US |
Request
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| cloud_service_type | No | String | Definition: 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. Constraints: If this parameter is not included in the request parameters or is set to null, it cannot be used as a filter criterion. Range: 1–64 Default Value: N/A |
| resource_type | No | String | Definition: 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. Constraints: If this parameter is not included in the request parameters or is set to null, it cannot be used as a filter criterion. Range: 1–64 Default Value: N/A |
| region_code | Yes | String | Definition: Cloud service region code, for example, ap-southeast-1. Obtain the value from the Region column in Regions and Endpoints. Constraints: N/A Range: 1–64 Default Value: N/A |
| filters | No | List<Filter> | Definition: Filter. For details, see Table 2. Constraints: If this parameter is not included in the request parameters, is left empty, or is set to null, it cannot be used as a filter criterion. Range: 0–1 Default Value: N/A |
| need_attributes | No | boolean | Definition: Whether to return the attributes of resource specifications. Constraints: N/A Range:
Default Value: false |
| need_price | No | boolean | Definition: Whether to return the list prices of resource specifications. Constraints: N/A Range:
Default Value: false |
| marker | No | String | Definition: Pagination information, which is obtained from the pagination query information returned in the last API call. Constraints:
Range: 1–256 Default Value: N/A |
| limit | No | Integer | Definition: Number of records returned on each page in a pagination query. Constraints: N/A Range: 1–50 Default Value: 50 |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| key | Yes | String | Definition: Key of a filter condition. Constraints: N/A Range:
Default Value: N/A |
| value | Yes | String | Definition: Value of the filter condition. Fuzzy search is not supported. Constraints: N/A Range: 1–256 If key is set to CHARGING_MODE, the options are as follows:
Default Value: N/A |
Example Request
POST https://bss-intl.myhuaweicloud.com/v2/products/resource-specs-price/query HTTP/1.1
Content-Type: application/json
X-Auth-Token: MIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ
X-Language: zh_CN
{
"cloud_service_type": "hws.service.type.ec2",
"resource_type": "hws.resource.type.vm",
"filters": [
{
"key": "RESOURCE_SPEC",
"value": "ac3.2xlarge.4.linux"
}
],
"region_code": "ap-southeast-1",
"need_attributes": true,
"need_price": true,
"marker": null,
"limit": 50
} Response
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code. For details, see Status Codes. This parameter is returned only when the query failed. Range: A maximum of 20 characters |
| error_msg | String | Definition: Error description. This parameter is returned only when the query failed. Range: A maximum of 1,000 characters |
| page_info | PageInfo Object | Definition: Pagination query information. For details, see Table 3. Range: N/A |
| region_code | String | Definition: Cloud service region code, for example, ap-southeast-1. Range: A maximum of 64 characters |
| resource_spec_infos | List<ResourceSpecInfo> | Definition: Resource specifications of a cloud service type. For details, see Table 4. Range: N/A |
| Parameter | Type | Description |
|---|---|---|
| next_marker | String | Definition: Backward pagination identifier. This serves as the starting marker for the next page of data. If a value is present, it indicates that a subsequent page exists; if null, it indicates that there is no further data available. Range: A maximum 256 characters |
| Parameter | Type | Description |
|---|---|---|
| cloud_service_type | String | Definition: Cloud service type code. Range: A maximum of 64 characters |
| cloud_service_type_name | String | Definition: Cloud service type name. Range: A maximum of 200 characters |
| resource_type | String | Definition: Resource type code. For example, the resource type code of ECS is hws.resource.type.vm. Range: A maximum of 64 characters |
| resource_type_name | String | Definition: Resource type name. Range: A maximum of 200 characters |
| resource_spec | String | Definition: Resource specification code of the cloud service type. Range: A maximum of 200 characters |
| resource_spec_name | String | Definition: Resource specification name of the cloud service type. Range: A maximum 256 characters |
| attributes | List<Attribute> | Definition: Attributes of resource specifications of the cloud service type. If need_attributes is set to true, the attributes are returned. For details, see Table 5. Range: N/A |
| price_lists | List<PriceItem> | Definition: Prices of resource specifications of the cloud service type. If need_price is set to true, the prices are returned. For details, see Table 7. Range: N/A |
| Parameter | Type | Description |
|---|---|---|
| code | String | Definition: Attribute code. Range: A maximum of 128 characters |
| name | String | Definition: Attribute name. Range: A maximum of 1,024 characters |
| value | String | Definition: Attribute value. Range: A maximum of 200 characters |
| unit | String | Definition: Attribute unit. Range: A maximum of 64 characters |
| linear_range | Object LinearRange | Definition: Linear attribute range. For details, see Table 6. Range: N/A |
| Parameter | Type | Description |
|---|---|---|
| min | Integer | Definition: Minimum value of a linear attribute. Range: N/A |
| max | Integer | Definition: Maximum value of a linear attribute. Range: N/A |
| step | Integer | Definition: Step of a linear attribute. Range: N/A |
| Parameter | Type | Description |
|---|---|---|
| offering_id | String | Definition: Offering ID. Range: A maximum of 64 characters |
| currency | String | Definition: Currency. Range: USD If the parameter is left blank, USD is used. |
| official_price | String | Definition: List price effective when the query is performed. Range: A maximum of 64 characters |
| charging_mode | String | Definition: Billing mode. Range:
|
| period_type | Integer | Definition: Sales period type. Range:
|
| period_nums | List<Integer> | Definition: Number of sales periods. Range: N/A |
| billing_usage_factor | String | Definition: Billing factor. Range: A maximum of 64 characters |
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: length
Date: response time
{
"page_info": {
"next_marker": "c3ne.xlarge.2.linux"
},
"region_code": "ap-southeast-1",
"resource_spec_infos": [
{
"cloud_service_type": "hws.service.type.ec2",
"cloud_service_type_name": "Elastic Cloud Server",
"resource_type": "hws.resource.type.vm",
"resource_type_name": "Cloud Host",
"resource_spec": "ac3.2xlarge.4.linux",
"resource_spec_name": "ARM Enhaced General Computing|ac3.2xlarge.4|8vCPUs|29GB|linux",
"attributes": [
{
"code": "etryy",
"name": "Memory",
"value": "8",
"unit": "GB",
"linear_range": {
"min": 1,
"max": 5,
"step": 1
}
}
],
"price_lists": [
{
"offering_id": "OFF-003",
"currency": "USD",
"official_price": "300.00",
"charging_mode": "PERIOD",
"period_type": 3,
"period_nums": [1,2,3],
"billing_usage_factor": "TRAFFIC_GB"
}
]
}
]
} Status Codes
- 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 |
|---|---|---|
| 403 | CBC.0151 | Access denied. |
| 500 | CBC.0999 | Other errors. |
| 400 | CBC.0100 | Parameter error. |
What is your overall rating for this page?
Thank 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