Help Center/ Data Replication Service/ API Reference/ APIs V3.0 (Deprecated)/ Public API Management/ Changing the Passwords of the Source and Destination Databases in Batches
Updated on 2024-01-30 GMT+08:00

Changing the Passwords of the Source and Destination Databases in Batches

Function

This API is used to change the passwords of the source and destination databases after a task is started.

Debugging

You can debug the API in API Explorer to support automatic authentication. API Explorer can automatically generate and debug example SDK code.

Constraints

  • This API can be called only when the task is in the STARTJOBING, STARTJOB_FAILED, FULL_TRANSFER_STARTED, FULL_TRANSFER_FAILED, FULL_TRANSFER_COMPLETE, INCRE_TRANSFER_STARTED, INCRE_TRANSFER_FAILED or PAUSING state.
  • In the dual-active DR scenario, the parent task cannot call the API.

URI

PUT /v3/{project_id}/jobs/batch-modify-pwd

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region.

For details about how to obtain the project ID, see Obtaining a Project ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

The content type.

The default value is application/json.

X-Auth-Token

Yes

String

User token obtained from IAM.

X-Language

No

String

Request language type

Default value: en-us

Values:

  • en-us
  • zh-cn
Table 3 Request body parameters

Parameter

Mandatory

Type

Description

jobs

Yes

Array of objects

List of database passwords to be changed in batches.

For details, see Table 4.

Table 4 Data structure description of field jobs

Parameter

Mandatory

Type

Description

db_password

Yes

String

Database password.

end_point_type

Yes

String

Type. so indicates the source database. ta indicates the destination database.

Values:

  • so
  • ta

job_id

Yes

String

Task ID.

kerberos

No

Object

Information required for Kerberos authentication.

For details, see Table 5.

Table 5 Data structure description of field kerberos

Parameter

Mandatory

Type

Description

krb5_conf_file

No

String

krb5 configuration file.

key_tab_file

No

String

Key file.

domain_name

No

String

Domain name.

user_principal

No

String

Kerberos user object.

Response Parameters

Status code: 200

Table 6 Response body parameters

Parameter

Type

Description

count

Integer

Total number.

results

Array of objects

List of tasks that are modified in batches.

For details, see Table 7.

Table 7 Data structure description of field results

Parameter

Type

Description

id

String

Task ID.

status

String

Status Values:

  • success: The task is successful.
  • failed: The task fails.

end_point_type

String

Type. so indicates the source database. ta indicates the destination database.

error_code

String

Error code.

error_msg

String

Error message.

Example Request

Changing the passwords of the source and destination databases of specified tasks in batches

https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/batch-modify-pwd

{
  "jobs" : [ {
    "db_password" : "********",
    "end_point_type" : "so",
    "job_id" : "25df459d-a37c-41b9-bc2b-8c00ba32jb52"
  }, {
    "db_password" : "********",
    "end_point_type" : "ta",
    "job_id" : "25df459d-a37c-41b9-bc2b-8c00ba32jb52"
  } ]
}

Example Response

Status code: 200

OK

{
  "results" : [ {
    "id" : "8d0e8e36-a618-490d-8a46-8c61ac9jb502",
    "status" : "success",
    "end_point_type" : "so"
  }, {
    "id" : "8d0e8e36-a618-490d-8a46-8c61ac9jb502",
    "status" : "success",
    "end_point_type" : "ta"
  } ],
  "count" : 2
}

Status Code

Status Code

Description

200

OK

400

Bad Request

Error Code

For details, see Error Code.