All Products
Search
Document Center

:UpdateDISyncTask

最終更新日:Mar 13, 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. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter

Type

Required

Example

Description

Action

String

Yes

UpdateDISyncTask

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

ProjectId

Long

Yes

10000

The DataWorks workspace ID. 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.

TaskType

String

Yes

DI_OFFLINE

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.

TaskContent

String

No

{"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_source","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"}]}}

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 data 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.

TaskParam

String

No

{"ResourceGroup":"S_res_group_XXX_XXXX"}

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.

FileId

Long

Yes

1000000

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

Response parameters

Parameter

Type

Example

Description

Success

Boolean

true

Indicates whether the request was successful. Valid values:

  • true

  • false

RequestId

String

0bc1411515937635973****

The request ID. You can use the ID to locate logs and troubleshoot issues.

Data

Object

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

Status

String

success

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

  • success

  • fail

Message

String

ResourceGroup:[S_res_group_XXX] is invalid.

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

Examples

Sample requests

http(s)://[Endpoint]/?Action=UpdateDISyncTask
&FileId=1000000
&ProjectId=10000
&RegionId=cn-zhangjiakou
&TaskContent={"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_source","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"}]}}
&TaskParam={"ResourceGroup":"S_res_group_XXX_XXXX"}
&TaskType=DI_OFFLINE
&<Common request parameters>

Sample success responses

XML format

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

<RequestId>0bc1411515937635973****</RequestId>
<Data>
    <Status>success</Status>
    <Message>ResourceGroup:[S_res_group_XXX] is invalid.</Message>
</Data>
<Success>true</Success>

JSON format

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

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

Error codes

HTTP status code

Error code

Error message

Description

400

Invalid.DI.Parameter

The parameter is invalid.

One or more parameters are invalid.

403

Forbidden.DI.NoPrivilege

No access.

You do not have the required permissions.

500

InternalError.DI.Parameter

A DI internal error occurred.

An internal error has occurred in Data Integration.

For a list of error codes, see Service error codes.