deleteServer - Delete a server

Use case

Delete a server from the system in either pganalyze Enterprise Server, or the cloud-hosted version of pganalyze. When running the collector separately, make sure to first remove the server from the collector and reload the configuration (otherwise it will be recreated automatically after the deletion).

The server will be marked as deleted, and data will be deleted by its retention time (up to 35 days). For an immediate deletion, reach out to pganalyze Support.

This API requires a read-write API key.

API

Arguments for deleteServer:

  • serverId (String)
    ID of the server (returned as humanId in the addServer API call)

Fields returned:

  • success (Boolean)
    Whether the deletion succeeded
  • errors (Array of String)
    Errors that occurred during deleting the server (if any)

Example

GraphQL mutation:

mutation {
  deleteServer(serverId: "bdp4m73ysjgefke7i2dgkenzi4") {
    success
    errors
  }
}

Using curl, replace pganalyze.internal with the hostname or IP of your pganalyze installation:

curl -XPOST -H 'Authorization: Token XXXXXXX' \
  -F 'query=mutation { deleteServer(serverId: "bdp4m73ysjgefke7i2dgkenzi4") { success, errors } }' \
  https://pganalyze.internal/graphql
{
  "data": {
    "deleteServer": {
      "success": true,
      "errors": []
    }
  }
}

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