Managing Masking Job Driver Support Tasks
Enabling tasks is possible via POST /jobs
and PUT /jobs/{job_id}
. Disabling tasks is possible via PUT /jobs/{job_id}
.
Create Masking Job That Enables Tasks¶
Info
This assumes a ruleset using the desired extended connector already exists. The following example demonstrates the creation of an in-place masking job on an extended connector. This also assumes you know the ID of the task that you want to enable and have execute as part of a given masking job.
- Create a masking job using the ruleset you created earlier that targets the extended connector
- Format the request body as follows:
{
"jobName": "Hana IP job",
"rulesetId": 1,
"jobDescription": "Job description",
"onTheFlyMasking": false,
"enabledTasks": [
{
"taskId": 1
},
{
"taskId": 3
}
]
}
Info
The request body is almost exactly the same as the example API calls for creating and running masking jobs; the difference is that to enable tasks to execute as part of a masking job on an extended connector, you need to ensure the ruleset points to an extended connector that is using a JDBC driver with a driver support and include the property enabledTasks
in your request.
The response will look similar to the following with a return status of 200:
{
"maskingJobId": 1,
"jobName": "Hana IP job",
"rulesetId": 1,
"rulesetType": "table",
"createdBy": "admin",
"createdTime": "2021-04-27T21:29:46.043+00:00",
"feedbackSize": 50000,
"jobDescription": "Job description",
"maxMemory": 1024,
"minMemory": 1024,
"multiTenant": false,
"numInputStreams": 1,
"onTheFlyMasking": false,
"databaseMaskingOptions": {
"batchUpdate": true,
"commitSize": 10000,
"disableConstraints": false,
"dropIndexes": false,
"disableTriggers": false,
"numOutputThreadsPerStream": 1,
"truncateTables": false
},
"failImmediately": false,
"enabledTasks": [
{
"taskId": 1
},
{
"taskId": 3
}
],
"streamRowLimit": 20000
}
Disable Tasks¶
Using the above request body as an example, to disable the formerly enabled task with an ID of 1, the request body to PUT /masking-jobs/1
should exclude the object in enabledTasks
with "taskId": 1
. That is, the request body should be:
{
"jobName": "Hana IP job",
"rulesetId": 1,
"jobDescription": "Job description",
"onTheFlyMasking": false,
"enabledTasks": [
{
"taskId": 3
}
]
}
The job will now only have the task with an ID of 3 enabled. The response will look similar to the following with a return status of 200:
{
"maskingJobId": 1,
"jobName": "Hana IP job",
"rulesetId": 1,
"rulesetType": "table",
"createdBy": "admin",
"createdTime": "2021-04-27T21:29:46.043+00:00",
"feedbackSize": 50000,
"jobDescription": "Job description",
"maxMemory": 1024,
"minMemory": 1024,
"multiTenant": false,
"numInputStreams": 1,
"onTheFlyMasking": false,
"databaseMaskingOptions": {
"batchUpdate": true,
"commitSize": 10000,
"disableConstraints": false,
"dropIndexes": false,
"disableTriggers": false,
"numOutputThreadsPerStream": 1,
"truncateTables": false
},
"failImmediately": false,
"enabledTasks": [
{
"taskId": 3
}
],
"streamRowLimit": 20000
}