Datasentinel Docs
Visit our websiteBlogRelease Notes
  • 👋Welcome
  • 🆓Free Trial
  • 📣Release Notes
  • Getting started
    • Architecture
    • Installation
      • 🌐Platform
      • 🕶️Agent
    • PostgreSQL clusters
      • 🔌Extensions
        • 🔌pg_stat_statements
        • 🔌pg_store_plans
        • 🔌system_stats
        • 🔌pg_buffercache
      • 🕶️Monitoring User
      • ➕Adding Connection
    • FAQs
      • ❓Platform FAQ
      • ❓Agent FAQ
  • Features
    • Key Features
      • 📊Session History
      • 📊Top Queries
      • 📂Top Tables
      • 🔓Lock Explorer
      • 📈Cluster & System Metrics
      • ⌚Live360
      • 📰Reporting
      • 🔔Alerting
        • Settings
        • Templates
        • Silences
        • Manager
    • Other Features
      • 📡Agentless Monitoring
      • 🛡️Role Based Access
      • 🔂Changed Parameters
    • Tips & Hints
      • 🖥️User Interface
      • 🏷️Tags
      • 🔀Metric Correlation
      • 👁️‍🗨️Consolidated View
      • ❗Graphical Annotations
      • ☁️Predefined Providers
      • ❓Wait Event Description
      • ®️Read Replicas
      • 👁️‍🗨️Agentless & System Metrics
      • ☑️Simplified pg_instance Display
  • implementation
    • Platform Usage
      • ⚙️Configuration
        • 🔑License
        • 📓LDAP
        • ✉️SMTP
        • 📋Audit
        • 👨‍🏭Users & Roles
      • 🧩API
        • 🔗Access Token
        • 🧩Connection API
        • 🧩Role API
        • 🧩User API
        • 🧩Reporting API
        • 🧩Workload API
        • 🧩Alerting API
      • 🛠️Tooling
    • Agent Usage
      • 📣Release Notes
      • ⌨️CLI
      • 🧩API
      • 🗃️Collection Level
      • 🔬Internals
    • Upgrade
      • 🔄Platform
      • 🔄Agent
    • Troubleshooting
      • 🩺Error message: “502 Bad Gateway”
      • 🩺The UI is not displaying any metrics for my new instance.
      • 🩺UI dashboard is encountering loading errors
      • 🩺InfluxDB
  • Support
    • How to Contact Us
  • GitHub Toolkit
Powered by GitBook
On this page
  • Connection
  • Add
  • Display
  • Update
  • Disable
  • Enable
  1. implementation
  2. Platform Usage
  3. API

Connection API

The Connection API is available solely through an on-premises installation and is reliant on the decision to use the Agentless feature.

PreviousAccess TokenNextRole API

Last updated 1 year ago

If you prefer installing each agent locally, then adding a connection is done at the agent level

To use the Connection API, it's necessary to generate an access token.

Connection

Add

POST https://<<platform-server>>/ds-api/pool/pg-instances/{connection_name}

Create a New Remote Monitored Connection ()

Path Parameters

Name
Type
Description

connection_name*

String

Connection Identifier

Headers

Name
Type
Description

user-token*

String

Generated Access Token

Request Body

Name
Type
Description

host*

String

PostgreSQL Hostname for connection

port*

Number

Indicate the port used for communication with the PostgreSQL cluster.

user*

String

PostgreSQL user used by Datasentinel for monitoring

password*

String

User password

tags*

String

Tags linked with the instance. Tags should follow the format [key=value],.... Can be empty

Response

{
    "status": "Connection created and connected!"
}

Example
cat > body.json << EOF
{
    "host": "pg-sales-1734",
    "port": 9342,
    "user": "datasentinel",
    "password": "sentinel",
    "tags": "application=sales,environment=production,provider=amazon,datacenter=lyon",
}
EOF
export TOKEN=<<user_token>>
curl -k --header "user-token: $TOKEN" --header 'Content-Type: application/json' --request POST 'https://<<platform-server>>/ds-api/pool/pg-instances/sales-production' -d @body.json

Display

GET https://<<platform-server>>/ds-api/pool/pg-instances/{connection_name}

Path Parameters

Name
Type
Description

connection_name*

String

Connection Identifier

Headers

Name
Type
Description

user-token*

String

Generated Access Token

Response

{
    "name": "sales-production",
    "host": "pg-sales-1734",
    "port": 9342,
    "user": "datasentinel",
    "password": "sentinel",
    "tags": "",
    "enabled": true,
    "connected": true,
    "collection-rate": "low",
    "samples": false,
    "lock-monitoring": true,
    "lock-monitoring-delay": 30,
    "table-monitoring": true,
    "query-monitoring": true,
    "query-monitoring-optimize": false,
    "query-monitoring-min-calls": 2,
    "query-monitoring-min-time": 1
}

Update

PUT https://<<platform-server>>/ds-api/pool/pg-instances/{connection_name}

Path Parameters

Name
Type
Description

connection_name*

String

Connection Identifier

Headers

Name
Type
Description

user-token*

String

Generated Access Token

Request Body

Name
Type
Description

host

String

PostgreSQL Hostname for connection

port

Number

Indicate the port used for communication with the PostgreSQL cluster.

user

String

PostgreSQL user used by Datasentinel for monitoring

password

String

User password

tags

String

Tags linked with the instance. Tags should follow the format [key=value],.... Can be empty

Response

{
    "status": "Connection updated!"
}

Disable

PATCH https://<<platform-server>>/ds-api/pool/pg-instances/{connection_name}/disable

Path Parameters

Name
Type
Description

connection_name*

String

Connection Identifier

Headers

Name
Type
Description

user-token*

String

Generated Access Token

Response

{
    "status": "Connection disabled!"
}

Enable

PATCH https://<<platform-server>>/ds-api/pool/pg-instances/{connection_name}/enable

Path Parameters

Name
Type
Description

connection_name*

String

Connection Identifier

Headers

Name
Type
Description

user-token*

String

Generated Access Token

{
    "status": "Connection enabled!"
}

DELETE https://<<platform-server>>/ds-api/pool/pg-instances/{connection_name}

Path Parameters

Name
Type
Description

connection_name*

String

Connection Identifier

Headers

Name
Type
Description

user-token*

String

Generated Access Token

Response

{
    "status": "Connection deleted!"
}

Refer to for more details

Display Remote Monitored Connection ()

Update Remote Monitored Connection ()

Refer to for more details

Disable Remote Monitored Connection ()

Enable Remote Monitored Connection ()

Delete Remote Monitored Connection ()

🧩
🧩
🔗Access Token
Agentless Feature
Agentless Feature
Agentless Feature
Agentless Feature
Agentless Feature
Agentless Feature
Tags section
Tags section