Adding an Audit Database Agent
Function
This API is used to add an audit database agent.
Calling Method
For details, see Calling APIs.
URI
POST /v2/{project_id}/{instance_id}/audit/agents
|
Parameter |
Mandatory |
Parameter Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. |
|
instance_id |
Yes |
String |
Instance ID. You can obtain the value from the ID field in the API for querying the instance list. |
Request Parameter
|
Parameter |
Mandatory |
Parameter Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
User token. The token can be queried by calling the IAM API. (The token is the value of X-Subject-Token in the response header.) |
|
Parameter |
Mandatory |
Parameter Type |
Description |
|---|---|---|---|
|
db_id |
Yes |
String |
Database ID, which can be obtained from the ID field of the API for querying the database list. |
|
mode |
Yes |
Integer |
Schema
|
|
agent_id |
No |
String |
Mandatory when an existing agent is selected |
|
agent_type |
Yes |
String |
Type of the node where the agent is installed. The value can be:
|
|
agent_os |
Yes |
String |
Agent OS type. The value can be:
|
|
agent_ip |
No |
String |
Agent IP address. This is mandatory when node type is set to Application. |
|
agent_nic |
No |
String |
Name of the agent audit NIC |
|
cpu_threshold |
No |
Integer |
CPU threshold |
|
mem_threshold |
No |
Integer |
Memory threshold. |
Response Parameters
Status code: 200
|
Parameter |
Parameter Type |
Description |
|---|---|---|
|
result |
String |
Response status |
Status code: 400
|
Parameter |
Parameter Type |
Description |
|---|---|---|
|
error |
Object |
Error message. |
|
Parameter |
Parameter Type |
Description |
|---|---|---|
|
error_code |
String |
Error code |
|
error_msg |
String |
Error message |
Status code: 403
|
Parameter |
Parameter Type |
Description |
|---|---|---|
|
error |
Object |
Error message. |
|
Parameter |
Parameter Type |
Description |
|---|---|---|
|
error_code |
String |
Error code |
|
error_msg |
String |
Error message |
Status code: 500
|
Parameter |
Parameter Type |
Description |
|---|---|---|
|
error |
Object |
Error message. |
|
Parameter |
Parameter Type |
Description |
|---|---|---|
|
error_code |
String |
Error code |
|
error_msg |
String |
Error message |
Example request
/v2/{project_id}/{instance_id}/audit/agents
{
"db_id" : "Gadr-Y4B51p4J06s5s5B",
"mode" : 0,
"agent_type" : "DB",
"agent_os" : "LINUX64_X86",
"cpu_threshold" : 80,
"mem_threshold" : 80
}
Example Response
Status code: 200
Succeeded
{
"result" : "SUCCESS"
}
Status code: 400
Failed
{
"error" : {
"error_code" : "DBSS.XXXX",
"error_msg" : "XXX"
}
}
Status Code
|
Status Code |
Description |
|---|---|
|
200 |
Success |
|
400 |
Failed |
|
403 |
Authentication failed. |
|
500 |
Server error. |
Error Codes
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.