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

添加审计数据库Agent

功能介绍

添加审计数据库Agent

调试

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

URI

POST /v3/{project_id}/audit/{instance_id}/agents

表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参数

参数

是否必选

参数类型

描述

db_id

String

数据库ID, 可在查询数据库列表接口的ID字段获取。

mode

Integer

模式

  • 0:创建agent

  • 1:选择已有agent

agent_id

String

选择已有agent时必输

agent_type

String

agent类型

  • APP:应用端

  • DB:数据库端

agent_os

String

agent OS类型:

  • LINUX64_X86

  • LINUX64_ARM

  • WINDOWS64

agent_ip

String

agent IP,安装节点类型为应用端时必输。

agent_nic

String

agent审计网卡名称

cpu_threshold

Integer

CPU阈值

mem_threshold

Integer

内存阈值

响应参数

状态码:200

表4 响应Body参数

参数

参数类型

描述

result

String

操作结果

  • SUCCESS: 成功

状态码:400

表5 响应Body参数

参数

参数类型

描述

details

Array of DbssErrorDetail objects

PDP5鉴权异常信息

encoded_authorization_message

String

PDP5鉴权异常信息

error_code

String

错误码

error_msg

String

错误信息

表6 DbssErrorDetail

参数

参数类型

描述

error_code

String

错误码

error_msg

String

PDP5错误信息

状态码:403

表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错误信息

状态码:500

表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错误信息

请求示例

/v3/{project_id}/audit/{instance_id}/agents

{
  "db_id" : "Gadr-Y4B51p4J06s5s5B",
  "mode" : 0,
  "agent_type" : "DB",
  "agent_os" : "LINUX64_X86",
  "cpu_threshold" : 80,
  "mem_threshold" : 80
}

响应示例

状态码:200

成功

{
  "result" : "SUCCESS"
}

状态码

状态码

描述

200

成功

400

失败

403

认证失败

500

服务端错误

错误码

请参见错误码

相关文档