Accessing Formulas through API
We would love to have the ability to GET and PUT formulas. Currently I believe the formula is tied directly to an ecube. We have a process that moves clients from one server to another and currently have no way to bring the formulas from the old server to the new.
This would also give us a way to make a formula available to all of the eCubes on a server.
-
I very much second this suggestion.
David, can you possibly go into more detail on the process you have for moving clients between servers? I'm currently working on building a similar process, and would like to hear what you've done to see if all my thoughts are correct.
In terms of moving formulas between servers... I was provided with a script (copyMetadata.js) by Sisense Support that copies the ElastiCube metadata in the MongoDB from one ElastiCube to another on the same server. I'm currently looking at modifying it to copy that metadata onto a remote server. Not exactly a great solution, but better than nothing.
-
Hi Test;
The process I use is through an app I wrote in .Net. It's pretty involved, but at a high level I use the API calls to pull data from the source server and write it to the target server. I get the ecube setup manually on the new server, then migrate the groups, roles, users(viewers and designers), ecube security settings, dashboards (along with shares and subscriptions), and folders. Everything that is migrated is based on the ecube that it's connected to.
If you want more information or have any questions we can connect.
-
Hey David, thanks for the response. Your solution sounds almost exactly like what I'm doing (though I'm using PowerShell instead of .NET). At a high level, I also go through these steps:
- Migrate ElastiCube (I wrote code to do this one of two ways... either regenerate a new ecube from source data on the target server, or simply detach the already-built cube from source, copy it over a remote PSSession onto the target, and then reattach it on the target... both seem to work well)
- Create new group on target
- Configure Data Security
- Recreate user accounts, add them to group
- Export Dashboards from source (including share information)
- Import dashboards on target
- Change dashboard ownership back to original users
- Re-share and re-publish all dashboards
All of this is put into an Azure DevOps pipeline so that I can migrate customers at-will. The only two pieces of the puzzle I think I am missing are:
- Migrate formulas
- Migrate dashboard scheduled report info
The formula piece I'm still missing... but that script from Sisense Support is a good starting point. As for resetting the scheduled reports of a dashboard... I have no clue how to do that, and I don't see an API for it. Probably something else that requires going directly into MongoDB.
Thanks. Let me know if you think of anything I missed for my migration pipeline!
If you need that formula migration script... i uploaded it here: https://drive.google.com/file/d/1Cuu9e5Rt76wjgSAzTvGtr5KZSZGCfCZS/view?usp=sharing
-
The GET /dashboards/{id} api call contains the "shares" node. This holds the information on subscriptions. In the below bit of JSON, you can see that the second user is subscribed to the email. This indicates that they get an emailed dashboard every day.
"shares": [ { "shareId": "55243c09a38d17d80f000003", "type": "user", "subscribe": false }, { "shareId": "5dcc48488e31cb1d385bacd0", "type": "user", "rule": "view", "subscribe": true } ],
Also in the results of the API call you'll see a "subscription" node:"subscription": { "isDataChange": true, "type": "onUpdate", "schedule": "0 00 22 * * *", "timezone": 300, "tzName": "America/New_York", "context": { "dashboardid": "5e272dcd6a855c1f482d8c6b" }, "active": true, "executionPerDay": 1, "reportType": { "inline": true }, "emailSettings": { "isEmail": true, "isPdf": false }, "subscribe": false },
This tells you when the dashboard gets emailed.
I dont do anything with this portion, I just leave it as is.
All I do is ensure that the shares part is updated on the dashboard that I moved.
So basically I pull all the dashboards I need to move, store them in memory,
then after I move one I make a call to update the dashboard and include the shares as part of that update.
Thank you for the script, I'll check it out.
Please sign in to leave a comment.
Comments
5 comments