Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
rusnakpe
Contributor II
Contributor II

QAA backup

Hi all,

I am searching for some automated solution how to backup created QAAs, but facing issues like...

  1. You can get json definition via API endpoint via Qlik CLI, but that json file is not possible be uploaded via Upload Workspace directly in QAA editor. By other words, I cannot upload json file with content of QAA in json format. Automation content would need to be get by Download Workspace option only diretly in QAA editor which cannot be automated...
  2. You can get content of your automations only, not automations owned by someone else. Idea was to back up all the tenant's automation.

Any ideas here? Anyone was facing the same challenge?

Labels (1)
1 Solution

Accepted Solutions
Shai_E
Support
Support

Hi @rusnakpe 

I could be mistaken but there are two API endpoints that are provided for the automations route.

1. Get the specific automation definitions endpoint

Automations REST | Qlik Developer Portal

2. Create an automation endpoint

Automations REST | Qlik Developer Portal

Those two in theory should help you backup your QAA automations.

This is the request body schema you need in order to create an automation

Automations REST | Qlik Developer Portal

And i think the endpoint in point one gets you that.

Best Regards

View solution in original post

9 Replies
Shai_E
Support
Support

Hi @rusnakpe 

I could be mistaken but there are two API endpoints that are provided for the automations route.

1. Get the specific automation definitions endpoint

Automations REST | Qlik Developer Portal

2. Create an automation endpoint

Automations REST | Qlik Developer Portal

Those two in theory should help you backup your QAA automations.

This is the request body schema you need in order to create an automation

Automations REST | Qlik Developer Portal

And i think the endpoint in point one gets you that.

Best Regards

rusnakpe
Contributor II
Contributor II
Author

Hi @Shai_E ,

finally I got it. I had some issues with Postman and body specification, but now it seems that I am able to "restore" (create) automation after it is backed up.

Any idea for second bullet? I can imagine to change the ownership first, make a backup and change it back. But it might cause lot of troubles as we do not have business off hours specified.

Thanks

Shai_E
Support
Support

Hi @rusnakpe 

Good question on the second point, this needs checking.

 

Shai_E
Support
Support

Hi @rusnakpe 

As far as i can see, you will run into trouble with automations not owned by you, if you try to get their definitions you will run into an insufficient permissions error.

Its either changing owners, and then the automation gets disabled and needs enablement..

And who knows what other issues you might come across changing the owners.

Or maybe there is a possibility of doing something if each user in the tenant has an API key, but its complicated.

 

Best Regards

DaveChannon
Employee
Employee

If you are doing this via external script, could you leverage the new OAuth M2M impersonation capabilities to retrieve automations owned by other users.

E.g. retrieve a token for each user, which then permits you to access their resources.

Shai_E
Support
Support

Hi @DaveChannon 

Had a similar idea i would say using the API token API.

Best Regards

rusnakpe
Contributor II
Contributor II
Author

Hi @DaveChannon ,

that is good idea. I found this article Guiding principles for OAuth impersonation | Qlik Developer Portal.

However I use qlik cli command for some backup solution. As it was mentioned before, there is an issue to get content of QAA not owned by specified user. But where the user is specified during OAuth creation? There is only scope which gives you permissions to specified sources (read and manage automations does not mean that you can see their definition, which is what I want to backup). Context is created under user privileged to create OAuth which is probably that specified user as I can get content of his QAAs.

Idea was to use qlik cli --login option to login given user and be able to get content of his QAAs. But anytime I want to use my login credentials, I will get this error even I am pretty sure that my password is correct.

PS C:\Users\qsserver1> qlik context login
Using context 'QCBCK', with URL 'https://tenantID.us.qlikcloud.com'
Enter Username (domain\user): DOMAIN\username
Enter Password: Error: Not able to get the 'X-Qlik-Session' cookie, please check your password.

I meant it is somehow connected to Allow M2M user impersonation option so I enabled it for my configured OAuth, but still the same.

Btw: Once I create OAuth with specified scope and then decide to change it, it is not reflected or I do not know how to do that. Tried qlik context update command, restart console or recreate context...nothing worked. Needed to create new OAuth.

Thanks for your inputs!

 

DaveChannon
Employee
Employee

Good questions @rusnakpe. I'll need to check with the team on where we are with impersonation in qlik-cli, as it might need some updates to support it. We are planning on adding it to automations (Platform Operations connector) this month to the RAW API blocks.

Let me check and get back to you.

DaveChannon
Employee
Employee

@rusnakpe no ETA yet on support in Qlik-CLI, we'll discuss further next week.

On the automations side, we expect to release the blocks next week.