---
search:
  tags:
    - database-services
    - GET
seo:
  description: >-
    Reads pg_settings in the database of the service on… Reference for the GET
    /api/v1/database-services/{id}/settings endpoint in the TimescaleDB
    Enterprise API.
  noindex: true
sidebar:
  label: Get live settings
  badge: GET
title: Get live settings
type: openapi-operation
---
Reads pg_settings in the database of the service on the leader (on a replica when the leader does not answer, with a note; in the postgres database when PostgreSQL refuses the database of the service, with a note), the pending restart of each member from Patroni, and SHOW CONFIG of PgBouncer on each PostgreSQL server. The HAProxy tunables come from the latest stored haproxy.cfg of each balancer, because HAProxy has no command that prints its configuration. The HBA rules of the user come from the store of the console. Each PostgreSQL row has its owner and, when a user cannot change it, the lock and its reason. A value with password= shows password=&lt;redacted>. It is a fixed query, so a viewer can call it. It answers 502 when no PostgreSQL server gives pg_settings. A member or a PgBouncer that does not answer has an error in its entry.

`GET /api/v1/database-services/{id}/settings`

**Responses**

- `200` — OK
- `default` — Error

Response example, 200:

```json
{
  "haproxy": {
    "applies": true,
    "note": "string",
    "servers": [
      {
        "error": "string",
        "server_id": "string",
        "settings": [
          {
            "apply": "reload",
            "description": "string",
            "lock_reason": "string",
            "locked": true,
            "name": "string",
            "value": "string"
          }
        ],
        "taken_at": "2019-08-24T14:15:22Z"
      }
    ],
    "tunables": [
      {
        "default": "string",
        "kind": "count",
        "max": "string",
        "max_of": "string",
        "min": "string",
        "name": "string",
        "override": {
          "applied": "string",
          "pending": true,
          "value": "string"
        },
        "owner": "default"
      }
    ]
  },
  "hba": {
    "applied": [
      {
        "address": "string",
        "comment": "string",
        "database": "string",
        "method": "string",
        "type": "string",
        "user": "string"
      }
    ],
    "default": true,
    "locked": [
      {
        "address": "string",
        "database": "string",
        "method": "string",
        "reason": "string",
        "type": "string",
        "user": "string"
      }
    ],
    "pending": true,
    "rules": [
      {
        "address": "string",
        "comment": "string",
        "database": "string",
        "method": "string",
        "type": "string",
        "user": "string"
      }
    ],
    "version": "string"
  },
  "pgbouncer": {
    "servers": [
      {
        "error": "string",
        "server_id": "string",
        "settings": [
          {
            "apply": "reload",
            "changeable": true,
            "default": "string",
            "key": "string",
            "value": "string"
          }
        ]
      }
    ],
    "settings": [
      {
        "apply": "reload",
        "boot_val": "string",
        "context": "string",
        "enumvals": [
          "string"
        ],
        "error": "string",
        "lock_feature": "string",
        "lock_reason": "string",
        "locked": true,
        "max_val": "string",
        "min_val": "string",
        "name": "string",
        "override": {
          "applied": "string",
          "pending": true,
          "value": "string"
        },
        "owner": "sized",
        "pending_restart": true,
        "pending_restart_servers": [
          "string"
        ],
        "reset_val": "string",
        "scope": "pgbouncer",
        "setting": "string",
        "short_desc": "string",
        "source": "string",
        "sourcefile": "string",
        "unit": "string",
        "value": "string",
        "vartype": "string"
      }
    ]
  },
  "postgresql": {
    "dcs_error": "string",
    "members": [
      {
        "error": "string",
        "name": "string",
        "pending_restart": "yes",
        "role": "string",
        "server_id": "string"
      }
    ],
    "note": "string",
    "read_from": "leader",
    "server_id": "string",
    "settings": [
      {
        "apply": "reload",
        "boot_val": "string",
        "context": "string",
        "enumvals": [
          "string"
        ],
        "error": "string",
        "lock_feature": "string",
        "lock_reason": "string",
        "locked": true,
        "max_val": "string",
        "min_val": "string",
        "name": "string",
        "override": {
          "applied": "string",
          "pending": true,
          "value": "string"
        },
        "owner": "sized",
        "pending_restart": true,
        "pending_restart_servers": [
          "string"
        ],
        "reset_val": "string",
        "scope": "pgbouncer",
        "setting": "string",
        "short_desc": "string",
        "source": "string",
        "sourcefile": "string",
        "unit": "string",
        "value": "string",
        "vartype": "string"
      }
    ]
  },
  "read_at": "2019-08-24T14:15:22Z",
  "settings_version": 0
}
```
