ixp
latest
false

Communications Mining 用户指南
上次更新日期 2025年10月7日
/api/v1/audit_events/query
所需权限:读取审核日志。
- 重击
curl -X POST 'https://<my_api_endpoint>/api/v1/audit_events/query' \ -H "Authorization: Bearer $REINFER_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "filter": { "timestamp": { "maximum": "2021-07-10T00:00:00Z", "minimum": "2021-06-10T00:00:00Z" } } }'
curl -X POST 'https://<my_api_endpoint>/api/v1/audit_events/query' \ -H "Authorization: Bearer $REINFER_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "filter": { "timestamp": { "maximum": "2021-07-10T00:00:00Z", "minimum": "2021-06-10T00:00:00Z" } } }' - 节点
const request = require("request"); request.post( { url: "https://<my_api_endpoint>/api/v1/audit_events/query", headers: { Authorization: "Bearer " + process.env.REINFER_TOKEN, }, json: true, body: { filter: { timestamp: { maximum: "2021-07-10T00:00:00Z", minimum: "2021-06-10T00:00:00Z", }, }, }, }, function (error, response, json) { // digest response console.log(JSON.stringify(json, null, 2)); } );
const request = require("request"); request.post( { url: "https://<my_api_endpoint>/api/v1/audit_events/query", headers: { Authorization: "Bearer " + process.env.REINFER_TOKEN, }, json: true, body: { filter: { timestamp: { maximum: "2021-07-10T00:00:00Z", minimum: "2021-06-10T00:00:00Z", }, }, }, }, function (error, response, json) { // digest response console.log(JSON.stringify(json, null, 2)); } ); - Python
import json import os import requests response = requests.post( "https://<my_api_endpoint>/api/v1/audit_events/query", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, json={ "filter": { "timestamp": { "minimum": "2021-06-10T00:00:00Z", "maximum": "2021-07-10T00:00:00Z", } } }, ) print(json.dumps(response.json(), indent=2, sort_keys=True))
import json import os import requests response = requests.post( "https://<my_api_endpoint>/api/v1/audit_events/query", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, json={ "filter": { "timestamp": { "minimum": "2021-06-10T00:00:00Z", "maximum": "2021-07-10T00:00:00Z", } } }, ) print(json.dumps(response.json(), indent=2, sort_keys=True)) - 响应
{ "audit_events": [ { "actor_user_id": "e2148a6625225593", "dataset_ids": ["1fe230edc85ffc1a"], "event_id": "2555880060c23eb5", "event_type": "get_datasets", "project_ids": ["ce3c61dcf210f425", "274400867ab17af9"], "tenant_ids": ["c59b6e209da438a8"], "timestamp": "2021-06-10T16:32:53Z" } ], "continuation": "2555880060c23eb5", "datasets": [ { "id": "1fe230edc85ffc1a", "name": "collateral-sharing", "project_id": "ce3c61dcf210f425", "title": "Collateral Sharing" }, { "id": "274400867ab17af9", "name": "Customer-Feedback", "project_id": "ce3c61dcf210f425", "title": "Customer Feedback" } ], "projects": [ { "id": "ce3c61dcf210f425", "name": "bank-collateral", "tenant_id": "c59b6e209da438a8" } ], "status": "ok", "tenants": [ { "id": "c59b6e209da438a8", "name": "acme" } ], "users": [ { "display_name": "Alice", "email": "alice@acme.example", "id": "e2148a6625225593", "tenant_id": "c59b6e209da438a8", "username": "alice" } ] }
{ "audit_events": [ { "actor_user_id": "e2148a6625225593", "dataset_ids": ["1fe230edc85ffc1a"], "event_id": "2555880060c23eb5", "event_type": "get_datasets", "project_ids": ["ce3c61dcf210f425", "274400867ab17af9"], "tenant_ids": ["c59b6e209da438a8"], "timestamp": "2021-06-10T16:32:53Z" } ], "continuation": "2555880060c23eb5", "datasets": [ { "id": "1fe230edc85ffc1a", "name": "collateral-sharing", "project_id": "ce3c61dcf210f425", "title": "Collateral Sharing" }, { "id": "274400867ab17af9", "name": "Customer-Feedback", "project_id": "ce3c61dcf210f425", "title": "Customer Feedback" } ], "projects": [ { "id": "ce3c61dcf210f425", "name": "bank-collateral", "tenant_id": "c59b6e209da438a8" } ], "status": "ok", "tenants": [ { "id": "c59b6e209da438a8", "name": "acme" } ], "users": [ { "display_name": "Alice", "email": "alice@acme.example", "id": "e2148a6625225593", "tenant_id": "c59b6e209da438a8", "username": "alice" } ] }
审核事件是 Communications Mining™ 平台用户所执行操作的记录。可审核事件示例包括:
- 用户登录
- 用户更改其密码
- 一个用户更改另一个用户的权限。
名称 | 类型 | 必填 | 说明 |
---|---|---|---|
continuation | 字符串 | 否 | 如果上一个查询在响应中返回了continuation ,则可以使用另一页事件。 在此处设置返回的延续值以获取下一页。
|
limit | 数字 | 否 | 每页返回的审核事件数。 默认为 128。 |
filter | 筛选 | 否 | 指定要返回的审核事件的筛选器。 |
其中
Filter
具有以下格式:
名称 | 类型 | 必填 | 说明 |
---|---|---|---|
timestamp | 时间戳筛选器 | 否 | 指定要返回事件的时间范围的筛选器。 |
其中
TimestampFilter
具有以下格式:
名称 | 类型 | 必填 | 说明 |
---|---|---|---|
minimum | 字符串 | 否 | ISO-8601 时间戳。 如果提供,则仅返回此时间戳之后 (含) 的审核事件。 |
maximum | 字符串 | 否 | ISO-8601 时间戳。 如果提供,则仅返回此时间戳之前的审核事件。 |
审核事件列表可以在响应顶层的
audit_events
键下找到。 每个AuditEvent
都可以按 ID 引用其他资源(例如来源、数据集、用户等)。 对于每个引用的资源,可以在响应顶层的相应键( sources
、 datasets
、 users
等)下找到其他信息。
AuditEvent
表示用户在平台中执行的操作,并具有以下基本格式。 可能存在其他键,具体取决于event_type
的值。 例如, get_datasets
审核事件将包含用户已阅读的dataset_ids
列表。
名称 | 类型 | 说明 |
---|---|---|
event_id | 字符串 | 此事件的唯一 ID。 |
event_type | 字符串 | 此事件的类型。
请参阅下一部分中的事件类型列表。 |
timestamp | 字符串 | 此事件的 ISO-8601 时间戳,精确到秒。 |
actor_user_id | 字符串 | 执行此操作的用户的 ID。 |
actor_tenant_id | 字符串 | 执行此操作的用户的租户 ID。 |
最后,如果响应包含
continuation
键,则应通过将请求中的continuation
字段设置为此值来获取下一页事件。
警示审核事件
事件类型 | 说明 |
---|---|
| 系统将创建警示。 |
alert_get | 可查看警示。 |
alert_get_all | 可以查看警示列表。 |
alert_update | 已编辑警示配置。 |
alert_delete | 警示已删除。 |
alert_subscriptions_get | 系统将查看警示订阅列表。 |
alert_subscriptions_delete | 已删除警示订阅。 |
配额审核事件
事件类型 | 说明 |
---|---|
| 可查看配额。 |
| 配额已更新。 |
| 配额已重置。 |
流审核事件(流以前称为“触发器”)
事件类型 | 说明 |
---|---|
trigger_create | 系统即会创建流。 |
trigger_get |
查看流。 |
trigger_get_all | 系统将查看流列表。 |
trigger_update | 已编辑流的配置。 |
trigger_delete | 已删除一个流。 |
trigger_fetch | 查询流(旧版操作)。 |
trigger_advance | 流已推进。 |
trigger_reset | 流已重置。 |
trigger_fetch_gx | 查询生成提取流(旧版操作)。 |
trigger_get_results | 已查询一个流。 |