
# 查询配额 - ShowResourceQuota
#### 功能介绍
查询指定租户下的弹性伸缩组、伸缩配置、伸缩带宽策略、伸缩策略和伸缩实例的配额总数及已使用配额数。
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/AS/doc?api=ShowResourceQuota)中调试该接口。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-as/as_07_0200.html)。
- 如果使用身份策略授权，需具备如下身份策略权限。
  
  | 授权项            | 访问级别 | 资源类型（\*为必须） | 条件键 | 别名            | 依赖的授权项 |
  |:---|:---|:---|:---|:---|:---|
  | as::listQuotas | read | -           | -   | as:quotas:get | -      |
     
  
 
#### URI
GET /autoscaling-api/v1/{project_id}/quotas
表1参数说明 
| 参数         | 是否必选 | 参数类型   | 描述   |
|:---|:---|:---|:---|
| project_id | 是    | String | 项目ID |
   
#### 请求参数
无
#### 请求示例
查询租户下弹性伸缩组，伸缩配置，伸缩带宽策略，伸缩策略和伸缩实例配额的总数及已使用配额数。
```
GET https://{Endpoint}/autoscaling-api/v1/{project_id}/quotas
```
#### 响应参数
表2响应参数 
| 参数     | 参数类型                                             | 描述                                                            |
|:---|:---|:---|
| quotas | [quotas] object | 配额详情。详情请见[表 quotas字段数据结构说明]。 |
   
 表3quotas字段数据结构说明 
| 参数        | 参数类型                                                     | 描述                                                            |
|:---|:---|:---|
| resources | Array of [resources] objects | 配额资源列表。详情请见[表 resources字段数据结构说明]。 |
   
 表4resources字段数据结构说明 
| 参数    | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
|:---|:---|:---|
| type  | String  | 查询配额的类型。 - scaling_Group：伸缩组配额。  - scaling_Config：伸缩配置配额。  - scaling_Policy：伸缩策略配额。  - scaling_Instance：伸缩实例配额。  - bandwidth_scaling_policy：伸缩带宽策略配额。   |
| used  | Integer | 已使用的配额数量。 当type为scaling_Policy和scaling_Instance时，该字段为保留字段，返回-1。可通过[查询弹性伸缩策略和伸缩实例配额 - ShowPolicyAndInstanceQuota](https://support.huaweicloud.com/api-as/as_06_0702.html)查询指定弹性伸缩组下的弹性伸缩策略和伸缩实例已使用的配额数量。                                                                                                                                                                                                                                                                                                                                                                                   |
| quota | Integer | 配额总数量                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| max   | Integer | 配额上限                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| min   | Integer | 配额下限                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
   
#### 响应示例
```
{
    "quotas": {
        "resources": [
            {
                "type": "scaling_Group",
                "used": 2,
                "quota": 25,
                "max": 50,
                "min": 0
            },
            {
                "type": "scaling_Config",
                "used": 3,
                "quota": 100,
                "max": 200,
                "min": 0
            },
            {
                "type": "scaling_Policy",
                "used": -1,
                "quota": 50,
                "max": 50,
                "min": 0
            },
            {
                "type": "scaling_Instance",
                "used": -1,
                "quota": 200,
                "max": 1000,
                "min": 0
            },
            {
                "type": "bandwidth_scaling_policy",
                "used": 1,
                "quota": 10,
                "max": 100,
                "min": 0
            }
        ]
    }
}
```
#### 返回值
- 正常 200
  
- 异常
  
  | 返回值                               | 说明                           |
  |:---|:---|
  | 400 Bad Request                   | 服务器未能处理请求。                   |
  | 401 Unauthorized                  | 被请求的页面需要用户名和密码。              |
  | 403 Forbidden                     | 对被请求的页面访问禁止。                 |
  | 404 Not Found                     | 服务器无法找到被请求的页面。               |
  | 405 Method Not Allowed            | 请求中指定的方法不被允许。                |
  | 406 Not Acceptable                | 服务器生成的响应无法被客户端所接受。           |
  | 407 Proxy Authentication Required | 用户必须首先使用代理服务器进行验证，这样请求才会被处理。 |
  | 408 Request Timeout               | 请求超出了服务器的等待时间。               |
  | 409 Conflict                      | 由于冲突，请求无法被完成。                |
  | 500 Internal Server Error         | 请求未完成。服务异常。                  |
  | 501 Not Implemented               | 请求未完成。服务器不支持所请求的功能。          |
  | 502 Bad Gateway                   | 请求未完成。服务器从上游服务器收到一个无效的响应。    |
  | 503 Service Unavailable           | 请求未完成。系统暂时异常。                |
  | 504 Gateway Timeout               | 网关超时。                        |
     
  
 
#### 错误码
请参考[错误码](https://support.huaweicloud.com/api-as/as_07_0102.html)。
