Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
covenant_bi
Creator
Creator

QRS API for enabling/disabling tasks

Is there a way to write a call using QRS API to disable/enable tasks in QMC?  For example, if you had a source system upgrade and you wanted to disable certain tasks from running while the source system was reloading data?  I checked the documentation and didn't see anything related to that specifically, more start/stop vs enable/disable.  

1 Solution

Accepted Solutions
Levi_Turner
Employee
Employee

Hey @covenant_bi , 

There is an enabled element of a reloadtask. So for example take this reload task (I will be truncating elements of the response):

{
  "id": "4b6e407f-7264-4740-883f-acfe7632c115",
  "createdDate": "2019-01-25T14:38:29.58Z",
  "modifiedDate": "2020-06-25T10:23:31.055Z",
  "modifiedByUserName": "...",
  "customProperties": [],
  "app": {
    "id": "dc3c4cdc-2fe7-48fb-b080-8ee5c08cc1f3",
    "name": "PostgreSQL Monitoring",
    ...,
  "isManuallyTriggered": false,
  "operational": {
    ...,
  "name": "Reload task of PostgreSQL Monitoring",
  "taskType": 0,
  "enabled": true,
  "taskSessionTimeout": 1440,
  "maxRetries": 0,
  "tags": [],
  "privileges": null,
  "schemaPath": "ReloadTask"
}

 So if you do a GET /qrs/reloadtask/{id} and modify the enabled element then do a PUT /qrs/reloadtask/{id} then that should handle the scenario.

Inside of Qlik-CLI it can be done like so (with just an example filter):

(Get-QlikReloadTask -Filter "app.stream.name eq 'Monitoring Apps'").id | ForEach-Object {Update-QlikReloadTask -id $_ -Enabled $false}

 

Cheers

View solution in original post

2 Replies
Levi_Turner
Employee
Employee

Hey @covenant_bi , 

There is an enabled element of a reloadtask. So for example take this reload task (I will be truncating elements of the response):

{
  "id": "4b6e407f-7264-4740-883f-acfe7632c115",
  "createdDate": "2019-01-25T14:38:29.58Z",
  "modifiedDate": "2020-06-25T10:23:31.055Z",
  "modifiedByUserName": "...",
  "customProperties": [],
  "app": {
    "id": "dc3c4cdc-2fe7-48fb-b080-8ee5c08cc1f3",
    "name": "PostgreSQL Monitoring",
    ...,
  "isManuallyTriggered": false,
  "operational": {
    ...,
  "name": "Reload task of PostgreSQL Monitoring",
  "taskType": 0,
  "enabled": true,
  "taskSessionTimeout": 1440,
  "maxRetries": 0,
  "tags": [],
  "privileges": null,
  "schemaPath": "ReloadTask"
}

 So if you do a GET /qrs/reloadtask/{id} and modify the enabled element then do a PUT /qrs/reloadtask/{id} then that should handle the scenario.

Inside of Qlik-CLI it can be done like so (with just an example filter):

(Get-QlikReloadTask -Filter "app.stream.name eq 'Monitoring Apps'").id | ForEach-Object {Update-QlikReloadTask -id $_ -Enabled $false}

 

Cheers

covenant_bi
Creator
Creator
Author

Levi, thanks.  That worked well. I tested it out successfully as a proof of concept.  Now to operationalize it.  Thanks again.