All Products
Search
Document Center

Resource Management:GetExampleQuery

Last Updated:Jan 15, 2026

Queries the information about a sample query template.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

QueryId

string

Yes

The ID of the template.

Note

You can call the ListExampleQueries operation to obtain the template ID.

sq-0PfKy****

Response elements

Element

Type

Description

Example

object

The returned result.

ExampleQuery

object

The information about the sample query template.

Description

string

The description of the template.

返回所有有权限的资源,并按照资源类型和资源ID排列。

Expression

string

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;

Name

string

The name of the template.

列出所有阿里云资源

QueryId

string

The ID of the template.

sq-0PfKy****

RequestId

string

The request ID.

36A3D9BE-B607-5993-B546-7E19EF65DC00

Examples

Success response

JSON format

{
  "ExampleQuery": {
    "Description": "返回所有有权限的资源,并按照资源类型和资源ID排列。",
    "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": "列出所有阿里云资源",
    "QueryId": "sq-0PfKy****"
  },
  "RequestId": "36A3D9BE-B607-5993-B546-7E19EF65DC00"
}

Error codes

HTTP status code

Error code

Error message

Description

409 NotExists.QueryId The QueryId does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.