All Products
Search
Document Center

Resource Management:GetExampleQuery

Last Updated:Jun 28, 2024

Queries the information about a sample query template.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
QueryIdstringYes

The ID of the template.

Note You can call the ListExampleQueries operation to obtain the template ID.
sq-0PfKy****

Response parameters

ParameterTypeDescriptionExample
object

The returned result.

RequestIdstring

The request ID.

36A3D9BE-B607-5993-B546-7E19EF65DC00
ExampleQueryobject

The information about the sample query template.

QueryIdstring

The ID of the template.

sq-0PfKy****
Expressionstring

The query statement in the template.

SELECT resource_id, resource_name, region_id, zone_id, resource_type, account_id, create_time, resource_group_id, tags, ip_addresses, vpc_id, v_switch_id FROM resources ORDER BY resource_type, resource_id LIMIT 1000 OFFSET 0;
Namestring

The name of the template.

Query of All Alibaba Cloud Resources
Descriptionstring

The description of the template.

Queries all resources on which you have permissions and sorts the resources by resource type and resource ID.

Examples

Sample success responses

JSONformat

{
  "RequestId": "36A3D9BE-B607-5993-B546-7E19EF65DC00",
  "ExampleQuery": {
    "QueryId": "sq-0PfKy****",
    "Expression": "SELECT\n  resource_id,\n  resource_name,\n  region_id,\n  zone_id,\n  resource_type,\n  account_id,\n  create_time,\n  resource_group_id,\n  tags,\n  ip_addresses,\n  vpc_id,\n  v_switch_id\nFROM\n  resources\nORDER BY\n  resource_type,\n  resource_id\nLIMIT\n  1000 OFFSET 0;",
    "Name": "Query of All Alibaba Cloud Resources",
    "Description": "Queries all resources on which you have permissions and sorts the resources by resource type and resource ID. "
  }
}

Error codes

HTTP status codeError codeError messageDescription
409NotExists.QueryIdThe QueryId does not exist.The specified query template ID does not exist.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history