Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
We are looking to create a script using either REST API calls or the NPrinting CLI via powershell to disable any currently enabled Nprinting publish tasks. Many times we want to pause certain or all tasks due to data issues or downtime and we want to run this via a script. Using the NP CLI we can use Get-NPTasks to retrieve the task but when trying to POST the change via Invoke-NPRequest, it doesn't take the -body parameter any longer, so this doesn't work
Invoke-NPRequest -method Post -path "tasks/publish/$($task.id)/executions" -body @{"enabled"="false"} |convertto-json -depth 10 (aware that enabled is a boolean and may need to be numeric)
Also when using -NPE and various combinations of the endpoint, it doesn't work either. So my questions are:
Is it possible to enable/disable via API call?
Is there ANY documentation on NPE (even if you have to slide it under the table :))?
We are running NP May 2022 and the CLI 1.0.0.10
We do have a fair amount of our NPrinting jobs running via @Lech_Miszkiewicz Qlik Sense API script. So for all intents and purposes, we are controlling via QMC and calling the NP task when needed, which is usually a chained QMC task. We were trying to see if we could enable/disable the other non-QMC driven NP publish tasks, but it looks like we will just need to run them all via Lech's NP API script via QMC and then during downtime or disaster, everything is controlled via QMC and the NP console doesn't have any triggered tasks at all. Thanks for the info though!
The NPrinting-ToggleTasks.ps1 script can be used to toggle enable/disabled.
Also shows how you can use the NPrinting-CLI to GET the required object from the NPrinting API, make the relevant changes, and PUT the changes back to the server.
Hello @covenant_bi
(true) enabled
Try (false) disabled
https://help.qlik.com/en-US/nprinting/May2022/APIs/NP+API/index.html?page=125
https://help.qlik.com/en-US/nprinting/May2022/APIs/NP+API/index.html?page=127#TaskExecutions
To accurately set up your rest connection, follow:
How to create NPrinting GET and POST REST connecti... - Qlik Community - 1832298
I have never tested this but give it a shot!
If you're not a programmer, ask a member of your team who is to have a look at this api to write the code.
Kind regards....
Hi,
Qlik NPrinting REST APIs allows to retrieve Tasks informations and run Task Executions but there is not an API that allows you to change parameters of existing tasks or that allows you to create tasks. For example, you cannot change the Enable flag via APIs or add recipients or filters.
You could change the approach. You could create the tasks enabled and not set triggers for them and use API to run task executions when needed https://help.qlik.com/en-US/nprinting/May2022/APIs/NP+API/index.html?page=57.
Best Regards,
Ruggero
We do have a fair amount of our NPrinting jobs running via @Lech_Miszkiewicz Qlik Sense API script. So for all intents and purposes, we are controlling via QMC and calling the NP task when needed, which is usually a chained QMC task. We were trying to see if we could enable/disable the other non-QMC driven NP publish tasks, but it looks like we will just need to run them all via Lech's NP API script via QMC and then during downtime or disaster, everything is controlled via QMC and the NP console doesn't have any triggered tasks at all. Thanks for the info though!
The NPrinting-ToggleTasks.ps1 script can be used to toggle enable/disabled.
Also shows how you can use the NPrinting-CLI to GET the required object from the NPrinting API, make the relevant changes, and PUT the changes back to the server.
Thanks Marc. Fantastic stuff, as always!