更新时间:2025-09-10 GMT+08:00
分享

查询报表

功能介绍

查询报表

调试

您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。

URI

POST /v1/{project_id}/audit/{instance_id}/reports/list

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

参数解释

项目ID。可通过IAM服务[查询指定IAM用户的项目列表]接口获取。

约束限制

不涉及

取值范围

以IAM服务接口返回值为准,字符长度32-64。

默认取值

不涉及

instance_id

String

参数解释

实例ID。可通过查询实例列表接口ID字段获取

约束限制

不涉及

取值范围

以查询实例列表接口值为准,字符长度32-64。

默认取值

不涉及

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

参数解释

用户Token。 通过调用IAM服务查询用户Token接口获取(响应消息头中X-Subject-Token的值)。

约束限制

不涉及

取值范围

IAM服务查询用户Token接口为准

默认取值

不涉及

表3 请求Body参数

参数

是否必选

参数类型

描述

name

String

报表名称

page

Integer

当前页码

size

Integer

每页条数

响应参数

状态码:200

表4 响应Body参数

参数

参数类型

描述

reports

Array of ReportInfo objects

报表对象列表

total

Long

总记录数

表5 ReportInfo

参数

参数类型

描述

report

ReportBean object

报表对象

表6 ReportBean

参数

参数类型

描述

db_ids

String

数据库ID

db_names

String

数据库名称

end_time

String

结束时间

finish_time

String

完成时间

format

String

格式

  • pdf: PDF文件

  • zip: zip文件

id

String

报表ID

name

String

报表名称

percentum

Integer

进度

start_time

String

开始时间

template_type

String

报表类型

  • PDF

  • ZIP

type

String

周期

  • AUDIT_REPORT_DAY: 按天

  • AUDIT_REPORT_WEEK: 按周

  • AUDIT_REPORT_MONTH: 按月

  • AUDIT_REPORT_YEAR:按年

  • AUDIT_REPORT_REAL_TIME:立即

url

String

地址URL

状态码:400

表7 响应Body参数

参数

参数类型

描述

details

Array of DbssErrorDetail objects

PDP5鉴权异常信息

encoded_authorization_message

String

PDP5鉴权异常信息

error_code

String

错误码

error_msg

String

错误信息

表8 DbssErrorDetail

参数

参数类型

描述

error_code

String

错误码

error_msg

String

PDP5错误信息

状态码:401

表9 响应Body参数

参数

参数类型

描述

details

Array of DbssErrorDetail objects

PDP5鉴权异常信息

encoded_authorization_message

String

PDP5鉴权异常信息

error_code

String

错误码

error_msg

String

错误信息

表10 DbssErrorDetail

参数

参数类型

描述

error_code

String

错误码

error_msg

String

PDP5错误信息

状态码:403

表11 响应Body参数

参数

参数类型

描述

details

Array of DbssErrorDetail objects

PDP5鉴权异常信息

encoded_authorization_message

String

PDP5鉴权异常信息

error_code

String

错误码

error_msg

String

错误信息

表12 DbssErrorDetail

参数

参数类型

描述

error_code

String

错误码

error_msg

String

PDP5错误信息

状态码:500

表13 响应Body参数

参数

参数类型

描述

details

Array of DbssErrorDetail objects

PDP5鉴权异常信息

encoded_authorization_message

String

PDP5鉴权异常信息

error_code

String

错误码

error_msg

String

错误信息

表14 DbssErrorDetail

参数

参数类型

描述

error_code

String

错误码

error_msg

String

PDP5错误信息

请求示例

/v1/{project_id}/audit/{instance_id}/reports/list

{
  "page" : 1,
  "size" : 1
}

响应示例

状态码:200

OK

{
  "total" : 1,
  "reports" : [ {
    "report" : {
      "id" : "ocdwy5gBPj4d6CRt90sh",
      "name" : "数据库安全综合报表",
      "type" : "AUDIT_REPORT_REAL_TIME",
      "format" : "pdf",
      "percentum" : 100,
      "url" : "/results/ocdwy5gBPj4d6CRt90sh/download-report",
      "finish_time" : "2025-08-21 07:03:56",
      "db_ids" : "",
      "template_type" : "COMPREHENSIVE",
      "start_time" : "2025-08-20 16:00:00",
      "end_time" : "2025-08-21 07:03:31",
      "db_names" : ""
    }
  } ]
}

状态码

状态码

描述

200

OK

400

请求参数有误。

401

认证失败

403

未授权

500

服务端错误

错误码

请参见错误码

相关文档