PatchTask
General
Description
Use to get task settings and modify settings of existing tasks.
Method
See Modifying settings below.
Required user role
See Required Enterprise Manager permissions.
Request parameters
| Location | Name | Required | Example |
|---|---|---|---|
|
URL |
host [string] |
Yes |
computer.network.net |
|
URL |
ServerName [string] |
Yes |
myrepsrv1 |
|
Header |
EnterpriseManager.APISessionID [string] |
Yes |
wCo0_KvjEUFROvfHF5KGrw |
Body requests
The body should be in JSON format and determine:
-
Setting values that will be changed
-
Settings that will be disabled
As the API reflects the behavior and functionality of the Replicate UI, some settings require certain parent settings to be enabled before they can be modified. For example, it is not possible to enable the Optimize handling when LOB size is less than option when the Replicate LOB columns option is disabled. Therefore, if you are not sure whether the parent settings are enabled, to prevent errors, best practice is to include operations for enabling the parent settings in the request body as well. Examples of how to do this are provided below.
Changing a setting value
Syntax
The syntax for changing a setting value is as follows:
[
{ "op": "add", "path": "full path to setting", "value": new-value }
]Example
The following example shows how to change the Maximum number of tables setting in the Full Load Tuning tab.
[
{ "op": "add", "path": "/full_load_sub_tasks", "value": 100 }
]Reverting to the default setting value
You revert a setting to its default value by using the "remove" command. If the setting is dependent on other settings being enabled, you also need to enable those settings before you can revert the specific setting to its default. If you are aware that the related settings are already enabled, then you can simply use the "remove" operation.
Example
In the following example, the user wants to revert the Chunk size (KB) (lob_chunk_size) setting to its default value. Changing this setting or restoring its default requires the Replicate LOB columns and Allow unlimited LOB size settings to be enabled. Because the user is not sure they are enabled, he includes operations for enabling them in the request body.
[
{ "op": "add", "path": "/common_settings/support_lobs", "value": true },
{ "op": "add", "path": "/common_settings/lob_max_size", "value": 0 },
{ "op": "remove", "path": "/common_settings/lob_chunk_size" }
]
If the user knew beforehand that the Replicate LOB columns and Allow unlimited LOB size settings were enabled, he would only need to include the "remove" operation in the request body.
[
{ "op": "remove", "path": "/common_settings/lob_chunk_size" }
]Enabling or disabling a setting (the equivalent of selecting or clearing a check box)
You enable a setting using the "add" operation. You can disable a setting using the "remove" operation or by setting the value to "false".
Enabling a setting
Syntax
The syntax for enabling a setting is as follows:
[
{ "op": "add", "path": "path_to_setting", "value": true }
]Example
To enable the Replicate LOB columns option:
[
{ "op": "add", "path": "/common_settings/support_lobs", "value": true }
]Disabling a setting using the "remove" operation
Syntax
The syntax for disabling a setting using the "remove" operation is as follows:
[
{ "op": "remove", "path": "path_to_setting" }
]Example
To disable the Replicate LOB columns option:
[
{ "op": "remove", "path": "/common_settings/support_lobs" }
]Disabling a setting by setting its value to "false"
Syntax
The syntax for disabling a setting by setting its value to "false" is as follows:
[
{ "op": "add", "path": "path_to_setting", "value": false }
]Example
To disable the Replicate LOB columns option:
[
{ "op": "add", "path": "/common_settings/support_lobs", "value": false }
]
Modifying settings
HTTP method: PATCH
URL: attunityenterprisemanager/api/v1/servers/<my-replicate-server>/tasks/<my-replicate-task-name>/settings
| UI equivalent | Body with examples |
|---|---|
| Replicate LOB columns |
Enable LOB column replication: Disable LOB column replication: |
| Allow unlimited LOB size |
Set the Limit LOB size to (KB) value to 0: |
| Optimize handling when LOB size is less than |
Enable by setting a Optimize handling when LOB size is less than (inline_lob_max_size) value: |
| Chunk size (KB) |
Override the default Chunk size (lob_chunk_size): |
| Limit LOB size to (KB) |
Set Limit LOB size to (KB) (lob_max_size) to a value greater than 0. |
| Target table schema |
Set a new Target table schema (default_schema): |
HTTP method: PATCH
URL: attunityenterprisemanager/api/v1/servers/<my-replicate-server>/tasks/<my-replicate-task-name>/settings
| UI equivalent | Body with examples |
|---|---|
| Create target control tables in schema |
Set a Create target control tables in schema (control_schema) value: |
| Create target control tables in tablespace |
Set a Create target control tables in tablespace (control_table_tablespace) value: |
| Create target control table indexes in tablespace |
Set a Create target control table indexes in tablespace (control_index_tablespace) value: |
| Replication Status |
Create the Replication Status control table on the target: |
| Update Every (Minutes) |
Specify an Update Every (Minutes) value: |
| Suspended Tables |
Create the Suspended Tables control table on the target: |
| Replication History |
Create the Replication History control table on the target: |
| Update Every (Minutes) |
Specify an Update Every (Minutes) value: |
| DDL History |
Create the DDL History control table on the target: |
| Change Data Partitions |
Create the Change Data Partitions control table on the target: |
HTTP method: PATCH
URL: attunityenterprisemanager/api/v1/servers/<my-replicate-server>/tasks/<my-replicate-task-name>/settings
| UI equivalent | Body with examples |
|---|---|
| Maximum number of tables |
Set a "Maximum number of tables" value: |
HTTP method: PATCH
URL: attunityenterprisemanager/api/v1/servers/<my-replicate-server>/tasks/<my-replicate-task-name>/settings
| UI equivalent | Body with examples |
|---|---|
| Store Changes |
Enable Store Changes (save_changes_enabled): |
| On UPDATE |
Set On UPDATE: Store after image only (skip_before_image): Set On UPDATE: Store before and after image (skip_before_image): |
| Change Data Partitioning: Partition every |
Enable Change Data Partitioning with the default partitioning interval (one hours): Disable Change Data Partitioning: Specify a "Partitioning base time" time value: |
HTTP method: PATCH
URL: attunityenterprisemanager/api/v1/servers/<my-replicate-server>/tasks/<my-replicate-task-name>/settings
| UI equivalent | Body with examples |
|---|---|
| Change Processing Mode |
Switch to "Transactional apply" Switch to "Batch optimized apply" |
HTTP method: PATCH
URL: attunityenterprisemanager/api/v1/servers/<my-replicate-server>/tasks/<my-replicate-task-name>/settings
| UI equivalent | Body with examples |
|---|---|
| Batch Tuning |
Change the "Apply batched changes in intervals: Longer than (seconds)" value Return to the default "Apply batched changes in intervals: Longer than (seconds)" value Change the "Apply batched changes in intervals: But less than (seconds)" value Return to the default "Longer than (seconds)" and "But less than (seconds)" values Override the default "Force apply a batch when processing memory exceeds (MB)" value Return to the default "Force apply a batch when processing memory exceeds (MB)" value Enable "Limit the number of changes applied per change processing statement to" Disable the "Limit the number of changes applied per change processing statement to" |
HTTP method: PATCH
URL: attunityenterprisemanager/api/v1/servers/<my-replicate-server>/tasks/<my-replicate-task-name>/settings
| UI equivalent | Body with examples |
|---|---|
| Batch Tuning |
Change "Minimum number of changes per transaction" value Return to default "Minimum number of changes per transaction" value" Change "Maximum time to batch transactions before applying (seconds)" value Return to default "Minimum number of changes per transaction" value" |
| Transaction Offload Tuning |
Change "Total transactions memory size exceeds (MB)" value: Return to default "Total transactions memory size exceeds (MB):" value: Change "Transactions duration exceeds (seconds)" value Return to default "Transactions duration exceeds (seconds)" |
HTTP method: PUT
URL: attunityenterprisemanager/api/v1/servers/<my-replicate-server>/tasks/<my-replicate-task-name>/loggers
| Action | Body with examples |
|---|---|
| Changing the global logging level |
Change the global logging level to TRACE: Change the global logging level to VERBOSE: Change the global logging level to WARNING: Change the global logging level to ERROR: |
| Change the logging level of a specific component |
Change "UTILITIES" to Trace level: |
| Change the global logging level and the logging level of a specific component |
Change the global logging level to TRACE and the logging level of a specific component to ERROR: |
| Change multiple components to different logging levels |
Change "ADDONS" to VERBOSE and "STREAM" to ERROR |
| Store trace/verbose logging in memory, but if an error occurs write to the logs |
Enable "Store trace/verbose logging in memory, but if an error occurs write to the logs" Disable "Store trace/verbose logging in memory, but if an error occurs write to the logs" Change the "Allocate memory up to (MB)" value: |
HTTP method: PUT
URL: attunityenterprisemanager/api/v1/servers/<my-replicate-server>/tasks/<my-replicate-task-name>/error_behaviors
| Action | Body with examples |
|---|---|
| Environmental Errors |
Change the "Maximum retry count" value:
Restore the default "Maximum retry count"
Disable the "Maximum retry count" option
Enable the "Increase retry interval for long outages" option
Disable the "Increase retry interval for long outages" option
Change the "Maximum retry interval (seconds)" value |
| Data Errors: For data truncation errors |
Set "For data truncation errors: Ignore record"
Set "For data truncation errors: Suspend table"
Set "For data truncation errors: Stop Task"
Set "For data truncation errors: Log record to the exceptions table"
|
| Data Errors: For NOT NULL constraint violations: |
Enable "Check" option for "For NOT NULL constraint violations" Enable "Don't check" option for "For NOT NULL constraint violations" Enable "Endpoint-determined (Check)" option for "For NOT NULL constraint violations" Set "For NOT NULL constraint violations: Ignore record" Set "For NOT NULL constraint violations: Suspend table" Set "For NOT NULL constraint violations: Stop Task" Set "For NOT NULL constraint violations: Log record to the exceptions table" |
| Data Errors: For other data errors |
Set "For data truncation errors: Ignore record" Set "For data truncation errors: Suspend table" Set "For data truncation errors: Stop Task" Set "For data truncation errors: Log record to the exceptions table" Enable "Escalate handling when data errors reach (per table)" checkbox Disable "Escalate handling when data errors reach (per table)" checkbox Set "Escalation action: Stop Task" for data errors Set "Escalation action: Suspend table" for data errors
|
| Table Errors |
Set "When encountering a table error: Stop Task" Set "When encountering a table error: Suspend table" Enable "Escalate handling when data errors reach (per table)" checkbox Disable "Escalate handling when data errors reach (per table)"checkbox |
| Apply Conflict: No record found for applying DELETE |
Set "No record found for applying DELETE: Ignore record" Set "No record found for applying DELETE: Suspend table" Set "No record found for applying DELETE: Stop Task" Set "No record found for applying DELETE: Log record to the exceptions table" |
| Apply Conflict: Duplicate key when applying INSERT |
Set "Duplicate key when applying INSERT:Ignore record" of Apply Conflict Set "Duplicate key when applying INSERT: Suspend table" Set "Duplicate key when applying INSERT: Stop Task" Set "Duplicate key when applying INSERT: Log record to the exceptions table" Set "Duplicate key when applying INSERT: UPDATE the existing target record" |
| Apply Conflict: No record found for applying an UPDATE |
Set "No record found for applying an UPDATE: Ignore record" Set "No record found for applying an UPDATE: Suspend table" Set "No record found for applying an UPDATE: Stop Task" Set "No record found for applying an UPDATE: Log record to the exceptions table" Set "No record found for applying an UPDATE: INSERT the missing target record" |
| Apply Conflict: Escalate handling when data errors reach (per table) |
Enable "Escalate handling when data errors reach (per table)" checkbox Disable "Escalate handling when data errors reach (per table)" checkbox Set "Escalation action: Stop Task" Set "Escalation action: Suspend table" Set "Escalation action: Log record to the exceptions table" |
HTTP method: PUT
URL: attunityenterprisemanager/api/v1/servers/<my-replicate-server>/tasks/<my-replicate-task-name>/properties
| Action | Body with examples |
|---|---|
| Add Valid Description |
Add Description (Uppercase/Lowercase/Numbers/Space/Special Characters) |
| Remove Description |
Remove Description |
HTTP method: PATCH
URL: attunityenterprisemanager/api/v1/servers/<my-replicate-server>/tasks/<my-replicate-task-name>/settings
| Action | Body with examples |
|---|---|
| Add new Feature Flag |
Add new feature flag: |
| Remove Feature Flag |
Remove existing Feature Flag |
Getting settings
You can get the current settings using the Patch Template API or the Get API, depending on which settings you need to get.
-
Use the Patch Template API to get current values for all settings, except Replicate loggers, the task description, and error handling settings.
-
Use the Get API to get current settings for Replicate loggers, the task description, and error handling.
Use this to get current values for all settings, except Replicate loggers, the task description, and error handling settings. For those settings, use the Get API described below.
HTTP method: PUT
URL: attunityenterprisemanager/api/v1/servers/<my-replicate-server>/tasks/<my-replicate-task-name>/settings?action=patch_template
| Action | Body with examples |
|---|---|
| Get the current settings |
Find out if LOB support is enabled, the maximum LOB size, and the target schema: |
Use this to get current settings for Replicate loggers, the task description, and error handling.
HTTP method: GET
URL: attunityenterprisemanager/api/v1/servers/<my-replicate-server>/tasks/<my-replicate-task-name>/<settings-type>
Get the error handling settings:
To get all error handling settings and their values, call:
attunityenterprisemanager/api/v1/servers/<my-replicate-server>/tasks/<my-replicate-task-name>/error_behaviors
Get the task description:
To get the task description, call:
attunityenterprisemanager/api/v1/servers/<my-replicate-server>/tasks/<my-replicate-task-name>/properties
Get the logger settings:
To get the logger settings, call:
attunityenterprisemanager/api/v1/servers/<my-replicate-server>/tasks/<my-replicate-task-name>/loggers
Errors
Apart from specific errors related to settings that are not valid, you might also encounter general errors. For more information on these, see general errors.