====================================================== Common Commands and Flags (Note: Syntax is Case Sensitive) ====================================================== context: is simply the name of your Qlik-CLI connection to your tenant ls: 'List' is an extremely useful tool and is used throughout this demo use: choose the 'name' of which 'context' (tenant) to manage quiet: -q or --quiet (this allows you to show specific guid ID information) help: -h or --help ====================================================== Adding a context/tenant to manage ====================================================== qlik context ls remove a context qlik context rm yourtenant.us.qlikcloud.com adding a context qlik context init enter the URL: https://yourtenant.us.qlikcloud.com Click "Enter" key (API key is default method). Paste the API Key (right click to paste. the key will be blank because it is considered a secret key). (a developer role is required for the user that needs to create API keys ey-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-c_A A confirmation message is displayed when the connection is established "Welcome xyz, everything is now setup" Possible errors caused by: 1-- the user not having the "Developer" role or (show where tenant developer role is) 2-- the API key may have expired or not correctly pasted. (show where api keys are) ====================================================== Switch between managing contexts/tenants ====================================================== qlik context ls qlik context use qlik context rename qlik context clear ====================================================== Spaces Management (All space names must be unique) ====================================================== --------------------------------- Add/Remove Spaces --------------------------------- Create space 1. Switch to target tenant qlik context ls qlik use yourtenant.us.qlikcloud.com 2. Create Space Syntax qlik space create --name "Qlik-cli files Nov 14" --type shared -q qlik space create --name "Qlik-cli files-Managed Nov. 14" --type managed -q 3. Remove Space syntax qlik space ls (to list all space ID's) qlik space get qlik space rm ---------------------------------------------- How to add member and member roles (create assignments) in a 'Managed' space ---------------------------------------------- (switch to fscapacity tenant) 1. Find Space ID qlik space ls (lists all spaces in tenant) (Optional - To narrow the output results, pick a space ID and do get) qlik space get We will work with managed space ID: 66cxxxxxxxxxxxxxxxxxfcb 2. Find User ID (assigneeId) qlik user ls (shows all user IDs and its properties within in a tenant) or only userID and user name, use qlik user filter --fields="name" --filter="status eq \"active\"" (shows up to 100 initial users: id's and names) We will use Michael Wong and Mark Ramos "id": "66cxxxxxxxxxxxxxxxxcacc", "name": "Michael Wong", "id": "66cxxxxxxxxxxxxxxxx2aa6", "name": "Mark Ramos", 3. Insert new space member and member roles into the space (id) Example 1: Michael Wong qlik space assignment create --assigneeId 66cxxxxxxxxxxxxxxxxcacc --spaceId 66cxxxxxxxxxxxxxxxxxfcb --roles "operator","consumer" --type "user" qlik space assignment create --assigneeId 66cxxxxxxxxxxxxxxxx2aa6 --spaceId 66cxxxxxxxxxxxxxxxxxfcb --roles "operator","publisher" --type "user" ***keep copy of the assignment ID and username - this will be used to edit the space role later*** (where userID (assigneeId) is 66cxxxxxxxxxxxxxxxxcacc) Example 2: Marc Ramos qlik space assignment create --assigneeId 66cxxxxxxxxxxxxxxxx2aa6 --spaceId 66cxxxxxxxxxxxxxxxxxfcb --roles "operator","publisher" --type "user" (where user id (assigneeId) is 66cxxxxxxxxxxxxxxxx2aa6) ***copy the assignment ID and username - this will be used to edit the space role later*** Shared Space Roles "consumer", (can view) "producer" (can edit) "codeveloper", (can edit data in apps) "facilitator", (can manage) "dataconsumer", (can consume data) Managed Space Roles "basicconsumer", (has restricted view) "consumer", (can view) "contributor", (can contribute) "dataconsumer", (can consume data) "facilitator", (can manage) "operator", (can operate) "publisher" (can publish) ***MUST use the correct roles for shared or managed space otherwise unexpected results will occur*** ---------------------------------------------- How to edit a users space roles (one example) ---------------------------------------------- Michael Wong assigneeId 66cxxxxxxxxxxxxxxxxcacc spaceId 66cxxxxxxxxxxxxxxxxxfcb roles "operator","consumer" type "user" To edit an existing member's permissions, you need: Assignment ID: "id" Space ID: "spaceId" (shared and managed space roles are different. Do "qlik space ls " to list the assignable roles) qlik space assignment edit --spaceId 1. Find all assignments (Space Members) in your space. qlik space ls qlik space assignment ls --spaceId 2. Edit the member assignment where 67xxxxxxxxxxxxxxxxxx3c65 is the member assignment ID qlik space assignment edit 67xxxxxxxxxxxxxxxxxxc811 --spaceId 66cxxxxxxxxxxxxxxxxxfcb 3. Text pad opens, then add or remove role from list of managed space or shared roles (last entry must not be followed by a comma): Shared Space Roles "consumer", (can view) "producer" (can edit) "codeveloper", (can edit data in apps) "facilitator", (can manage) "dataconsumer" (can consume data) Managed Space Roles "basicconsumer", (has restricted view) "consumer", (can view) "contributor", (can contribute) "dataconsumer", (can consume data) "facilitator", (can manage) "operator", (can operate) "publisher" (can publish) Save the file and close ***MUST use the correct roles for shared or managed space otherwise unexpected results will occur*** ------------------------------------------------- ##How to remove members and member roles from a space ------------------------------------------------- ***NOTE: Assignment IDs change when you remove, then re-add a user to a space at a later time*** 1. Find space members (assignments/assignment "id"s) qlik space assignment ls --spaceId 66cxxxxxxxxxxxxxxxxxfcb 2. Insert rm, and --spaceID to remove qlik space assignment rm --spaceId qlik space assignment rm 67xxxxxxxxxxxxxxxxxxc811 --spaceId 66cxxxxxxxxxxxxxxxxxfcb 3. Verify space has no members (assignments). Should be [ ] qlik space assignment ls --spaceId 66cxxxxxxxxxxxxxxxxxfcb (4. Optional - get single assignment details (use the above assignment ID) qlik space assignment get --spaceID Example qlik space assignment get 67xxxxxxxxxxxxxxxxxx5eb7 --spaceId 66cxxxxxxxxxxxxxxxxxfcb ====================================================== ##Tenant Role Management - How to add a Tenant role to a user ====================================================== --------------------------- Add roles to user --------------------------- 1. Check and or switch to target tenant qlik context ls qlik context use qlik user ls (to find the user and user IDs to add role to) qlik user ls > c:\temp\users.txt (output users/roles to a file) qlik user filter --fields="name" --filter="status eq \"active\"" 1. qlik user edit 66cxxxxxxxxxxxxxxxxcacc (Notepad opens with user information) 2. Find 'roles' in the user file 3. add roles between [] (no comma after the last role as seen below) ****Avalailable Tenant Roles**** "roles": [ "SharedSpaceCreator", "PrivateAnalyticsContentCreator", "DataServicesContributor", "Developer", "ManagedSpaceCreator", "AutomationCreator", "CollaborationPlatformUser", "DataSpaceCreator", "Steward", "AutomlDeploymentContributor", "AutomlExperimentContributor", "AnalyticsAdmin", "AuditAdmin", "DataAdmin", "TenantAdmin" ], ## Remove a user (helen brolin) qlik user ls (to find the user and user ID) qlik user ls > c:\temp\users.txt (output users/roles to a file) qlik user rm qlik user rm (reinsert helen brolin. Auth0 subject required) qlik user create --name "Helen Brolin" --email "hbn@abc.com" --roles Developer,PrivateAnalyticsContentCreator --subject "auth0|66xxxxxxxxxxxxxxxxxxb5ce" (Optional - Tenant user information) qlik user get qlik user get 65xxxxxxxxxxxxxxxxxx36c9 ====================================================== App Management/Tasks ====================================================== --------------------------------- Import App --------------------------------- 1. find space ID qlik space ls (lists all spaces IDs) 2. Import App (from app location on your hard drive) qlik app import -f C:\TEMP\salesdemoimport.qvf --spaceId <> qlik app import -f C:\TEMP\SalesDemoImport.qvf --spaceId 66cxxxxxxxxxxxxxxxxxfcb qlik app import -f C:\TEMP\SalesDemoImport.qvf --spaceId 66xxxxxxxxxxxxxxxxxx6d2b --------------------------------- Export App without data --------------------------------- 1. Find App ID qlik app ls (lists all app IDs) 2. Export App with no data qlik app export --NoData > C:\folder\QVFname.qvf Example qlik app export 4b25xxxx-xxxx-xxxx-xxxx-xxxx90187481 --NoData > C:\TEMP\salesdemexportnodata.qvf --------------------------------- Export App with data --------------------------------- 1. Export App with data qlik app export > C:\folder\QVFname.qvf Example qlik app export 4b25xxxx-xxxx-xxxx-xxxx-xxxx90187481 > C:\TEMP\salesdemexport.qvf --------------------------------- Get App Information --------------------------------- qlik app get Example qlik app get 0e42xxxx-xxxx-xxxx-xxxx-xxxxb4b08696 ================================================ Best practices: ================================================ Decide upon and add "common set of space roles/permissions" to a set of users Find space and user userId's with CLI Use CLI to -add users to spaces and -space user roles to each user space member Use the Qlik Cloud admin interface to -add/remove individual roles When All Roles are ready - Import apps to prepared shared spaces - Import apps to prepared published spaces