Qlik Community

Integration, Extension & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Announcements
Qlik Insider: SaaS capabilities for Data Integration and Analytics, May 25th! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
gandalfgray
Specialist II
Specialist II

setting proxyservice log levels via api

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:

Example:
$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
We get an error on the Invoke-QlikPut:
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
Can anyone understand why we get an error?
1 Solution

Accepted Solutions
gandalfgray
Specialist II
Specialist II
Author

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

View solution in original post

2 Replies
Damien_Villaret
Support
Support

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...

If the issue is solved please mark the answer with Accept as Solution.
gandalfgray
Specialist II
Specialist II
Author

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