Adding Database Assets in Batches
Function
This API is used to add database assets in batches. Information about multiple database instances can be submitted in JSON format for registration.
Calling Method
For details, see Calling APIs.
URI
POST /v1/{project_id}/sdg/asset/databases/batch-authorize
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID, which is used to identify a specific project. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
readonly |
No |
Boolean |
Whether the read-only mode is used to control access to the database. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
[items] |
Yes |
Array of DBRequest objects |
Database request object, which specifies the detailed configuration of the database. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
asset_name |
No |
String |
Asset name. |
|
create_time |
No |
Long |
Timestamp when a database is created. |
|
ds_address |
No |
String |
Data source address, which indicates the network address of a database. |
|
ds_name |
No |
String |
Data source name, which indicates a database. |
|
ds_password |
No |
String |
Data source password, which is the password for accessing a database. |
|
ds_port |
No |
Integer |
Data source port, which indicates the network port of a database. |
|
ds_type |
No |
String |
Data source type, which indicates the database type. The options as follows: MYSQL, SQLSERVER, MSSQL, MS-SQL, POSTGRESQL, GREENPLUM, ES, ELASTICSEARCHF, ORACLE, DWS, DLI, LTS, HIVE, MRS_HIVE, MONGODB, OPENGAUSS, KINGBASE, DMDBMS, HBASE, TDSQL |
|
ds_user |
No |
String |
Data source username, which is the username for accessing a database. |
|
ds_version |
No |
String |
Data source version, which indicates the software version of a database. |
|
id |
No |
String |
Unique identifier of a database. |
|
ins_id |
No |
String |
Unique identifier of an instance. |
|
ins_name |
No |
String |
Name of an instance. |
|
ins_type |
No |
String |
Instance type, which indicates the instance category. For example, RDS indicates the Relational Database Service. The options as follows: PUB, RDS, ECS, CCE, CSS, OUTSIDE, OBS, MRS, MRS_HWS, DWS, DLI, LTS, GAUSSDB, EXTERNAL, DDS, CLOUDDB |
|
is_external |
No |
Boolean |
Whether an instance is an external instance, that is, whether the instance is located on an external network. |
|
project_id |
No |
String |
Project ID, which uniquely identifies the project that an instance belongs to. |
|
rds_one_key_authorization |
No |
Boolean |
Whether quick authorization is enabled for accessing a database. |
|
region |
No |
String |
Region where an instance is located. It indicates the geographical location of the instance. |
|
scan_metadata |
No |
Boolean |
Whether database metadata is scanned. |
|
security_group_id |
No |
String |
Security group ID, which uniquely identifies the security group that an instance belongs to. |
|
service_name |
No |
String |
Service name, which identifies the service that an instance belongs to. |
|
sid |
No |
String |
Session ID, which identifies the session of an instance. |
|
subnet_id |
No |
String |
Subnet ID, which uniquely identifies the subnet that an instance belongs to. |
|
vpc_id |
No |
String |
Unique identifier of the VPC that an instance belongs to. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
msg |
String |
Returned message, which is used to describe the operation result or error information. |
|
status |
String |
Return status, for example, '200', '400'. |
Status code: 201
Database asset created.
Example Requests
POST /v1/{project_id}/sdg/asset/databases/batch-authorize
[ {
"asset_name" : "string",
"create_time" : 0,
"ds_address" : "string",
"ds_name" : "string",
"ds_password" : "string",
"ds_port" : 0,
"ds_type" : "string",
"ds_user" : "string",
"ds_version" : "string",
"id" : "string",
"ins_id" : "string",
"ins_name" : "string",
"ins_type" : "string",
"is_external" : true,
"project_id" : "string",
"rds_one_key_authorization" : true,
"region" : "string",
"scan_metadata" : true,
"security_group_id" : "string",
"service_name" : "string",
"sid" : "string",
"subnet_id" : "string",
"vpc_id" : "string"
} ]
Example Responses
None
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Database assets added in batches. |
|
201 |
Database asset created. |
|
401 |
Unauthorized access. The request is rejected. |
|
403 |
Unauthorized operation. The request is rejected. |
|
404 |
Project does not exist. Batch adding failed. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot