Task Manager Services
The Task Manager provides a representational state transfer (REST) API that enables you to both run various tasks and perform action on a currently running task. The following provide examples of the ways you can use this API.
Add Collection
The following example shows how you can run the Add Collection task with the REST API.
URL
http://server:port/TaskManager/rest/TaskManagerRest/runTask
Method
POST
The request has the following parameters:
◦ Content-Type – application json
◦ Authorization – Basic Authorization
◦ X-XSRF-TOKEN – static value
Data Parameter (JSON)
The data parameter is a JSON file (AddCollection.json):
{
"taskManagerCommands":
[
{
"publication_name":"Co7",
"name":"Add Collection",
"action":"run",
"s1000D_publication":"false",
"list_manuals":"<Publications>
<Publication name=\"Col1\">
<Manual name=\"BOM\" title=\"BOM\" format=\"xml
\" type=\"BOM\" model=\"NO_MODEL_ATTR\"/>
<Manual name=\"DOCRELATION\" title=\"DOCRELATION
\" format=\"xml\" type=\"DOCRELATION
\" model=\"NO_MODEL_ATTR\"/>
</Publication>
</Publications>",
"site_groups":"<SiteGroups><Group id=\"Preview\"/></SiteGroups>",
"segment_title":"Seg1",
"content_type":"Product Related Content",
"list_categories":"",
"rEDEPLOY_FLAG":"null",
"site_groups_selected":"true",
"assets_folder_path":"/opt/InService/InS_SW/SW/System/Assets",
"publication_title":"Col1",
"comment":"Col1",
"segment_id":"Seg1",
"list_contexts":"Context1"
}
]
}
Authentication
Basic
Data Parameter
None
Success Response
200 – Okay
Error Response
400 – BAD_REQUEST
401 – Unauthorized Request
500 – Internal Server Error
Deploy Collection
The following example shows how you can run the Deploy Collection task with the REST API.
URL
http://server:port/TaskManager/rest/TaskManagerRest/runTask
Method
POST
The request has the following parameters:
◦ Content-Type – application json
◦ Authorization – Basic Authorization
◦ X-XSRF-TOKEN – static value
Data Parameter (JSON)
The data parameter is a JSON file (DeployCollection.json):
{
"taskManagerCommands":
[
{
"publication_name":"Co7",
"name":"Deploy Collection",
"action":"run",
"profile_name":"ASSETS_Co7",
"update_type":"Assets",
"reset_index":"false",
"site_groups":"Preview",
"coreLogicGroup":"default",
"mode":"PublishToRuntime",
"monitoring_name":"Run Deploy Pub",
"list_contexts":"Context1",
"list_categories":"",
"publication_title":"Col1",
"P2RTLoadType":"CollectionProfile",
"pauseBeforeExpose":"false",
"isCoordinatorMode":"false"
}
]
}
Authentication
Basic
Data Parameter
None
Success Response
200 – Okay
Error Response
400 – BAD_REQUEST
401 – Unauthorized Request
500 – Internal Server Error
Get Task Status
The following example shows how you can check the status of a currently running task with the REST API. Note that you must provide the identifier for the task.
URL
http://server:port/TaskManager/rest/TaskManagerRest/runTask
Method
POST
The request has the following parameters:
◦ Content-Type – application json
◦ Authorization – Basic Authorization
◦ X-XSRF-TOKEN – static value
Data Parameter (JSON)
The data parameter is a JSON file (GetTaskStatus.json):
{
"taskManagerCommands":
[
{"action":"getStatus",
"tid":"20313"}
]
}
Authentication
Basic
Data Parameter
None
Success Response
200 – Okay
Error Response
400 – BAD_REQUEST
401 – Unauthorized Request
500 – Internal Server Error
Transform and Load a Bundle
The following example shows how you can run the Transform and Load a Bundle task with the REST API.
URL
http://server:port/TaskManager/rest/TaskManagerRest/runTask
Method
POST
The request has the following parameters:
◦ Content-Type – application json
◦ Authorization – Basic Authorization
◦ X-XSRF-TOKEN – static value
Data Parameter (JSON)
The data parameter is a JSON file (TransformANDLoadBundle.json):
{
"taskManagerCommands":
[
{
"name":"Transform and Load a Bundle",
"action":"run",
"bundleFolder":"/vagrant/Bundles/PH",
"partsFamily":"PARTS",
"updateIfTimestampEqual":"false",
"site_groups":"Preview",
"shouldValidate":"false",
"paramsList":"site_groups:convertCGMToSVG:updateIfTimestampEqual",
"rollback":"no",
"S1000DVersion":"4.0",
"logLevel":"10",
"pauseAfterTransform":"false",
"publication_title":"Col1",
"convertCGMToSVG":"false",
"isInitialDataLoad":"false"
}
]
}
Authentication
Basic
Data Parameter
None
Success Response
200 – Okay
Error Response
400 – BAD_REQUEST
401 – Unauthorized Request
500 – Internal Server Error
Transform and Load (Initial Load)
The following example shows how you can run the Transform and Load task with the REST API when you are doing the initial load of the data.
URL
http://server:port/TaskManager/rest/TaskManagerRest/runTask
Method
POST
The request has the following parameters:
◦ Content-Type – application json
◦ Authorization – Basic Authorization
◦ X-XSRF-TOKEN – static value
Data Parameter (JSON)
The data parameter is a JSON file (Transform and Load [TransformMgmtInitialLoad].json):
{
"taskManagerCommands":
[
{
"name":"Transform and Load",
"action":"run",
"rootFolder":"/vagrant/Bundles",
"partsFamily":"PARTS",
"updateIfTimestampEqual":"false",
"shouldValidate":"false",
"paramsList":"site_groups:convertCGMToSVG:updateIfTimestampEqual",
"site_groups":"Preview",
"rollback":"no",
"isInitialLoad" : "yes",
"S1000DVersion":"4.0",
"logLevel":"10",
"convertCGMToSVG":"false",
}
]
}
Authentication
Basic
Data Parameter
None
Success Response
200 – Okay
Error Response
400 – BAD_REQUEST
401 – Unauthorized Request
500 – Internal Server Error
Transform and Load
The following example shows how you can run the Transform and Load task with the REST API.
URL
http://server:port/TaskManager/rest/TaskManagerRest/runTask
Method
POST
The request has the following parameters:
◦ Content-Type – application json
◦ Authorization – Basic Authorization
◦ X-XSRF-TOKEN – static value
Data Parameter (JSON)
The data parameter is a JSON file (Transform and Load [TranformManagement].json):
{
"taskManagerCommands":
[
{
"name":"Transform and Load",
"action":"run",
"rootFolder":"/vagrant/Bundles",
"partsFamily":"PARTS",
"updateIfTimestampEqual":"false",
"shouldValidate":"false",
"paramsList":"site_groups:convertCGMToSVG:updateIfTimestampEqual",
"site_groups":"Preview",
"rollback":"no",
"isInitialLoad" : "no",
"S1000DVersion":"4.0",
"logLevel":"10",
"convertCGMToSVG":"false",
}
]
}
Authentication
Basic
Data Parameter
None
Success Response
200 – Okay
Error Response
400 – BAD_REQUEST
401 – Unauthorized Request
500 – Internal Server Error
Delete Task
The following example shows how you can delete a currently running task with the REST API. Note that you must provide the identifier for the task.
URL
http://server:port/TaskManager/rest/TaskManagerRest/runTask
Method
POST
The request has the following parameters:
◦ Content-Type – application json
◦ Authorization – Basic Authorization
◦ X-XSRF-TOKEN – static value
Data Parameter (JSON)
The data parameter is a JSON file (DeleteTask.json):
{
"taskManagerCommands":
[
{"action":"delete",
"tid":"1748"}
]
}
Authentication
Basic
Data Parameter
None
Success Response
200 – Okay
Error Response
400 – BAD_REQUEST
401 – Unauthorized Request
500 – Internal Server Error
Delete Segment From Sites
The following example shows how you can run the Delete Segment From Sites task with the REST API.
URL
http://server:port/TaskManager/rest/TaskManagerRest/runTask
Method
POST
The request has the following parameters:
◦ Content-Type – application json
◦ Authorization – Basic Authorization
◦ X-XSRF-TOKEN – static value
Data Parameter (JSON)
The data parameter is a JSON file (DeleteSegmentFromSite.json):
{
"taskManagerCommands":
[
{
"name":"Delete Segment From Sites",
"action":"run",
"publication_name":"SEG1",
"site_groups":"Preview"
}
]
}
Authentication
Basic
Data Parameter
None
Success Response
200 – Okay
Error Response
400 – BAD_REQUEST
401 – Unauthorized Request
500 – Internal Server Error
Resume Task
The following example shows how you can resume a currently paused task with the REST API. Note that you must provide the identifier for the task.
URL
http://server:port/TaskManager/rest/TaskManagerRest/runTask
Method
POST
The request has the following parameters:
◦ Content-Type – application json
◦ Authorization – Basic Authorization
◦ X-XSRF-TOKEN – static value
Data Parameter (JSON)
The data parameter is a JSON file (Resume.json):
{
"taskManagerCommands":
[
{"action":"resume",
"tid":"5576"}
]
}
Authentication
Basic
Data Parameter
None
Success Response
200 – Okay
Error Response
400 – BAD_REQUEST
401 – Unauthorized Request
500 – Internal Server Error
Pause Task
The following example shows how you can pause a currently running task with the REST API. Note that you must provide the identifier for the task.
URL
http://server:port/TaskManager/rest/TaskManagerRest/runTask
Method
POST
The request has the following parameters:
◦ Content-Type – application json
◦ Authorization – Basic Authorization
◦ X-XSRF-TOKEN – static value
Data Parameter (JSON)
The data parameter is a JSON file (PauseAction.json):
{
"taskManagerCommands":
[
{"action":"pause",
"tid":"5642"}
]
}
Authentication
Basic
Data Parameter
None
Success Response
200 – Okay
Error Response
400 – BAD_REQUEST
401 – Unauthorized Request
500 – Internal Server Error
Abort Task
The following example shows how you can abort a currently running task with the REST API. Note that you must provide the identifier for the task.
URL
http://server:port/TaskManager/rest/TaskManagerRest/runTask
Method
POST
The request has the following parameters:
◦ Content-Type – application json
◦ Authorization – Basic Authorization
◦ X-XSRF-TOKEN – static value
Data Parameter (JSON)
The data parameter is a JSON file (AbortTask.json):
{
"taskManagerCommands":
[
{"action":"abort",
"tid":"5642"}
]
}
Authentication
Basic
Data Parameter
None
Success Response
200 – Okay
Error Response
400 – BAD_REQUEST
401 – Unauthorized Request
500 – Internal Server Error
Add Category To a Non Product Collection
The following example shows how you can run the Add Category To a Non Product Collection task with the REST API.
URL
http://server:port/TaskManager/rest/TaskManagerRest/runTask
Method
POST
The request has the following parameters:
◦ Content-Type – application json
◦ Authorization – Basic Authorization
◦ X-XSRF-TOKEN – static value
Data Parameter (JSON)
The data parameter is a JSON file (Add Category.json):
{
"taskManagerCommands":
[
{
"name":"Add Category",
"action":"run",
"publication_name":"Col2",
"list_categories": "PARTDOCUMENTS"
"list_contexts":"0000014982,0000015163,0000022202"
"segment_id":"Seg2",
}
]
}
Another example (for the SHARED segment):
{
"taskManagerCommands":
[
{
"name":"Add Category",
"action":"run",
"publication_name":"PARTDOCUMENTS",
"list_categories": "PARTDOCUMENTS",
"list_contexts":"PARTDOCUMENTS",
"segment_id":"SHARED",
}
]
}
Authentication
Basic
Data Parameter
None
Success Response
200 – Okay
Error Response
400 – BAD_REQUEST
401 – Unauthorized Request
500 – Internal Server Error
Publish To Site
The following example shows how you can run the Publish To Site task with the REST API.
URL
http://server:port/TaskManager/rest/TaskManagerRest/runTask
Method
POST
The request has the following parameters:
◦ Content-Type – application json
◦ Authorization – Basic Authorization
◦ X-XSRF-TOKEN – static value
Data Parameter (JSON)
The data parameter is a JSON file (Publish To Site.json):
{
"taskManagerCommands":
[
{
"name":"Publish To Site",
"action":"run",
"publication_name":"ALL",
"loadToMasterSiteOnly" : "false",
"isSynchExpose" : "false",
"pauseBeforeExpose" : "false",
"site_groups" : "Preview"
}
]
}
Authentication
Basic
Data Parameter
None
Success Response
200 – Okay
Error Response
400 – BAD_REQUEST
401 – Unauthorized Request
500 – Internal Server Error
Remove Segment Configuration Setting
The following example shows how you can run the Remove Segment Configuration Setting task with the REST API.
URL
http://server:port/TaskManager/rest/TaskManagerRest/runTask
Method
POST
The request has the following parameters:
◦ Content-Type – application json
◦ Authorization – Basic Authorization
◦ X-XSRF-TOKEN – static value
Data Parameter (JSON)
The data parameter is a JSON file (Remove Segment Configuration Setting.json):
{
"taskManagerCommands":
[
{
"name":"Remove Segment Configuration Setting",
"action":"run",
"publication_name":"SEG1",
"site_groups":"Preview"
}
]
}
Authentication
Basic
Data Parameter
None
Success Response
200 – Okay
Error Response
400 – BAD_REQUEST
401 – Unauthorized Request
500 – Internal Server Error
Add Context To a Collection
The following example shows how you can run the Add Context To a Collection task with the REST API.
URL
http://server:port/TaskManager/rest/TaskManagerRest/runTask
Method
POST
The request has the following parameters:
◦ Content-Type – application json
◦ Authorization – Basic Authorization
◦ X-XSRF-TOKEN – static value
Data Parameter (JSON)
The data parameter is a JSON file (Add Context.json):
{
"taskManagerCommands":
[
{
"name":"Add Context",
"action":"run",
"publication_name":"KMT-EX",
"list_categories":"",
"list_contexts":"KMT-EX,XYZ",
"segment_id":"KMT-EX-Seg",
"site_groups":"<SiteGroups><Group id=\"Preview\"/></SiteGroups>"
}
]
}
Authentication
Basic
Data Parameter
None
Success Response
200 – Okay
Error Response
400 – BAD_REQUEST
401 – Unauthorized Request
500 – Internal Server Error
Add Data Type
The following example shows how you can run the Add Data Type task with the REST API.
URL
http://server:port/TaskManager/rest/TaskManagerRest/runTask
Method
POST
The request has the following parameters:
◦ Content-Type – application json
◦ Authorization – Basic Authorization
◦ X-XSRF-TOKEN – static value
Data Parameter (JSON)
The data parameter is a JSON file (Add Data Type.json):
{
"taskManagerCommands":
[
{
"name":"Add Data Type",
"action":"run",
"publication_name":"KMT-EX",
"multi_publications":"false",
"model_attr_value":"NO_MODEL_ATTR",
"manual":"P2CRELATION",
"manual_type":"P2CRELATION",
"site_groups":"",
"publication_names":"null",
"site_groups_selected":"false",
"REDEPLOY_FLAG":"null",
"assets_folder_path":"${enigma.bin.home}/System/Assets",
"comment":"KMT-EX",
"manual_title":"P2CRELATION",
"manual_format":"xml"
}
]
}
Authentication
Basic
Data Parameter
None
Success Response
200 – Okay
Error Response
400 – BAD_REQUEST
401 – Unauthorized Request
500 – Internal Server Error
Clean Transformation and Loading temporary Data
The following example shows how you can run the Clean Transformation and Loading temporary Data task with the REST API.
URL
http://server:port/TaskManager/rest/TaskManagerRest/runTask
Method
POST
The request has the following parameters:
◦ Content-Type – application json
◦ Authorization – Basic Authorization
◦ X-XSRF-TOKEN – static value
Data Parameter (JSON)
The data parameter is a JSON file (Clean Transformation and Loading temporary Data.json):
{
"taskManagerCommands":
[
{
"name":"Clean Transformation and Loading temporary Data",
"action":"run",
"bundlesRootFolder":"/vagrant/Bundles/PH",
"cleanupState":"",
"archivingPath":"",
"deleteClonepacket":"true"
}
]
}
Authentication
Basic
Data Parameter
None
Success Response
200 – Okay
Error Response
400 – BAD_REQUEST
401 – Unauthorized Request
500 – Internal Server Error
Export Site Content
The following example shows how you can run the Export Site Content task with the REST API.
URL
http://server:port/TaskManager/rest/TaskManagerRest/runTask
Method
POST
The request has the following parameters:
◦ Content-Type – application json
◦ Authorization – Basic Authorization
◦ X-XSRF-TOKEN – static value
Data Parameter (JSON)
The data parameter is a JSON file (Create Backup From Site.json):
{
"taskManagerCommands":
[
{
"name":"Create Backup From Site",
"action":"run",
"siteId" : "Preview",
"isFullBackupFromSiteTask" : "true"
}
]
}
Authentication
Basic
Data Parameter
None
Success Response
200 – Okay
Error Response
400 – BAD_REQUEST
401 – Unauthorized Request
500 – Internal Server Error
Create Offline Packet
The following example shows how you can run the Create Offline Packet task with the REST API.
URL
http://server:port/TaskManager/rest/TaskManagerRest/runTask
Method
POST
The request has the following parameters:
◦ Content-Type – application json
◦ Authorization – Basic Authorization
◦ X-XSRF-TOKEN – static value
Data Parameter (JSON)
The data parameter is a JSON file (Create Offline Packet.json):
{
"taskManagerCommands":
[
{
"name":"Create Offline Packet",
"action":"run",
"publication_name" : "Seg1",
"siteId" : "Preview",
"postProcessPath" : "${enigma.config.home}/System/Config/Flows/
SACreatorForOffline/postProcessForSA.xml"
}
]
}
Authentication
Basic
Data Parameter
None
Success Response
200 – Okay
Error Response
400 – BAD_REQUEST
401 – Unauthorized Request
500 – Internal Server Error
Delete Collection From Sites
The following example shows how you can run the Delete Collection From Sites task with the REST API.
URL
http://server:port/TaskManager/rest/TaskManagerRest/runTask
Method
POST
The request has the following parameters:
◦ Content-Type – application json
◦ Authorization – Basic Authorization
◦ X-XSRF-TOKEN – static value
Data Parameter (JSON)
The data parameter is a JSON file (Delete Collection From Sites.json):
{
"taskManagerCommands":
[
{
"name":"Delete Collection From Sites",
"action":"run",
"publication_name":"PARTS",
"site_groups":"<SiteGroups><Group id=\"Preview\"/></SiteGroups>"
}
]
}
Authentication
Basic
Data Parameter
None
Success Response
200 – Okay
Error Response
400 – BAD_REQUEST
401 – Unauthorized Request
500 – Internal Server Error
Deploy Assets
The following example shows how you can run the Deploy Assets task with the REST API.
URL
http://server:port/TaskManager/rest/TaskManagerRest/runTask
Method
POST
The request has the following parameters:
◦ Content-Type – application json
◦ Authorization – Basic Authorization
◦ X-XSRF-TOKEN – static value
Data Parameter (JSON)
The data parameter is a JSON file (Deploy Assets.json):
{
"taskManagerCommands":
[
{
"name":"Deploy Assets",
"action":"run",
"site_groups":"Preview",
"isSynchExpose":"false",
"reset_index":"false",
"pauseBeforeExpose":"false",
"isCoordinatorMode":"false"
}
]
}
Authentication
Basic
Data Parameter
None
Success Response
200 – Okay
Error Response
400 – BAD_REQUEST
401 – Unauthorized Request
500 – Internal Server Error
Remove Collection Configuration Setting
The following example shows how you can run the Remove Collection Configuration Setting task with the REST API.
URL
http://server:port/TaskManager/rest/TaskManagerRest/runTask
Method
POST
The request has the following parameters:
◦ Content-Type – application json
◦ Authorization – Basic Authorization
◦ X-XSRF-TOKEN – static value
Data Parameter (JSON)
The data parameter is a JSON file (Remove Collection Configuration Setting.json):
{
"taskManagerCommands":
[
{
"name":"Remove Collection Configuration Settting",
"action":"run",
"publication_name":"PARTS",
"taskName" : "Remove Collection Setting"
}
]
}
Authentication
Basic
Data Parameter
None
Success Response
200 – Okay
Error Response
400 – BAD_REQUEST
401 – Unauthorized Request
500 – Internal Server Error
Transform and Load CSV Data
The following example shows how you can run the Transform and Load CSV Data task with the REST API.
URL
http://server:port/TaskManager/rest/TaskManagerRest/runTask
Method
POST
The request has the following parameters:
◦ Content-Type – application json
◦ Authorization – Basic Authorization
◦ X-XSRF-TOKEN – static value
Data Parameter (JSON)
The data parameter is a JSON file (Transform and Load CSV Data.json):
{
"taskManagerCommands":
[
{
"name":"Transform and Load CSV Data",
"action":"run",
"inputFolder":"/vagrant/CSVBundle",
"site_groups":"Preview",
"pauseAfterTransform":"false",
"piOnly" : "false",
"collectionName" : "",
"orgName" : "",
"paramsList":"site_groups:convertCGMToSVG",
"convertCGMToSVG":"false",
"inputFolderInternal" : "/vagrant/CSVBundle",
"bundleCategory" : "None"
}
]
}
Authentication
Basic
Data Parameter
None
Success Response
200 – Okay
Error Response
400 – BAD_REQUEST
401 – Unauthorized Request
500 – Internal Server Error
Updates Assets In Publication Manager
The following example shows how you can run the Updates Assets In Publication Manager task with the REST API.
URL
http://server:port/TaskManager/rest/TaskManagerRest/runTask
Method
POST
The request has the following parameters:
◦ Content-Type – application json
◦ Authorization – Basic Authorization
◦ X-XSRF-TOKEN – static value
Data Parameter (JSON)
The data parameter is a JSON file (Updates Assets In Publication Manager.json):
{
"taskManagerCommands":
[
{
"name":"Update Assets In Publication Manager",
"action":"run",
"assets_folder_path":"${enigma.bin.home}/System/Assets"
}
]
}
Authentication
Basic
Data Parameter
None
Success Response
200 – Okay
Error Response
400 – BAD_REQUEST
401 – Unauthorized Request
500 – Internal Server Error