Updating connection details through REST API
Hi, we have to change the address of one of our data source, so I'm trying to update all the connection strings to the new address via API.
For this I'm calling the curl -X PATCH https://<host>/api/v1/connection/id endpoint which works fine, but it only updates the connection in the quick access panel when I'm trying to create a new datasource:
But it doesn't update the connection for the already existing datasources:
Any ideas how I could update the connections without going through all the cubes and all the datasources manually?
Thanks!
-
Hi,
This action isn't currently available via REST API - It will be available on an upcoming version of Sisense for Linux (L8.0.2) and will also become available on the Windows version sometime during Q1 of 2020.
If you only need a one-time script to fix your current connection parameters, I'd suggest getting in touch with Sisense support, they may be able to help you do this operation without going through the steps manually.
-
Hello -
I am running into this same behavior on L8.0.5.301. Did this Q1 2020 patch make it into the pipeline?
It exibits strange behavior. I can get the connection, make my changes, save it, and get it again and see the changes applied. When I try to edit the object related to the connection in the UX however it still has the old connection properties. Seems the REST api and the UX use two different data sources for the same connection ID.
Thanks,
Brian Chick
-
Hi Brian, this is strange - I've successfully done this operation on L8.0.5 in the past, and I am quite certain that the same data source is used as the REST API is a semantic layer over the API which our UI uses.
I have a few suggestions for debugging:
- Try building the model - does the connection in the UI change after a build? did you see that the old data or new data is being retrieved? Could you specify where in the UI you see the old connection details?
- Try going over all the datasets in your schema - could it be there is more than one dataset with a similar connection? It could be that the one you are modifying via REST is not the same being edited in the UI?
If neither of the above helps you track down the issue, I suggest contacting our support team to investigate this.
-
Here are screenshots. They were all taken after importing the data model from one environment to the other. It is as if the UX hangs onto the original imported values and the API reflects the subsequent calls made to the API to update them. The QA2's in these screenshots should be UAT3's like the unit test shows.
-
Hi Brian,
I just realised there's one thing missing here - which API endpoint are you now using to update (and then retrieve) the connection settings for the models?
You should be using PATCH on /api/v2/datamodels/schema/{datamodel_id}/datasets/{dataset_id}
If you haven't been using this but rather the /api/v1/connection/ endpoint mentioned in the original post, that could be the issue - it still does not perform this action, it has not been changed.
You can read more about the v2 datamodels API here: https://sisense.dev/guides/rest/datamodels.v2.html
Another important detail is that this V2 API is still only available on Linux versions of Sisense.
Please sign in to leave a comment.
Comments
7 comments