Updates the information about a database instance and checks the connectivity of the database instance.

Before you call the UpdateInstance operation, call the GetInstance or ListInstances operation to obtain the complete information about the instance.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes UpdateInstance

The operation that you want to perform. Set the value to UpdateInstance.

Tid Long Yes 3***

The ID of the tenant. You can call the GetUserActiveTenant operation to obtain the tenant ID.

InstanceType String Yes mysql

The type of the database. For more information about the valid values of this parameter, see DbType parameter.

InstanceSource String Yes ECS_OWN

The source of the database instance. Valid values:

  • PUBLIC_OWN: a self-managed database instance that is deployed on the Internet
  • RDS: an ApsaraDB RDS instance
  • ECS_OWN: a self-managed database that is deployed on an Elastic Compute Service (ECS) instance
  • VPC_IDC: a self-managed database instance that is deployed in a data center connected over a virtual private cloud (VPC)
EnvType String Yes product

The type of the environment to which the database instance belongs. Valid values:

  • product: production environment
  • dev: development environment
  • pre: staging environment
  • test: test environment
  • sit: system integration testing (SIT) environment
  • uat: user acceptance testing (UAT) environment
  • pet: stress testing environment
  • stag: STAG environment
EcsInstanceId String No i-2zei9gs1t7h8l7ac****

The ID of the ECS instance.

Note This parameter is required if the InstanceSource parameter is set to ECS_OWN.
VpcId String No vpc-xxx

The ID of the VPC.

Note This parameter is required if the InstanceSource parameter is set to VPC_IDC.
EcsRegion String No cn-hangzhou

The ID of the region in which the database instance resides.

Note This parameter is required if the InstanceSource parameter is set to RDS, ECS_OWN, or VPC_IDC.
Host String Yes 192.XXX.0.56

The host address that is used to connect to the database instance.

Port Integer Yes 3306

The port number that is used to connect to the database instance.

Sid String No XXX

The system ID (SID) of the database instance.

Note This parameter is required if the InstanceType parameter is set to ORACLE.
DatabaseUser String Yes dbuser

The account that is used to log on to the database.

DatabasePassword String Yes ******

The password that is used to log on to the database.

InstanceAlias String Yes instance_test

The alias of the database instance. Specify an alias that can help you identify the database instance in DMS.

DbaId String Yes 27****

The ID of the user who assumes the DBA role of the database instance. You can call the ListUsers or GetInstance operation to obtain the user ID.

SafeRuleId String Yes 3****

The ID of the security rule set for the instance. You can call the ListStandardGroups or GetInstance operation to obtain the name of the security rule set that you want to use.

QueryTimeout Integer Yes 60

The timeout period for querying data in the database instance.

ExportTimeout Integer Yes 600

The timeout period for exporting data from the database instance.

DataLinkName String No datalink_test

The name of the data link for cross-database query.

Note
  • This parameter is required if the UseDsql parameter is set to 1.
  • The name can contain only lowercase letters and underscores (_).
  • The name must be unique within a tenant.
DdlOnline Integer No 0

Specifies whether to enable the lock-free schema change feature for the database instance. Valid values:

  • 0: The feature is disabled.
  • 1: The native online DDL feature takes precedence.
  • 2: The lock-free schema change feature of DMS takes precedence.
UseDsql Integer No 0

Specifies whether to enable the cross-database query feature for the database instance. Valid values:

  • 0: The feature is disabled.
  • 1: The feature is enabled.
Note Supported database types: MySQL, SQL Server, PostgreSQL, PolarDB for Oracle, and ApsaraDB for Redis.
InstanceId String Yes 126****

The ID of the database instance. You can call the GetInstance operation to obtain the instance ID.

SkipTest Boolean No false

Specifies whether to skip connectivity test. Valid values:

  • true: The connectivity test is skipped.
  • false: The connectivity test is not skipped.

Response parameters

Parameter Type Example Description
RequestId String E9BEBF41-4F69-4605-A5D5-A67955173941

The ID of the request.

ErrorCode String UnknownError

The error code that is returned.

ErrorMessage String UnknownError

The error message that is returned.

Success Boolean false

Indicates whether the request was successful. Valid values:

  • true: The request was successful.
  • false: The request failed.

Examples

Sample request

http(s)://[Endpoint]/?Action=UpdateInstance
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<RequestId>E9BEBF41-4F69-4605-A5D5-A67955173941</RequestId>
<Success>true</Success>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "E9BEBF41-4F69-4605-A5D5-A67955173941",
  "Success" : true
}

Error codes

For a list of error codes, visit the API Error Center.