Skip to main content Skip to complementary content

run_task

Run the selected task according to the specified option.

Required User Role: See Required Enterprise Manager permissions.

Syntax

def run_task(

self,

payload,

server,

task,

option = AemRunTaskOptions.Option,

timeout = 30

)

Parameters

Parameters
Parameter Type Description

payload

AemRunTaskReq

-

cdc_position

string

The cdcposition parameter can either be specified inline or in an external JSON file. The format for both is described in Request Body Format for Replicate tasks below.

Mandatory for all AemRunTask options.

server

string

The name of the server on which to run the task.

task

string

  • Replicate: - The name of the task.
  • Compose: - The name of the task or workflow appended with a double underscore and the project name.

    Example:  

    mytask__myproject

option

AemRunTaskOptions

{

NONE = 0,
RESUME_PROCESSING = 1,

RELOAD_TARGET = 2,

RESUME_PROCESSING_FROM_TIMESTAMP = 3,

METADATA_ONLY_RECREATE_ALL_TABLES = 4,

METADATA_ONLY_CREATE_MISSING_TABLES = 5,

RECOVER_USING_LOCALLY_STORED_CHECKPOINT = 6,

RECOVER_USING_CHECKPOINT_STORED_ON_TARGET = 7

RESUME_PROCESSING_FROM_POSITION = 8

}

See also Run options.

For replication tasks, any of the options (except NONE) can be specified. For Compose tasks, only NONE can be specified.

timeout

int

The time, in seconds, to wait for a response.

Request Body Format for Replicate tasks

RESUME_PROCESSING_FROM_TIMESTAMP

If the task option is RESUME_PROCESSING_FROM_TIMESTAMP, then the format should be:

{"cdcposition":"timestamp"}

Example:  

{"cdcposition":"2017-03-07T11:19:03"}

"{\"cdcposition\":\"timestamp\"}"

Example:  

"{\"cdcposition\":\"2017-03-07T11:19:03\"}"

RESUME_PROCESSING_FROM_POSITION

If the task option is RESUME_PROCESSING_FROM_POSITION then, assuming the source database is SQL Server, the format should be:

{"cdcposition":"LSN"}

Example:  

{"cdcposition":"15000000040000037"}

"{\"cdcposition\":\"LSN\"}"

Example:  

"{\"cdcposition\":\"15000000040000037\"}"

RECOVER_USING_CHECKPOINT_STORED_ON_TARGET

If the task option is RECOVER_USING_CHECKPOINT_STORED_ON_TARGET, then the format should be:

{"cdcposition":"target_checkpoint"}

Example:  

{"cdcposition":"Checkpoint:V1#1#timestamp:2017-02-14T12:34:44#0#0#*#0#0"}

"{\"cdcposition\":\"target_checkpoint\"}"

Example:  

"{\"cdcposition\":\"Checkpoint:V1#1#timestamp:2017-02-14T12:34:44#0#0#*#0#0\"}"

Return value

AemRunTaskResp

Return values
Value Type Description
error_message

string

The description of the error.

state

AemTaskState

{

STOPPED = 0,

RUNNING = 1,

ERROR = 2,

RECOVERY = 3

}

The current state of the task.

Errors

All of the general errors as well as the errors listed in the table below.

Error responses
Error Message Description

AEM_TASK_ALREADY_RUNNING

Replicate task {task} on server {server} is already running.

The task cannot be run because it is already running.

AEM_TASK_IN_RECOVERY

Replicate task {task} on server {server} cannot be run as it is in a recovery state.

The task cannot be run because it is in Recovery state.

AEM_WRONG_OPTION_FOR_CDCPOSITION

Replicate task {task] on server {server} cannot be run with cdcposition {position} and option {option}. Change the option to RESUME_PROCESSING_FROM_TIMESTAMP, RESUME_PROCESSING_FROM_POSITION, or RECOVER_USING_CHECKPOINT_STORED_ON_TARGET

This error is returned when the specified option conflicts with the setting in the Advanced Run Options dialog in Replicate.

AEM_CDC_POSITION_ERR_FORMAT

The cdcposition parameter value for Replicate task {task} on server {server} is not in the correct format ('YYYY-MM-DDThh:mm:ssZ').

The cdcPosition parameter must follow this format: YYYY-MM-DDThh:mm:ssZ

Parameters: task name and server name

AEM_RUN_TASK_TIMEOUT

Replicate task {task} on server {server} timed out when requested to “Run”.

The task does not assume a Running state or any other steady state (error or stopped).

AEM_RUN_TASK_INNER_ERR

Replicate task {task} on server {server} encountered an error when requested to run.

Replicate experienced an error/exception when trying to run the task.

AEM_RUN_TASK_NO_SRC_NO_TRG

Replicate task {task} on server {server} has no source or target endpoints.

Task validation revealed that the task is missing a source and a target.

AEM_RUN_TASK_NO_SRC

Replicate task {task} on server {server} has no source endpoint.

Task validation revealed that the task is missing a source.

AEM_RUN_TASK_TRG

Replicate task {task} on server {server} has no target endpoint.

Task validation revealed that the task is missing a target.

AEM_RUN_TASK_NOT_FL_NOR_CDC

Replicate task {task} on server {server} cannot be run without at least one of the replication options enabled (Full Load, Apply Changes, or Store Changes).

Task validation of a unidirectional task revealed that the replication option definition for the task is missing (Full Load, Apply Changes, or Store Changes).

AEM_RUN_BIDI_TASK_NO_FL_NOR_CDC

Replicate task {task} on server {server} cannot be run without at least one of the replication options enabled (Full Load or Apply Changes).

Task validation of a unidirectional task revealed that the replication option definition for the task is missing (Full Load, Apply Changes, or Store Changes).

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!