更新时间:2024-02-27 GMT+08:00
分享

查询账号配额

功能介绍

该接口可以用于查询账号配额。

该接口可以使用全局区域的Endpoint和其他区域的Endpoint调用。IAM的Endpoint请参见:地区和终端节点

调试

您可以在API Explorer中调试该接口。

URI

GET /v3.0/OS-QUOTA/domains/{domain_id}

表1 路径参数

参数

是否必选

参数类型

描述

domain_id

String

待查询的账号ID,获取方式请参见:获取账号、IAM用户、项目、用户组、区域、委托的名称和ID

表2 Query参数

参数

是否必选

参数类型

描述

type

String

查询配额的类型,取值范围如下。

  • user:IAM用户配额
  • group:用户组配额
  • idp:身份提供商配额
  • agency:委托配额
  • policy:自定义策略配额
  • assigment_group_mp:一个用户组基于IAM项目可绑定的权限配额
  • assigment_agency_mp:一个委托可绑定的权限配额
  • assigment_group_ep:一个用户组基于企业项目可绑定的权限配额
  • assigment_user_ep:一个用户基于企业项目可绑定的权限配额
  • mapping:账号中所有身份提供商映射规则配额

请求参数

表3 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

IAM用户的token。(无需特殊权限。)

响应参数

状态码为 200 时:

表4 响应Body参数

参数

参数类型

描述

quotas

Object

账号配额信息。

表5 quotas

参数

参数类型

描述

resources

Array of objects

资源信息。

表6 resources

参数

参数类型

描述

max

Integer

配额最大值。

min

Integer

配额最小值。

quota

Integer

当前配额。

type

String

配额类型。

used

Integer

已使用的配额。

其中身份提供商映射规则mapping已使用数量为用户自行设置,暂不返回。

请求示例

查询账号配额。

GET https://iam.myhuaweicloud.com/v3.0/OS-QUOTA/domains/{domain_id}

响应示例

状态码为 200 时:

请求成功。

{ 
  "quotas" : { 
    "resources" : [ 
               { 
                  "max" : 1000, 
                  "min" : 50, 
                  "quota" : 50, 
                  "type" : "user", 
                  "used" : 10 
                }, 
               { 
                  "max" : 300, 
                  "min" : 10, 
                  "quota" : 20, 
                  "type" : "group", 
                  "used" : 8 
                }, 
               { 
                  "max" : 20, 
                  "min" : 10, 
                  "quota" : 10, 
                  "type" : "idp", 
                  "used" : 9 
                },
               { 
                  "max" : 300, 
                  "min" : 10, 
                  "quota" : 50, 
                  "type" : "agency", 
                  "used" : 12 
                }, 
               { 
                  "max" : 300, 
                  "min" : 128, 
                  "quota" : 200, 
                  "type" : "policy", 
                  "used" : 8 
                },
               { 
                  "max" : 500, 
                  "min" : 50, 
                  "quota" : 200, 
                  "type" : "assigment_group_mp", 
                  "used" : 8 
                },
               { 
                  "max" : 500, 
                  "min" : 50, 
                  "quota" : 200, 
                  "type" : "assigment_agency_mp", 
                  "used" : 8 
                },
               { 
                  "max" : 5000, 
                  "min" : 50, 
                  "quota" : 500, 
                  "type" : "assigment_group_ep", 
                  "used" : 8 
                },
               { 
                  "max" : 5000, 
                  "min" : 50, 
                  "quota" : 500, 
                  "type" : "assigment_user_ep", 
                  "used" : 8 
                },
               { 
                  "max" : 100, 
                  "min" : 10, 
                  "quota" : 10, 
                  "type" : "mapping", 
                  "used" : null 
                }
             ] 
            } 
}

状态码为 400 时:

参数无效。

{
  "error_msg" : "Request parameter %(key)s is invalid.",
  "error_code" : "IAM.0007"
}

状态码为 403 时:

没有操作权限。

  • 示例 1
{ 
   "error_msg" : "You are not authorized to perform the requested action.", 
   "error_code" : "IAM.0002" 
 }
  • 示例 2
{ 
   "error_msg" : "Policy doesn't allow %(actions)s to be performed.", 
   "error_code" : "IAM.0003" 
 }

状态码为 404 时:

未找到相应的资源。

{ 
  "error_msg" : "Could not find %(target)s: %(target_id)s.", 
  "error_code" : "IAM.0004" 
}

状态码为 500 时:

内部服务错误。

{ 
  "error_msg" : "An unexpected error prevented the server from fulfilling your request.", 
  "error_code" : "IAM.0006" 
}

状态码

状态码

描述

200

请求成功。

400

参数无效。

401

认证失败。

403

没有操作权限。

404

未找到相应的资源。

500

内部服务错误。

错误码

请参见错误码

分享:

    相关文档

    相关产品