
# 查询配额 - ShowQuota
#### 功能介绍
查询单租户在VPC服务下的网络资源配额，包括vpc配额、子网配额、安全组配额、安全组规则配额、弹性公网IP配额，vpn配额等。
#### 调试
您可以在[API Explorer](https://apiexplorer.developer.huaweicloud.com/apiexplorer/doc?product=VPC&version=v2&api=ShowQuota)中调试该接口。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-vpc/vpc_permission_0000.html)。
- 如果使用身份策略授权，需具备如下身份策略权限。
  
  | 授权项             | 访问级别 | 资源类型（\*为必须） | 条件键 | 别名                                                                                                                   | 依赖的授权项 |
  |:---|:---|:---|:---|:---|:---|
  | vpc:quotas:list | List | -           | -   | - vpc:quotas:get   | -      |
     
  
 
#### URI
GET /v1/{project_id}/quotas
样例：
```
GET https://{Endpoint}/v1/{project_id}/quotas?type={type}
```
参数说明请参见[表1]。
 表1参数说明 
| 名称         | 是否必选 | 参数类型   | 说明                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
|:---|:---|:---|:---|
| project_id | 是    | String | 项目ID，获取项目ID请参见[获取项目ID](https://support.huaweicloud.com/api-vpc/vpc_api_0011.html)。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| type       | 否    | String | - 功能说明：根据type过滤查询指定类型的配额  - 取值范围： - vpc 虚拟私有云  - subnet 子网  - securityGroup 安全组  - securityGroupRule 安全组规则  - publicIp 弹性公网IP  - vpn 虚拟专用网络  - vpngw VPN网关  - vpcPeer 对等连接  - loadbalancer 负载均衡  - listener 负载倾听器  - physicalConnect 物理专线  - virtualInterface 虚拟接口  - firewall 防火墙  - shareBandwidthIP 单个共享带宽的IP  - shareBandwidth 共享带宽  - address_group 地址组  - flow_log 流日志  - vpcContainRoutetable 单VPC下的路由表数量  - routetableContainRoutes 单路由表下的路由条目     |
   
#### 请求参数
无
#### 请求示例
```
GET https://{Endpoint}/v1/{project_id}/quotas
```
#### 响应参数
表2响应参数 
| 名称     | 参数类型                                                  | 说明                                                    |
|:---|:---|:---|
| quotas | [quotas] object | 配额列表对象，请参见[表3]。 |
   
 表3quotas字段说明 
| 名称        | 参数类型                                                       | 说明                                             |
|:---|:---|:---|
| resources | Array of [resource] objects | 资源列表对象，请参见[表4]。 |
   
 表4resource字段说明 
| 名称    | 参数类型    | 说明                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
|:---|:---|:---|
| type  | String  | - 功能说明：根据type过滤查询指定类型的配额  - 取值范围： - vpc 虚拟私有云  - subnet 子网  - securityGroup 安全组  - securityGroupRule 安全组规则  - publicIp 弹性公网IP  - vpn 虚拟专用网络  - vpngw VPN网关  - vpcPeer 对等连接  - loadbalancer 负载均衡  - listener 负载倾听器  - physicalConnect 物理专线  - virtualInterface 虚拟接口  - firewall 防火墙  - shareBandwidthIP 单个共享带宽的IP  - shareBandwidth 共享带宽  - address_group 地址组  - flow_log 流日志  - vpcContainRoutetable 单VPC下的路由表数量  - routetableContainRoutes 单路由表下的路由条目     |
| used  | Integer | - 功能说明：已创建的资源个数  - 取值范围：0\~quota数                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| quota | Integer | - 功能说明：资源的最大配额数  - 取值范围：各类型资源默认配额数\~Integer最大值                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| min   | Integer | 允许修改的配额最小值                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
   
![](https://support.huaweicloud.com/api-vpc/public_sys-resources/note_3.0-zh-cn.png)
通过接口查询单租户在VPC服务下的网络资源配额，返回值"-1"，表示配额数量不限制。
#### 响应示例
```
{
    "quotas": {
        "resources": [
            {
                "type": "vpc",
                "used": 4,
                "quota": 150,
                "min": 0
            },
            {
                "type": "subnet",
                "used": 5,
                "quota": 400,
                "min": 0
            },
            {
                "type": "securityGroup",
                "used": 1,
                "quota": 100,
                "min": 0
            },
            {
                "type": "securityGroupRule",
                "used": 6,
                "quota": 5000,
                "min": 0
            },
            {
                "type": "publicIp",
                "used": 2,
                "quota": 10,
                "min": 0
            },
            {
                "type": "vpn",
                "used": 0,
                "quota": 5,
                "min": 0
            },
            {
                "type": "vpngw",
                "used": 0,
                "quota": 2,
                "min": 0
            },
            {
                "type": "vpcPeer",
                "used": 0,
                "quota": 50,
                "min": 0
            },
            {
                "type":"physicalConnect",
                "used":0,
                "quota":10,
                "min":0
            },
            {
                "type":"virtualInterface",
                "used":0,
                "quota":50,
                "min":0
            },
            {
                "type": "firewall",
                "used": 0,
                "quota": 200,
                "min": 0
            },
            {
                "type": "shareBandwidth",
                "used": 0,
                "quota": 5,
                "min": 0
            },
            {
                "type": "shareBandwidthIP",
                "used": 0,
                "quota": 20,
                "min": 0
            },
            {
                "type": "loadbalancer",
                "used": 0,
                "quota": 10,
                "min": 0
            },
            {
                "type": "listener",
                "used": 0,
                "quota": 10,
                "min": 0
            },
            {
                "type": "flow_log",
                "used": 0,
                "quota": 10,
                "min": 0
            },
            {
                "type": "vpcContainRoutetable",
                "used": 0,
                "quota": 1,
                "min": 0
            },
            {
                "type": "routetableContainRoutes",
                "used": 0,
                "quota": 200,
                "min": 0
            },
            { 
                 "type": "address_group", 
                 "used": 0, 
                 "quota": 50, 
                 "min": 0 
             }
        ]
    }
}
```
#### 状态码
请参见[状态码](https://support.huaweicloud.com/api-vpc/vpc_api_0002.html)。
#### 错误码
请参考[错误码](https://support.huaweicloud.com/api-vpc/vpc_api_0003.html)。
