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.RESUME_PROCESSING,
timeout = 30
)
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 |
|
option |
AemRunTaskOptions { NONE = 0, 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 } |
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
If the task option (see above) is RESUME_PROCESSING_FROM_TIMESTAMP, then use the following format:
JSON File Format:
{"cdcposition":"timestamp"}
Example:
{"cdcposition":"2017-03-07T11:19:03"}
Inline Format:
"{\"cdcposition\":\"timestamp\"}"
Example:
"{\"cdcposition\":\"2017-03-07T11:19:03\"}"
If the task option (see above) is RECOVER_USING_CHECKPOINT_STORED_ON_TARGET, then use the following format:
JSON File Format:
{"cdcposition":"target_checkpoint"}
Example:
{"cdcposition":"Checkpoint:V1#1#timestamp:2017-02-14T12:34:44#0#0#*#0#0"}
Inline Format:
"{\"cdcposition\":\"target_checkpoint\"}"
Example:
"{\"cdcposition\":\"Checkpoint:V1#1#timestamp:2017-02-14T12:34:44#0#0#*#0#0\"}"
Return value
AemRunTaskResp
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 | 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 or RECOVER_USING_CHECKPOINT_STORED_ON_TARGET. |
When the option Tables are already loaded. Start processing changes from Timestamp is selected in the Advanced Run Options dialog box for a task, the option sent to the API must be RESUME_PROCESSING_FROM_TIMESTAMP. |
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). |