Datasource API with Private data source connect

  • What Grafana version and what operating system are you using?

    • Grafana Cloud, latest
  • What are you trying to achieve?

    • create/update a datasource over the http api, including the Private data source connect network
  • How are you trying to achieve it?

    • no starting point
  • What happened?

    • nothing
  • What did you expect to happen?

    • adding the Private data source connect network programmatically
  • Can you copy/paste the configuration(s) that you are having problems with?

{
  "datasource": {
    "id": 1,
    "orgId": 1,
    "name": "test_datasource",
    "type": "graphite",
    "typeLogoUrl": "",
    "access": "proxy",
    "url": "http://mydatasource.com",
    "password": "",
    "user": "",
    "database": "",
    "basicAuth": false,
    "basicAuthUser": "",
    "basicAuthPassword": "",
    "withCredentials": false,
    "isDefault": false,
    "jsonData": {},
    "secureJsonFields": {},
    "version": 1,
    "readOnly": false
  },
  "id": 1,
  "message": "Datasource added",
  "name": "test_datasource"
}
  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

    • no
  • Did you follow any online instructions? If so, what is the URL?

    • did not find anything

Use browser console to find out what UI is using:

@jangaraj Thanks a lot for the tip!

The relevant fields are

"enableSecureSocksProxy": True,
"secureSocksProxyUsername": "<your-pdc-id>",

They must be added to jsonData