Querying Resource Specifications of a Cloud Service Type
Function
This API is used to query resource specifications of a cloud service type on the customer self-built platform.
- This API returns only the resource specifications 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-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 | Yes | 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: N/A Range: 1–64 Default Value: N/A |
| resource_type | Yes | 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: N/A 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 |
| charge_mode | Yes | String | Definition: Billing mode. Constraints: N/A Range:
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 |
| marker | No | String | Definition: Pagination information, which is obtained from the pagination query information returned in the last API call. Constraints:
Range: [0-128] Default Value: N/A |
| limit | No | Integer | Definition: Number of records returned on each page in a pagination query. Constraints: N/A Range: 1–100 Default Value: 100 |
| 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 supported. Only prefix matching, suffix matching, and contains (infix) matching are supported. Constraints: N/A Range: [1-128] Default Value: N/A |
Example Request
POST https://bss-intl.myhuaweicloud.com/v2/products/resource-specs-query HTTP/1.1
Content-Type: application/json
X-Auth-Token: MIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ
X-Language: en_US
{
"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",
"charge_mode": "3",
"marker": null,
"limit": 100
} Response
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code. For details, see Returned Values. 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 |
| cloud_service_basics | List<CloudServiceBasic> | Definition: List of resource specifications. 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 of 128 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 of 200 characters |
| charge_mode | String | Definition: Billing mode. Range:
|
| region_code | String | Definition: Cloud service region code, for example, ap-southeast-1. Range: A maximum of 64 characters |
Example Response
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"
},
"cloud_service_basics": [
{
"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",
"charge_mode": "3",
"region_code": "ap-southeast-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 |
|---|---|---|
| 403 | CBC.0151 | Access denied. |
| 500 | CBC.0999 | Other errors. |
| 400 | CBC.0100 | Parameter error. |
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