
# 查询租户配额 - ShowTenantQuota
#### 功能介绍
查询该租户下，所有资源的配额信息，包括已使用配额。
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/BMS/doc?api=ShowTenantQuota)中调试该接口。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-bms/bms_api_0900.html)。
- 如果使用身份策略授权，需具备如下身份策略权限。
  
  | 授权项                  | 访问级别 | 资源类型（\*为必须） | 条件键 | 别名 | 依赖的授权项 |
  |:---|:---|:---|:---|:---|:---|
  | bms:serverQuotas:get | read | -           | -   | -  | -      |
     
  
 
#### URI
GET /v1/{project_id}/baremetalservers/limits
参数说明请参见[表1]。
 表1参数说明 
| 参数         | 是否必选 | 描述                                                                                                                 |
|:---|:---|:---|
| project_id | 是    | 项目ID。 获取方式请参见[获取项目ID](https://support.huaweicloud.com/api-bms/bms_api_appendix_03.html)。 |
   
#### 请求参数
无
#### 请求示例
查询项目ID为bbf1946d374b44a0a2a95533562ba954的租户配额。
```
GET https://{BMS Endpoint}/v1/bbf1946d374b44a0a2a95533562ba954/baremetalservers/limits
```
#### 响应参数
| 参数       | 参数类型   | 描述                                             |
|:---|:---|:---|
| absolute | Object | 租户配额信息，详情请参见[表2]。 |
   
![](https://support.huaweicloud.com/api-bms/public_sys-resources/note_3.0-zh-cn.png)
以下参数值为"-1"时，表示无数量限制。
 表2absolute数据结构说明 
| 参数                      | 参数类型    | 描述                                                                                                 |
|:---|:---|:---|
| maxTotalInstances       | Integer | 裸金属服务器最大申请数量。                                                                                      |
| maxTotalCores           | Integer | CPU核数最大申请数量。                                                                                       |
| maxTotalRAMSize         | Integer | 内存最大申请容量（单位：MB）。                                                                                   |
| maxTotalKeypairs        | Integer | 可以申请的SSH密钥对最大数量。                                                                                   |
| maxServerMeta           | Integer | 可输入元数据的最大长度。                                                                                       |
| maxPersonality          | Integer | 可注入文件的最大个数。                                                                                        |
| maxPersonalitySize      | Integer | 注入文件内容的最大长度（单位：Byte）。                                                                              |
| maxServerGroups         | Integer | 服务器组的最大个数。                                                                                         |
| maxServerGroupMembers   | Integer | 服务器组中的最大裸金属服务器数。                                                                                   |
| totalServerGroupsUsed   | Integer | 已使用的服务器组个数。                                                                                        |
| maxSecurityGroups       | Integer | 安全组最大使用个数。 说明： 具体配额限制请以VPC配额限制为准。         |
| maxSecurityGroupRules   | Integer | 安全组中安全组规则最大的配置个数。 说明： 具体配额限制请以VPC配额限制为准。 |
| maxTotalFloatingIps     | Integer | 最大的弹性IP使用个数。                                                                                       |
| maxImageMeta            | Integer | 镜像元数据最大的长度。                                                                                        |
| totalInstancesUsed      | Integer | 当前裸金属服务器使用个数。                                                                                      |
| totalCoresUsed          | Integer | 当前已使用CPU核数。                                                                                        |
| totalRAMUsed            | Integer | 当前内存使用容量（单位：MB）。                                                                                   |
| totalSecurityGroupsUsed | Integer | 当前安全组使用个数。                                                                                         |
| totalFloatingIpsUsed    | Integer | 当前弹性IP使用个数。                                                                                        |
   
#### 响应示例
```
{
    "absolute": {
        "maxServerMeta": 128,
        "maxPersonality": 5,
        "maxImageMeta": 128,
        "maxPersonalitySize": 10240,
        "maxSecurityGroupRules": 20,
        "maxTotalKeypairs": 100,
        "totalRAMUsed": 799836,
        "totalInstancesUsed": 21,
        "maxSecurityGroups": 10,
        "totalFloatingIpsUsed": 0,
        "maxTotalCores": -1,
        "totalSecurityGroupsUsed": 1,
        "maxTotalFloatingIps": 10,
        "maxTotalInstances": 100,
        "totalCoresUsed": 148,
        "maxTotalRAMSize": -1,
        "maxServerGroups": -1,
        "maxServerGroupMembers": -1,
        "totalServerGroupsUsed": 1
    }
}
```
#### 返回值
正常返回值：
| 返回值 | 说明           |
|:---|:---|
| 200 | 服务器已成功处理了请求。 |
   
其他返回值请参考[状态码](https://support.huaweicloud.com/api-bms/bms_api_0801.html)。
#### 错误码
请参考[错误码](https://support.huaweicloud.com/api-bms/bms_api_0802.html)。
