使用SQL查询跨账号的资源。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
resourcecenter:ExecuteMultiAccountSQLQuery |
list |
*全部资源
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| Expression |
string |
是 |
待执行 SQL 语句。 待执行 SQL 语句长度小于 2000 个字符。 关于 SQL 语法的更多信息,请参见 SQL 基本语法。 |
SELECT * FROM resources LIMIT 100; |
| Scope |
string |
是 |
搜索的账号范围。取值:
关于如何获取资源目录 ID、Root 资源夹 ID、资源夹 ID、成员 ID 和资源组 ID,请分别参见 GetResourceDirectory 、 ListFoldersForParent 、 ListFoldersForParent 、 ListAccounts 和 ListResourceGroups 。 |
rd-r4**** |
| MaxResults |
integer |
否 |
每页的最大数据条数。 取值范围:1~1000。 默认值:1000。 |
1000 |
| NextToken |
string |
否 |
查询返回结果下一页的令牌。 当返回结果数据总条数超过 |
eyJzZWFyY2hBZnRlcnMiOlsiMTAwMTU2Nzk4MTU1OSJd**** |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
返回参数。 |
||
| Columns |
array<object> |
列信息。 |
|
|
object |
列信息。 |
||
| Name |
string |
列名。 |
resource_id |
| Type |
string |
列类型。 |
varchar |
| MaxResults |
integer |
每页的最大数据条数。 |
1000 |
| NextToken |
string |
查询返回结果下一页的令牌。 |
eyJzZWFyY2hBZnRlcnMiOlsiMTAwMTU2Nzk4MTU1OSJd**** |
| RequestId |
string |
请求 ID。 |
44C8A952-D6B0-5BC8-82D5-93BA02E26F2E |
| Rows |
array |
搜索结果数组。 |
|
|
any |
结果行信息。 |
[ "vsw-xxx“ ] |
示例
正常返回示例
JSON格式
{
"Columns": [
{
"Name": "resource_id",
"Type": "varchar"
}
],
"MaxResults": 1000,
"NextToken": "eyJzZWFyY2hBZnRlcnMiOlsiMTAwMTU2Nzk4MTU1OSJd****\n",
"RequestId": "44C8A952-D6B0-5BC8-82D5-93BA02E26F2E",
"Rows": [
"[\n \"vsw-xxx“\n]"
]
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | NoPermission | You are not authorized to perform this operation. | |
| 403 | NoPermission.AccountScope | The operator is not permitted for this account scope. | 当前用户未授权操作此资源目录账号范围。 |
| 404 | NotExists.ResourceDirectory | The resource directory for the account is not enabled. | 当前账号未开通资源目录。 |
| 404 | NotExists.ResourceDirectory.FolderId | 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. | |
| 409 | SQLExecuteError | Failed to execute the SQL statement. | |
| 409 | InvalidSearch.SQL | Error: %s | |
| 409 | InvalidParameter.Scope | The Scope is invalid. | |
| 409 | ServiceNotEnabled.SpecifiedAccount | ResourceCenter service of the specified account is not enabled. | |
| 409 | InvalidParameter.NextToken | The specified parameter NextToken is not valid. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。