查询资源目录管理账号和多个成员中的资源数量。
接口说明
仅能搜索支持资源中心的云服务及资源类型。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
 调试
        
            调试
        
    
授权信息
| 操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 | 
| resourcecenter:GetMultiAccountResourceCounts | get | *全部资源 
 | 无 | 无 | 
请求参数
| 名称 | 类型 | 必填 | 描述 | 示例值 | 
| GroupByKey | string | 否 | 资源数量统计的分组维度。取值: 
 说明 
 如果不传,则返回满足条件的资源总数。 | ResourceType | 
| Filter | array<object> | 否 | 过滤条件。 | |
| object | 否 | 过滤条件。 | ||
| Key | string | 否 | 过滤条件键。取值见下方 | RegionId | 
| MatchType | string | 否 | 匹配方式。 取值为 Equals,表示相等匹配。 | Equals | 
| Value | array | 否 | 过滤条件值。 | |
| string | 否 | 过滤条件值。 | cn-shanghai | |
| Scope | string | 否 | 搜索的账号范围。取值: 
 关于如何获取资源目录 ID、Root 资源夹 ID、资源夹 ID 和成员 ID,请参见 GetResourceDirectory 、 ListFoldersForParent 、 ListAccounts 。 | rd-r4**** | 
支持的过滤参数
| 参数 | 描述 | 支持的匹配类型 | 
| ResourceType | 资源类型。 | Equals | 
| RegionId | 地域 ID。 | Equals | 
| ResourceId | 资源 ID。 | Equals、Prefix | 
| ResourceGroupId | 资源组 ID。 | Equals、Exists、NotExists | 
| ResourceName | 资源名称。 | Equals、Contains | 
| Tag | 标签键值对。 JSON 格式为  | Contains、NotContains、NotExists | 
| VpcId | VPC ID。 | Equals | 
| VSwitchId | 交换机 ID。 | Equals | 
返回参数
| 名称 | 类型 | 描述 | 示例值 | 
| object | 返回参数。 | ||
| Filters | array<object> | 过滤条件。 | |
| object | 过滤条件。 | ||
| Key | string | 过滤条件键。 | RegionId | 
| Values | array | 过滤条件值。 | |
| string | 过滤条件值。 | cn-shanghai | |
| GroupByKey | string | 资源统计的分组维度。 | ResourceType | 
| RequestId | string | 请求 ID。 | EFA806B9-7F36-55AB-8B7A-D680C2C5EE57 | 
| ResourceCounts | array<object> | 资源数量列表。 | |
| object | 资源数量。 | ||
| Count | integer | 资源数量。 | 2 | 
| GroupName | string | 分组名称。 | ACS::ECS::NetworkInterface | 
| Scope | string | 搜索的账号范围。取值: 
 关于如何获取资源目录 ID、Root 资源夹 ID、资源夹 ID 和成员 ID,请参见 GetResourceDirectory 、 ListFoldersForParent 、 ListAccounts 。 | rd-r4**** | 
示例
正常返回示例
JSON格式
{
  "Filters": [
    {
      "Key": "RegionId",
      "Values": [
        "cn-shanghai"
      ]
    }
  ],
  "GroupByKey": "ResourceType",
  "RequestId": "EFA806B9-7F36-55AB-8B7A-D680C2C5EE57",
  "ResourceCounts": [
    {
      "Count": 2,
      "GroupName": "ACS::ECS::NetworkInterface"
    }
  ],
  "Scope": "rd-r4****"
}错误码
| HTTP status code | 错误码 | 错误信息 | 描述 | 
|---|---|---|---|
| 400 | NoPermission | You are not authorized to perform this operation. | |
| 400 | MultiAccountServiceNotEnabled | Multi account ResourceCenter service is not enabled. | |
| 400 | InvalidParameter.Filter.ResourceType | The specified parameter value of Filter.ResourceType is not valid. | |
| 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 | InvalidParameter.Scope | The Scope is invalid. | |
| 409 | NoPermission.ResourceDirectory.MemberAccount | ResourceDirectory Member Account is not authorized to perform this operation. | |
| 409 | ServiceNotEnabled.SpecifiedAccount | ResourceCenter service of the specified account is not enabled. | 
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。