Updating database information in a reverse-tunnel datasource

I read in another post that it is not possible to update database Host/Port information via the API for a datasource that is using a reverse tunnel (it is also not updatable via the UI).

It seems that I am unable to update any information in a reverse tunnel datasource via the API however. My use case is to update the database name, username, and/or password which is updatable via the UI.

I am submitting the following data via a PUT to /api/v2/data_sources/{id}

{
    "data_source": {
        "dbconfig": {
            "database": "updated_value",
            "username": "updated_value",
            "password": "updated_value"
        }
    }
}

I am omitting the data_source.dbconfig.host key in hopes of the datasource merging my new payload with what settings are already on that datasource. Either way, when I specify the host (which should be localhost), the API returns a validation error:
Validation failed: You are not allowed to connect to Holistics' local hosts. If you want to connect to your local machine, you can consider using a tunnel connection

Omitting that host field results in a successful API call, but it seems to remove the localhost value that was originally configured with the datasource as the datasource’s error message is mentioning failed attempts of connecting to the /var/run/postgresql/.s.PGSQL.5432 socket.

In the event I am not missing anything, this may be a feature request rather than a question.

1 Like

Hi Chip,

Thank you for posting. It is a great question!

Please see my answer below

  1. The Host/Port information is indeed not updatable via the UI.
  2. However, the database, username, and password should still be updatable via the UI. May I ask if you have tried making this update on the UI yet?
  3. Regarding the API, our team will investigate this further. Thank you for providing the details!

Hi Chip,

Currently, our update data source API does not work well if you omit some value in dbconfig. (as stated in our doc Holistics API | Holistics Docs)
I’ve just forward this issue to our product team to improve this.

Thanks for posting it and sorry for any inconvience caused
Best regards,

I can do it manually, but I was hoping to do it programmatically for my use case which involves many dynamic (and ephemeral) environments.

Thanks for looking into this. I’m not seeing mention in your link of where the data source API does not work well when dbconfig values are omitted.