Updated on 2024-11-01 GMT+08:00

Adding an RDS Database

Function

This API is used to add an RDS database.

Calling Method

For details, see Calling APIs.

URI

POST /v2/{project_id}/{instance_id}/audit/databases/rds

Table 1 URI parameter

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

Table 2 Request header parameter

Parameter

Mandatory

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.)

Table 3 Request body parameter

Parameter

Mandatory

Parameter Type

Description

databases

Yes

Array of databases objects

Database list

Table 4 Databases

Parameter

Mandatory

Parameter Type

Description

id

Yes

String

RDS database ID, which can be obtained from the ID field of the API for querying the RDS database list.

type

Yes

String

Database Type

  • MYSQL
  • ORACLE
  • POSTGRESQL
  • SQLSERVER
  • DAMENG
  • TAURUS
  • DWS
  • KINGBASE
  • MARIADB
  • GAUSSDBOPENGAUSS

Response Parameters

Status code: 200

Table 5 Response body parameter

Parameter

Parameter Type

Description

ret_list

Array of ret_list objects

Result list.

Table 6 ret_list

Parameter

Parameter Type

Description

id

String

RDS database ID

ret_status

String

Status

  • SUCCESS
  • FAILED

ret_message

String

Description

Status code: 400

Table 7 Response body parameters

Parameter

Parameter Type

Description

error

Object

Error message.

Table 8 ErrorDetail

Parameter

Parameter Type

Description

error_code

String

Error code

error_msg

String

Error message

Status code: 403

Table 9 Response body parameter

Parameter

Parameter Type

Description

error

Object

Error message.

Table 10 ErrorDetail

Parameter

Parameter Type

Description

error_code

String

Error code

error_msg

String

Error message

Status code: 500

Table 11 Response body parameters

Parameter

Parameter Type

Description

error

Object

Error message.

Table 12 ErrorDetail

Parameter

Parameter Type

Description

error_code

String

Error code

error_msg

String

Error message

Example Request

/v2/{project_id}/{instance_id}/audit/databases/rds

{
  "databases" : [ {
    "id" : "123751d3ee2f47aea64822e98318c6a8in01",
    "type" : "MYSQL"
  } ]
}

Example Responses

Status code: 200

Succeeded

{
  "ret_list" : [ {
    "id" : "123751d3ee2f47aea64822e98318c6a8in01",
    "ret_status" : "SUCCESS",
    "ret_message" : null
  }, {
    "id" : "2343f7285d684fed8b09fac201c3fc7ain01",
    "ret_status" : "FAILED",
    "ret_message" : "Unknown error."
  } ]
}

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.