Skip to main content

Update Replication Task

Updates the source and target data sources, replication options, and object scope of a specified replication task.

Request URL: /openapi/v1/replication/update

Request Method: POST

Limits

  • Only replication tasks that have not been started can be updated.
  • Updating the replication task specification through OpenAPI is not supported.

Request Parameters

ParameterTypeRequiredDescriptionExample
replicationIdStringYesReplication task ID.rp-div1e4z3z3g3
sourceDatasourceTypeStringYesSource data source type.mongodb
sourceDatasourceIdStringYesSource data source ID. You can query it by calling List Data Sources.ds-source001
targetDatasourceTypeStringYesTarget data source type.mongodb
targetDatasourceIdStringYesTarget data source ID. You can query it by calling List Data Sources.ds-target001
replicationOptionObjectYesReplication task options. See replicationOption Fields.See the example below
objectConfigObjectYesReplication object scope. See objectConfig Fields.See the example below

replicationOption Fields

ParameterTypeRequiredDescriptionExample
migrateSchemaBooleanNoWhether to replicate object schemas. The default value is true.true
migrateDataBooleanNoWhether to replicate existing data. The default value is true.true
incrementalReplicationBooleanNoWhether to replicate incremental data. The default value is false.false
conflictStrategyStringYesData or schema conflict handling strategy. Values: ignore, abort, replace, drop_create.ignore
supportDDLBooleanNoWhether DDL replication is supported. The default value is true. For the backward task of bidirectional replication, this value is fixed to false.true

objectConfig Fields

ParameterTypeRequiredDescriptionExample
allBooleanNoWhether to include all objects in the instance. The default value is false. When set to true, databaseList is not required.true
databaseListArrayNoDatabase object list. Required when all=false. See Database or Schema Object Fields.See the example below

Database or Schema Object Fields

databaseList and schemaList use the same object structure. For a source with a database-table hierarchy, a databaseList element represents a database. For a source with a database-schema-table hierarchy, a schemaList element represents a schema.

ParameterTypeRequiredDescriptionExample
allBooleanNoWhether to include all child objects under the current database or schema. The default value is false.false
allTableBooleanNoWhether to include all tables. The default value is false.true
allViewBooleanNoWhether to include all views. The default value is false.false
allTriggerBooleanNoWhether to include all triggers. The default value is false.false
allEventBooleanNoWhether to include all events. The default value is false.false
allFunctionBooleanNoWhether to include all functions. The default value is false.false
allProcedureBooleanNoWhether to include all procedures. The default value is false.false
schemaListArrayNoSchema object list. Use this field for three-level source structures. Elements use the same fields as this table.See the example below
tableListArrayNoSpecific table object list. Elements use Specified Object Fields.See the example below
viewListArrayNoSpecific view object list. Elements use Specified Object Fields.See the example below
functionListArrayNoSpecific function object list. Elements use Specified Object Fields.See the example below
procedureListArrayNoSpecific procedure object list. Elements use Specified Object Fields.See the example below
eventListArrayNoSpecific event object list. Elements use Specified Object Fields.See the example below
triggerListArrayNoSpecific trigger object list. Elements use Specified Object Fields.See the example below
ddlTriggerListArrayNoSpecific DDL trigger object list. Elements use Specified Object Fields.See the example below
otherStoredObjectListArrayNoOther stored object list. Elements use Specified Object Fields.See the example below

Specified Object Fields

ParameterTypeRequiredDescriptionExample
databaseNameStringYesSource database name.db1
targetDatabaseStringNoTarget database name. Defaults to databaseName.db1_target
schemaNameStringNoSource schema name. This field can be configured for three-level source structures. The default value is null.public
targetSchemaStringNoTarget schema name. This field can be configured for three-level target structures. The default value is null.public_target
objectNameStringYesSource object name.table_a
targetNameStringNoTarget object name. Defaults to objectName.table_a_target

Request Example

{
"replicationId": "rp-div1e4z3z3g3",
"sourceDatasourceType": "mongodb",
"sourceDatasourceId": "ds-source001",
"targetDatasourceType": "mongodb",
"targetDatasourceId": "ds-target001",
"replicationOption": {
"migrateSchema": true,
"migrateData": true,
"incrementalReplication": false,
"conflictStrategy": "ignore",
"supportDDL": true
},
"objectConfig": {
"all": true
}
}

Response Parameters

ParameterTypeDescriptionExample
successBooleanWhether the request was successful.true
requestIdStringRequest ID.Tx1k9FHP-kqrjyGGnjnoo9QBdlsc3XBX
messageStringMessage returned when the request fails.replication rp-xxx not found

Successful Invocation Example

{
"success": true,
"requestId": "Tx1k9FHP-kqrjyGGnjnoo9QBdlsc3XBX"
}