Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
We want to be able to programmatically w Powershell set log levels of services, ie proxy, repository, scheduler and engine services.
As we do have the Powershell module Qlik-Cli, as a proof of concept we tried:
$id = '856e885a-aaa5-455b-9a6a-f86d9bf15fcd'
$proxy = Invoke-QlikGet -path "/qrs/proxyservice/$id"
$proxy.settings.logVerbosity.logVerbositySystem = 1$json = $proxy | ConvertTo-Json -Compress -Depth 9
Invoke-QlikPut -Path "/qrs/proxyservice/$id" -Body $json
Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
At C:\Program Files\WindowsPowerShell\Modules\Qlik-Cli\1.21.0\functions\core.ps1:66 char:23
+ ... $result = Invoke-RestMethod @paramInvokeRestMethod @params
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
With some help from Levi:
adding
$global:qlik_output_raw=$true
$global:rawoutput=$true
before the Invoke-QlikGet call solved it.
Without that code Qlik-CLI prettifies the dates to a format that is not accepted by the Invoke-QlikPut function
Hi @gandalfgray
I'm not too familiar with the exact syntax of Qlik-Cli PowerShell module. However error 400 usually means that there is something wrong in the request body syntax.
There is an example of how to change Scheduler service log verbosity in the below article using directly the QRS API:
https://community.qlik.com/t5/Knowledge-Base/Qlik-Sense-QRS-API-How-to-modify-Scheduler-service-sett...
With some help from Levi:
adding
$global:qlik_output_raw=$true
$global:rawoutput=$true
before the Invoke-QlikGet call solved it.
Without that code Qlik-CLI prettifies the dates to a format that is not accepted by the Invoke-QlikPut function