<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using Qlik-cli and powershell for app reloads in SAAS in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Using-Qlik-cli-and-powershell-for-app-reloads-in-SAAS/m-p/1832955#M15545</link>
    <description>&lt;P&gt;Thanks for that&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/47469"&gt;@Levi_Turner&lt;/a&gt;&amp;nbsp;I'll have a go at this now!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Sep 2021 14:49:54 GMT</pubDate>
    <dc:creator>jjdench</dc:creator>
    <dc:date>2021-09-01T14:49:54Z</dc:date>
    <item>
      <title>Using Qlik-cli and powershell for app reloads in SAAS</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Using-Qlik-cli-and-powershell-for-app-reloads-in-SAAS/m-p/1832863#M15538</link>
      <description>&lt;P&gt;Has anyone created a powershell script to trigger a reload in Qlik Sense SAAS, or is anyone able to point me in the direction of a working example. Wanting to reload app's at intervals less than an hour.&lt;/P&gt;&lt;P&gt;i can reload an app via qlik-cli but would like to put the commands into a single powershell command&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 17:00:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Using-Qlik-cli-and-powershell-for-app-reloads-in-SAAS/m-p/1832863#M15538</guid>
      <dc:creator>jjdench</dc:creator>
      <dc:date>2024-11-16T17:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using Qlik-cli and powershell for app reloads in SAAS</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Using-Qlik-cli-and-powershell-for-app-reloads-in-SAAS/m-p/1832942#M15543</link>
      <description>&lt;P&gt;Here's an example of the technique:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;# Define your tenant URL
$tenant = Get-Content -Path .\qcs-tenant.txt
# Define your API key
$apikey = Get-Content -Path .\qcs-api_key.txt

# Define app
$appId = 'd4cf7dc5-88d5-447c-8dd6-a57264d59e2a'

$hdrs = @{}

# Add in the API key to the headers from the qcs-api_key.txt file
$hdrs.Add("Authorization","Bearer $($apikey)")

# Write appId into the Body for reload request
$bodyLines = '{"appId":"'
$bodyLines += $appId
$bodyLines += '"}'

# Get the App Information
$app = Invoke-RestMethod -Uri "https://$($tenant)/api/v1/apps/$($appId)" -Method Get -Headers $hdrs

# Send the reloads request to QCS
$request = Invoke-RestMethod -Uri "https://$($tenant)/api/v1/reloads" -Body $bodyLines -Method Post -Headers $hdrs

Write-Host "Beginning reload of $($app.attributes.name)"

# If the request was created or queued then poll execution for completion
if($request.status -eq 'CREATED' -or 'QUEUED') {
    # Signal reload request success
    Write-Host "Reload Request created for $($app.attributes.name)"
    # Poll every 10 seconds to see if the reload has completed.
    # Valid status values are CREATED, QUEUED, RELOADING, SUCCEEDED, FAILED
    do {
        $reloadStatus = Invoke-RestMethod -Uri "https://$($tenant)/api/v1/reloads/$($request.id)" -Method Get -Headers $hdrs
        Start-Sleep -Seconds 10
    } until ($reloadStatus.status -eq 'SUCCEEDED' -or $reloadStatus.status -eq 'FAILED')
    # Log on success
    Write-Host "Reload of $($app.attributes.name) finished with status $($reloadStatus.status)"
} else {
    Write-Host "Reload Request Failed for $($app.attributes.name)"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 14:29:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Using-Qlik-cli-and-powershell-for-app-reloads-in-SAAS/m-p/1832942#M15543</guid>
      <dc:creator>Levi_Turner</dc:creator>
      <dc:date>2021-09-01T14:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using Qlik-cli and powershell for app reloads in SAAS</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Using-Qlik-cli-and-powershell-for-app-reloads-in-SAAS/m-p/1832955#M15545</link>
      <description>&lt;P&gt;Thanks for that&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/47469"&gt;@Levi_Turner&lt;/a&gt;&amp;nbsp;I'll have a go at this now!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 14:49:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Using-Qlik-cli-and-powershell-for-app-reloads-in-SAAS/m-p/1832955#M15545</guid>
      <dc:creator>jjdench</dc:creator>
      <dc:date>2021-09-01T14:49:54Z</dc:date>
    </item>
  </channel>
</rss>

