Updating a Database Asset
Function
This API is used to update information about a specified database asset and modify the configuration and attributes of a database instance.
Calling Method
For details, see Calling APIs.
URI
PUT /v1/{project_id}/sdg/asset/databases/{db_id}
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
db_id |
Yes |
String |
Database asset ID, which uniquely identifies the database asset to be updated. |
|
project_id |
Yes |
String |
Project ID, which is used to identify a specific project. |
Request Parameters
|
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
The database asset is updated.
Example Requests
PUT /v1/{project_id}/sdg/asset/databases/{db_id}
{
"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 |
The database asset is updated. |
|
201 |
The database asset is updated. |
|
401 |
Unauthorized access. The request is rejected. |
|
403 |
Unauthorized operation. The request is rejected. |
|
404 |
The database asset does not exist. Update 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