Performing an Advanced Query on a Specific Aggregator
Function
This API is used to perform an advanced query on a specific aggregator.
Calling Method
For details, see Calling APIs.
URI
POST /v1/resource-manager/domains/{domain_id}/aggregators/{aggregator_id}/run-query
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| domain_id | Yes | String | Specifies tags. Maximum: 36 |
| aggregator_id | Yes | String | Specifies the resource aggregator ID. Maximum: 32 |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Security-Token | No | String | Security token (session token) for temporary security credentials. This parameter is mandatory when you make an API call using temporary security credentials. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| expression | Yes | String | Specifies the ResourceQL expression. Minimum: 1 Maximum: 4096 |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| query_info | QueryInfo object | Specifies the ResourceQL query field. |
| results | Array of objects | Specifies the ResourceQL query result. |
| Parameter | Type | Description |
|---|---|---|
| select_fields | Array of strings | Specifies the ResourceQL query field. |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Specifies the error code. |
| error_msg | String | Specifies the error message. |
Status code: 403
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Specifies the error code. |
| error_msg | String | Specifies the error message. |
Status code: 500
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Specifies the error code. |
| error_msg | String | Specifies the error message. |
Example Requests
Querying all ECS IDs in the current organization
POST https://{endpoint}/v1/resource-manager/domains/{domain_id}/aggregators/{aggregator_id}/run-query
{
"expression" : "select id from aggregator_resources where provider = 'ecs' and type = 'cloudservers'"
} Example Responses
Status code: 200
Operation succeeded.
{
"query_info" : {
"select_fields" : [ "id" ]
},
"results" : [ {
"id" : "91252cc9-bfd9-0709-0912-56b397e0ba3f"
} ]
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Operation succeeded. |
| 400 | Invalid parameters. |
| 403 | Authentication failed or you do not have the operation permissions. |
| 500 | Server error. |
Error Codes
See Error Codes.
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