
# 查询规格列表 - ListSpecs
#### 功能介绍
查询规格列表。
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/LakeFormation/doc?api=ListSpecs)中调试该接口，支持自动认证鉴权。API Explorer可以自动生成SDK代码示例，并提供SDK代码示例调试功能。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-lakeformation/abcd.html)。
#### URI
GET /v1/{project_id}/specs
表1路径参数 
| 参数         | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                 |
|:---|:---|:---|:---|
| project_id | 是    | String | **参数解释:** 项目编号。获取方法，请参见[获取项目ID](https://support.huaweicloud.com/api-lakeformation/lakeformation_04_0026.html) **约束限制:** 不涉及 **取值范围:** 不涉及 **默认取值:** 不涉及 |
   
表2Query参数 
| 参数        | 是否必选 | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                         |
|:---|:---|:---|:---|
| spec_code | 否    | String  | **参数解释:** 规格编码。由系统自动生成，例如lakeformation.unit.basic.qps **约束限制:** 长度为1\~32个字符 **取值范围:** 长度为1\~32个字符 **默认取值:** 不涉及 |
| offset    | 否    | Integer | **参数解释:** 偏移量。取值在0-100之间，默认值为0 **约束限制:** 取值为0\~100 **取值范围:** 取值为0\~100 **默认取值:** 0                              |
| limit     | 否    | Integer | **参数解释:** 单次查询个数。取值在1-100之间，默认值为10 **约束限制:** 取值为1\~100 **取值范围:** 取值为1\~100 **默认取值:** 10                         |
   
#### 请求参数
无
#### 响应参数
**状态码：200**
表3响应Body参数 
| 参数         | 参数类型                                               | 描述                                            |
|:---|:---|:---|
| total      | Integer                                            | **参数解释:** 总数     |
| spec_codes | Array of [Spec] objects | **参数解释:** 规格编码列表 |
   
 表4Spec 
| 参数                   | 参数类型              | 描述                                                                                                                                                |
|:---|:---|:---|
| spec_code            | String            | **参数解释:** 规格编码。lakeformation.unit.basic.qps：每秒查询率（QPS）产品                                                             |
| resource_type        | String            | **参数解释:** 资源编码                                                                                                       |
| stride               | Integer           | **参数解释:** 步长                                                                                                         |
| unit                 | String            | **参数解释:** 单位                                                                                                         |
| min_stride_num       | Integer           | **参数解释:** 最小步数                                                                                                       |
| max_stride_num       | Integer           | **参数解释:** 最大步数                                                                                                       |
| usage_measure_id     | Integer           | **参数解释:** 使用量单位标识                                                                                                    |
| usage_factor         | String            | **参数解释:** 使用量因子                                                                                                      |
| usage_value          | Integer           | **参数解释:** 使用量，包含免费额度和单位额度，例如api调用次数，单位是次，前100万次调用免费，计费标准是5元每100万次，这里返回200万，元数据个数，单位是万个，前100万个免费，计费标准是5元每10万个，这里返回110 |
| free_usage_value     | Integer           | **参数解释:** 免费使用额度，例如api调用次数，单位是次，前100万次调用免费，这里返回100万，元数据个数，单位是万个，前100万个免费，这里返回100                                     |
| stride_num_whitelist | Array of integers | **参数解释:** 步数白名单，返回时，步数必须是白名单中的值                                                                                      |
   
**状态码：204**
表5响应Header参数 
| 参数           | 参数类型   | 描述           |
|:---|:---|:---|
| X-request-id | String | 请求ID，定位辅助信息。 |
   
**状态码：400**
表6响应Body参数 
| 参数                | 参数类型   | 描述                                              |
|:---|:---|:---|
| error_code        | String | **参数解释:** 错误码      |
| error_msg         | String | **参数解释:** 错误描述     |
| common_error_code | String | **参数解释:** CBC公共错误码 |
| solution_msg      | String | **参数解释:** 解决方案描述   |
   
**状态码：401**
表7响应Body参数 
| 参数                | 参数类型   | 描述                                              |
|:---|:---|:---|
| error_code        | String | **参数解释:** 错误码      |
| error_msg         | String | **参数解释:** 错误描述     |
| common_error_code | String | **参数解释:** CBC公共错误码 |
| solution_msg      | String | **参数解释:** 解决方案描述   |
   
**状态码：403**
表8响应Body参数 
| 参数         | 参数类型                                       | 描述                                          |
|:---|:---|:---|
| error      | [Error] object | **参数解释:** 错误信息 |
| error_code | String                                     | **参数解释:** 错误码  |
| error_msg  | String                                     | **参数解释:** 错误描述 |
| title      | String                                     | **参数解释:** 标题   |
   
 表9Error 
| 参数         | 参数类型   | 描述                                          |
|:---|:---|:---|
| error_code | String | **参数解释:** 错误码  |
| error_msg  | String | **参数解释:** 错误描述 |
| title      | String | **参数解释:** 标题   |
| message    | String | **参数解释:** 错误信息 |
| code       | String | **参数解释:** 状态码  |
   
**状态码：404**
表10响应Body参数 
| 参数                | 参数类型   | 描述                                              |
|:---|:---|:---|
| error_code        | String | **参数解释:** 错误码      |
| error_msg         | String | **参数解释:** 错误描述     |
| common_error_code | String | **参数解释:** CBC公共错误码 |
| solution_msg      | String | **参数解释:** 解决方案描述   |
   
**状态码：408**
表11响应Body参数 
| 参数                | 参数类型   | 描述                                              |
|:---|:---|:---|
| error_code        | String | **参数解释:** 错误码      |
| error_msg         | String | **参数解释:** 错误描述     |
| common_error_code | String | **参数解释:** CBC公共错误码 |
| solution_msg      | String | **参数解释:** 解决方案描述   |
   
**状态码：500**
表12响应Body参数 
| 参数                | 参数类型   | 描述                                              |
|:---|:---|:---|
| error_code        | String | **参数解释:** 错误码      |
| error_msg         | String | **参数解释:** 错误描述     |
| common_error_code | String | **参数解释:** CBC公共错误码 |
| solution_msg      | String | **参数解释:** 解决方案描述   |
   
#### 请求示例
```
GET https://{endpoint}/v1/{project_id}/specs
```
#### 响应示例
**状态码：200**
规格列表
```
{
  "total" : 1,
  "spec_codes" : [ {
    "spec_code" : "hws.resource.type.lakeformation.qps",
    "resource_type" : "hws.resource.type.lakeformation.metadata",
    "stride" : 2000,
    "unit" : "qps",
    "min_stride_num" : 1,
    "max_stride_num" : 100,
    "usage_measure_id" : 6,
    "usage_factor" : "Duration",
    "usage_value" : 1,
    "free_usage_value" : 1,
    "stride_num_whitelist" : [ 1, 2 ]
  } ]
}
```
**状态码：400**
Bad Request
```
{
  "error_code" : "common.01000001",
  "error_msg" : "failed to read http request, please check your input, code: 400, reason: Type mismatch., cause: TypeMismatchException"
}
```
**状态码：401**
Unauthorized
```
{
  "error_code" : "APIG.1002",
  "error_msg" : "Incorrect token or token resolution failed"
}
```
**状态码：403**
Forbidden
```
{
  "error" : {
    "code" : "403",
    "message" : "X-Auth-Token is invalid in the request",
    "error_code" : null,
    "error_msg" : null,
    "title" : "Forbidden"
  },
  "error_code" : "403",
  "error_msg" : "X-Auth-Token is invalid in the request",
  "title" : "Forbidden"
}
```
**状态码：404**
Not Found
```
{
  "error_code" : "common.01000001",
  "error_msg" : "response status exception, code: 404"
}
```
**状态码：408**
Request Timeout
```
{
  "error_code" : "common.00000408",
  "error_msg" : "timeout exception occurred"
}
```
**状态码：500**
Internal Server Error
```
{
  "error_code" : "common.00000500",
  "error_msg" : "internal error"
}
```
#### 状态码
| 状态码 | 描述                    |
|:---|:---|
| 200 | 规格列表                  |
| 204 | No Content            |
| 400 | Bad Request           |
| 401 | Unauthorized          |
| 403 | Forbidden             |
| 404 | Not Found             |
| 408 | Request Timeout       |
| 500 | Internal Server Error |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-lakeformation/ErrorCode.html)。
