All Products
Search
Document Center

DataWorks:UpdateDISyncTask

Last Updated:Sep 18, 2024

Updates a data synchronization task.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
ProjectIdlongYes

The ID of the DataWorks workspace. You can log on to the DataWorks console and go to the Workspace page to obtain the workspace ID. You must configure this parameter to specify the DataWorks workspace to which the API operation is applied.

10000
TaskTypestringYes

The type of the data synchronization task. Set the value to DI_OFFLINE. You can call the UpdateDISyncTask operation to update only batch synchronization tasks.

DI_OFFLINE
TaskContentstringNo

The updated configurations of the data synchronization task. Calling this API operation to update a data synchronization task is equivalent to updating a data synchronization task by using the code editor in the DataWorks console. For more information, see Create a synchronization task by using the code editor. You can call the UpdateDISyncTask operation to update only batch synchronization tasks. If you do not need to update the configurations of the data synchronization task, leave this parameter empty.

{"type":"job","version":"2.0","steps":[{"stepType":"mysql","parameter":{"envType":1,"datasource":"mysql_pub","column":["id","name","create_time","age","score","t_01"],"connection":[{"datasource":"mysql_pub","table":["u_pk"]}],"where":"","splitPk":"id","encoding":"UTF-8"},"name":"Reader","category":"reader"},{"stepType":"odps","parameter":{"partition":"pt=${bizdate}","truncate":true,"datasource":"odps_first","envType":1,"column":["id","name","create_time","age","score","t_01"],"emptyAsNull":false,"tableComment":"null","table":"u_pk"},"name":"Writer","category":"writer"}],"setting":{"executeMode":null,"errorLimit":{"record":""},"speed":{"concurrent":2,"throttle":false}},"order":{"hops":[{"from":"Reader","to":"Writer"}]}}
TaskParamstringNo

The setting based on which the resource group used by the data synchronization task is updated. You must configure this parameter in the JSON format.

Only the ResourceGroup field is supported. This field specifies the identifier of the resource group for Data Integration that is used by the data synchronization task. You can call the ListResourceGroups operation to query the identifier of the resource group. If you do not need to update the resource group for the data synchronization task, leave this parameter empty.

{"ResourceGroup":"S_res_group_XXX_XXXX"}
FileIdlongYes

The ID of the data synchronization task. You can call the ListFiles operation to query the ID.

1000000

Response parameters

ParameterTypeDescriptionExample
object

The returned result.

Successboolean

Indicates whether the request was successful. Valid values:

  • true
  • false
true
RequestIdstring

The request ID. You can locate logs and troubleshoot issues based on the ID.

0bc1411515937635973****
Dataobject

The information that indicates whether the data synchronization task is updated.

Statusstring

The update status of the data synchronization task. Valid values:

  • success
  • fail
success
Messagestring

The error message returned if the data synchronization task fails to be updated. If the data synchronization task is successfully updated, the value null is returned for this parameter.

ResourceGroup:[S_res_group_XXX] is invalid.

Examples

Sample success responses

JSONformat

{
  "Success": true,
  "RequestId": "0bc1411515937635973****",
  "Data": {
    "Status": "success",
    "Message": "ResourceGroup:[S_res_group_XXX] is invalid."
  }
}

Error codes

HTTP status codeError codeError message
400Invalid.DI.ParameterThe parameter is invalid.
403Forbidden.DI.NoPrivilegeNo access.
500InternalError.DI.ParameterA DI internal error occurred.

For a list of error codes, visit the Service error codes.