
# 元数据数量统计 - CountMetaObj
#### 功能介绍
元数据数量统计接口。
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/LakeFormation/doc?api=CountMetaObj)中调试该接口，支持自动认证鉴权。API Explorer可以自动生成SDK代码示例，并提供SDK代码示例调试功能。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-lakeformation/abcd.html)。
#### URI
POST /v1/{project_id}/instances/{instance_id}/metaobj/count
表1路径参数 
| 参数          | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                       |
|:---|:---|:---|:---|
| project_id  | 是    | String | **参数解释:** 项目编号。获取方法，请参见[获取项目ID](https://support.huaweicloud.com/api-lakeformation/lakeformation_04_0026.html)。 **约束限制:** 长度为1\~64个字符 **取值范围:** 长度为1\~64个字符 **默认取值:** 不涉及 |
| instance_id | 是    | String | **参数解释:** LakeFormation实例ID。创建实例时自动生成。例如：2180518f-42b8-4947-b20b-adfc53981a25。 **约束限制:** 最小长度为1 **取值范围:** 最小长度为1 **默认取值:** 不涉及                                           |
   
#### 请求参数
表2请求Header参数 
| 参数           | 是否必选 | 参数类型             | 描述                                                                                                                                                                                                                                                                                                               |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | Array of strings | **参数解释:** 租户token。 **约束限制:** 数组元素个数为1\~100 **取值范围:** 数组元素个数为1\~100 **默认取值:** 不涉及 |
   
#### 响应参数
**状态码：200**
表3响应Body参数 
| 参数               | 参数类型 | 描述                                              |
|:---|:---|:---|
| total_count      | Long | **参数解释:** 总数量   |
| functions_count  | Long | **参数解释:** 函数数量  |
| catalogs_count   | Long | **参数解释:** 目录数量  |
| databases_count  | Long | **参数解释:** 数据库数量 |
| tables_count     | Long | **参数解释:** 表数量   |
| partitions_count | Long | **参数解释:** 分区数量  |
| indexes_count    | Long | **参数解释:** 索引数量  |
   
**状态码：400**
表4响应Body参数 
| 参数           | 参数类型   | 描述                                               |
|:---|:---|:---|
| error_code   | String | **参数解释:** 错误码    |
| error_msg    | String | **参数解释:** 错误描述   |
| solution_msg | String | **参数解释:** 解决方案描述 |
   
**状态码：401**
表5响应Body参数 
| 参数           | 参数类型   | 描述                                               |
|:---|:---|:---|
| error_code   | String | **参数解释:** 错误码    |
| error_msg    | String | **参数解释:** 错误描述   |
| solution_msg | String | **参数解释:** 解决方案描述 |
   
**状态码：403**
表6响应Body参数 
| 参数         | 参数类型                                          | 描述                                             |
|:---|:---|:---|
| error      | [Error] object | **参数解释:** 错误信息 |
| error_code | String                                        | **参数解释:** 错误码  |
| error_msg  | String                                        | **参数解释:** 错误描述 |
| title      | String                                        | **参数解释:** 标题   |
   
 表7Error 
| 参数         | 参数类型   | 描述                                             |
|:---|:---|:---|
| error_code | String | **参数解释:** 错误码  |
| error_msg  | String | **参数解释:** 错误描述 |
| title      | String | **参数解释:** 标题   |
| message    | String | **参数解释:** 错误信息 |
| code       | String | **参数解释:** 状态码  |
   
**状态码：404**
表8响应Body参数 
| 参数           | 参数类型   | 描述                                               |
|:---|:---|:---|
| error_code   | String | **参数解释:** 错误码    |
| error_msg    | String | **参数解释:** 错误描述   |
| solution_msg | String | **参数解释:** 解决方案描述 |
   
**状态码：408**
表9响应Body参数 
| 参数           | 参数类型   | 描述                                               |
|:---|:---|:---|
| error_code   | String | **参数解释:** 错误码    |
| error_msg    | String | **参数解释:** 错误描述   |
| solution_msg | String | **参数解释:** 解决方案描述 |
   
**状态码：500**
表10响应Body参数 
| 参数           | 参数类型   | 描述                                               |
|:---|:---|:---|
| error_code   | String | **参数解释:** 错误码    |
| error_msg    | String | **参数解释:** 错误描述   |
| solution_msg | String | **参数解释:** 解决方案描述 |
   
#### 请求示例
```
POST https://{endpoint}/v1/{project_id}/instances/{instance_id}/metaobj/count
```
#### 响应示例
**状态码：200**
元数据数量统计信息
```
{
  "total_count" : 600,
  "functions_count" : 100,
  "catalogs_count" : 100,
  "databases_count" : 100,
  "tables_count" : 100,
  "partitions_count" : 100,
  "indexes_count" : 100
}
```
**状态码：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 | 元数据数量统计信息             |
| 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)。
