Notice: We've updated our Privacy Policy, effective November 14, 2024.

getServers - Get a list of servers for an organization

Use case

You can utilize getServers to get a list of all servers that are integrated with an organization in pganalyze, and to find servers that have not received any data recently due to collector integration issues.

API

Arguments for getServers:

  • organizationSlug (string)
    Organization identifier ("slug") for which to retrieve servers for
  • withRecentData (boolean)
    Filters for servers that have received data in the last 24 hours (optional), defaults to no filtering - if set to false it will filter for servers that haven't received data in the last 24 hours
  • systemType (string)
    Filter by API system type set by the collector (optional)
  • systemScope (string)
    Filter by API system scope set by the collector (optional)
  • systemId (string)
    Filter by API system ID set by the collector (optional)

Fields returned:

  • id (number)
    Unique identifier for this server in the pganalyze system (Internal UUID style)
  • humanId (string)
    Unique identifier for this server in the pganalyze system ("human" style, which is used in URLs and API calls)
  • name (string)
    Display name of this server, as configured in pganalyze
  • systemType (string)
    API system type set by the collector
  • systemScope (string)
    API system scope set by the collector
  • systemId (string)
    API system ID set by the collector
  • lastSnapshotAt (integer)
    Timestamp of last full snapshot processed, as Unix timestamp in seconds

Example

GraphQL query:

query {
  getServers(organizationSlug: "example", withRecentData: true) {
    humanId
    name
  }
}

Using curl:

curl -XPOST -H 'Authorization: Token XXXXXXX' \
  -F 'query=query { getServers(organizationSlug: "example", withRecentData: true) { humanId, name } }' \
  https://app.pganalyze.com/graphql
{
  "data": {
    "getServers": [
      {
        "humanId":"bdp4m73ysjgefke7i2dgkenzi4",
        "name":"pgbench"
      },
      [ ... ]
    }
  }
}

Couldn't find what you were looking for or want to talk about something specific?
Start a conversation with us →