All Products
Search
Document Center

Resource Management:Use a custom query template to query resources

Last Updated:Sep 08, 2026

This topic describes how to create a custom query template and use the custom query template to query resources.

Step 1: Select a query scope

Set a query scope to narrow your search and get more relevant results.

  1. Log in to the Resource Center console.

  2. In the navigation pane on the left, choose Resource Center > Advanced Search.

  3. In the Query Scope section, click Change Query Scope.

  4. Click the target node to select a query scope.

    • If cross-account resource search is disabled for your Alibaba Cloud account, you can query resources within the current account or a specific resource group.

    • If you are using the management account of a Resource Directory with cross-account resource search enabled, you can query within the current account or across accounts.

      • Current account: Query the entire current account or a specific resource group.

      • Cross-account: Query the entire Resource Directory, a specific folder, a member account, or a resource group.

Step 2: Create a custom query template

  1. Log on to the Resource Management console.

  2. In the left-side navigation pane, choose Resource Center > Advanced Search.

  3. In the code editor on the Temporary _Query_1 tab, write a query statement. To use a new tab, click the + icon.

    Query statements must follow the Basic SQL syntax.

    The following features are available to help you write query statements:

    • Auto-fill: The Resource Property pane lists supported cloud services, resource types, and properties. Click an item to add it as a query condition.

    • Code hinting and auto-completion: The code editor suggests keywords and properties as you type to help you complete the query statement.

  4. Click Run to run the query and verify the results.

  5. Click Save to save the query statement as a query template.

Note

You can also modify a sample or existing custom query template and click Save As to save it as a new custom query template.

Step 3: Execute the custom query template

  1. On the Quick Start tab, find the custom query template that you created in the Custom Query Template section.

  2. On the desired custom query template, click Open.

  3. In the code editor in the upper part of the Advanced page, view the query statement in the custom query template.

  4. Click Run.

Step 4: View and download the query result

Click the Query Result tab to view the results.

View results in a list

On the List tab, view the query results. Turn on the format switch in the upper-right corner to convert some property IDs into human-readable names.

The results list includes columns such as resource ID, resource name, region, availability zone, resource type, member account, creation time, resource group, tag, and IP address.

View results in a chart

If a query returns two columns — one with strings and one with numbers — you can visualize the data on the Chart tab. Click the 设置.jpg icon in the upper-right corner and select Pie or Bar to display the data as a pie or bar chart.

Pie chart

image.png

Bar chart

image.png

Download the query results

Export list results as a CSV file. You can choose between two formats:

  • Formatted data: Data converted into a more readable format.

  • Unformatted data: The raw text from the query results.

After downloading, use a data analysis tool for further processing and insights.