Migrating Assets Across Environments Leveraging GIT
Migrating Assets Across Environments Leveraging GIT Sisense released its Git Integration for Linux version 2022.10. With the GIT GUI in Sisense, you can can do a lot of exciting things like version control or integrate into CI/CD pipelines. I went ahead and put together a quick demo on how a developer can leverage the Sisense Git Integration to migrate assets from their Dev Environment to the Prod Environment and see those changes reflected in the target application that assets are embedded in. In this video we cover: 1. How to create a Git project in Sisense 2. Add Assets to a project 3. Connect to a remote Git Repo. 4. Push Assets from Dev to a remote Github Repo. 5. Pull Assets from Git Repo into the prod server. 6. Checkout and Commit changes/revert. 7. See Changes reflected in the application Sisense is embedded into. For any additional questions about Enabling Git in your environment, or other capabilities, please see the Introduction to Sisense Git Documentation.1.6KViews1like0CommentsResend Invitations to Inactive Users in Bulk
Steps: 1) Download Python and install it on your PC or the Sisense machine (make sure to add python to the PATH to easily initiate installation of directories). 2) Run CMD and type the following commands to add libraries used as part of our solution: - pip install requests - pip install json 3) Create a .py file and add the following script to it: import requests import json username = '[email protected]' #replace with an admin user's user name password = 'password' #replace with an admin user's password Sisense_url = 'http://localhost:8081' #replace with your Sisense url # Get Auth token url = Sisense_url+"/api/v1/authentication/login" payload = "username="+username.replace('@','%40')+"&password="+password headers = { 'content-type': "application/x-www-form-urlencoded" } response = requests.request("POST", url, data=payload, headers=headers) auth_token = response.json()["access_token"] auth_token = "Bearer " + auth_token headers = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'Authorization': auth_token } url = Sisense_url + '/api/v1/users' resendUrl = Sisense_url + '/api/v1/account/begin_activate' response = requests.request("GET", url, headers=headers) users = response.json() #Sending invites for inactive users total = 0 for item in users: active = item["active"] if not active: email = item["email"] payload = '{"email": ' +'"'+email+'"}' response = requests.request("POST", resendUrl, data=payload, headers=headers) print(item["email"]) total = total+1 print(total) 4) This process can be automated using a Windows Task Scheduler as well. That's it!524Views1like0CommentsPython 3 Script to Import Many ElastiCubes
Introduction The attached script is intended to loop through all ElastiCube folders in your ElastiCubeData folder and import them. Business Case This solution has a couple of possible use cases. The first is to facilitate migrating a Sisense environment with a large number of ElastiCubes. The second would be in the case of disaster recovery, where a number of ElastiCubes must be reattached. Requirements Python 3 must be installed. There should be at least one ElastiCube folder in your ElastiCubeData folder that is intended to be imported. Step 1 Download the attached Python3 Script to your ElastiCubeData folder(usually C:\ProgramData\Sisense\PrismServer\ElastiCubeData). Step 2 Open a IDLE (Python Editor) window as an Administrator. Note: You will get a prompt to allow changes for each ElastiCube unless you run as an Administrator. Step 3 Load the script into IDLE and run. This can take some time to import all ElastiCubes depending on how many you have and the size. Enjoy! Script: import os import subprocess def ImportEC(ECube): cmdline = ["cmd", "/q", "/k", "echo off"] cmd = subprocess.Popen(cmdline, stdin=subprocess.PIPE, stdout=subprocess.PIPE) batch = b"""\ cd C:\Program Files\Sisense\Prism psm ecube attach path="C:\ProgramData\Sisense\PrismServer\ElastiCubeData\ElasticubeToImport" set /p exit """ ECubeBytes = bytes(ECube, 'utf-8') batch = batch.replace(rb'ElasticubeToImport', ECubeBytes) print(batch) cmd.stdin.write(batch) cmd.stdin.flush() result = cmd.stdout.read() EC_List = next(os.walk('.'))[1] for EC in EC_List: print('Python appending EC: ' + EC) ImportEC(EC)657Views0likes0Comments