Executes an SQL statement to query resources across accounts.
Debugging
Authorization information
There is currently no authorization information disclosed in the API.
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
Expression | string | Yes | The SQL statement to be executed. The number of characters in the SQL statement must be less than 2,000. For more information about the SQL syntax, see Basic SQL syntax. | SELECT * FROM resources LIMIT 100; |
Scope | string | Yes | The search scope. The value of this parameter can be one of the following items:
For more information about how to obtain the ID of a resource directory, the Root folder, a folder, a member, or a resource group, see GetResourceDirectory , ListFoldersForParent , ListFoldersForParent , ListAccounts , or ListResourceGroups . | rd-r4**** |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "44C8A952-D6B0-5BC8-82D5-93BA02E26F2E",
"Columns": [
{
"Name": "resource_id",
"Type": "varchar"
}
],
"Rows": [
"[\n \"vsw-xxx“\n]"
]
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | NoPermission | You are not authorized to perform this operation. | You are not authorized to perform the operation. |
404 | NotExists.ResourceDirectory | The resource directory for the account is not enabled. | No resource directory is enabled for the account. |
404 | NotExists.ResourceDirectory.FolderId | The specified folder does not exist. | The specified folder does not exist. |
409 | ExceedLimit.ExecuteTime | The execution time has exceeded the limit. Please check for complex queries or large data volume, and optimize accordingly. | The time consumed for the query exceeds the limit. Check and optimize the complexity of or data size in the SQL statement. |
409 | SQLExecuteError | Failed to execute the SQL statement. | Failed to perform the query. Check whether the query statement is correct. |
409 | InvalidSearch.SQL | Error: %s | Error: %s |
409 | InvalidParameter.Scope | The Scope is invalid. | The Scope parameter is invalid |
409 | ServiceNotEnabled.SpecifiedAccount | ResourceCenter service of the specified account is not enabled. | The Resource Center service is not activated for the specified account. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
2024-05-29 | The Error code has changed | see changesets | ||||||||
|