Updating connection details through REST API

Comments

7 comments

  • Avatar
    Moti Granovsky

    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.

    0
    Comment actions Permalink
  • Avatar
    Brian Chick (Edited )

    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

    0
    Comment actions Permalink
  • Avatar
    Moti Granovsky

    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:

    1. 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?
    2. 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.

    0
    Comment actions Permalink
  • Avatar
    Brian Chick (Edited )

    Yeah, I did open a support ticket citing this post.  I cross checked IDs via debugging tools.  The build was not succeeding.  Maybe the UX is only updated when build succeeds?  I can post screen shots but need to clean them up a bit.

    0
    Comment actions Permalink
  • Avatar
    Brian Chick (Edited )

    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.

     

    0
    Comment actions Permalink
  • Avatar
    Moti Granovsky (Edited )

    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.

    0
    Comment actions Permalink
  • Avatar
    Brian Chick

    Yup, that was the issue.  Updated to use the v2 PATCH endpoint and it works as expected.  I hadn't considered using the dataset patch to update the connection.  

    Thanks again.

    Brian Chick

    0
    Comment actions Permalink

Please sign in to leave a comment.