System Operations

Restart

Restarts the Harper instance.

Operation is restricted to super_user roles only

  • operation (required) - must always be restart

Body

{
  "operation": "restart"
}

Response: 200

{
  "message": "Restarting HarperDB. This may take up to 60 seconds."
}

Restart Service

Restarts servers for the specified Harper service.

Operation is restricted to super_user roles only

  • operation (required) - must always be restart_service

  • service (required) - must be one of: http_workers, clustering_config or clustering

  • replicated (optional) - must be a boolean. If set to true, Harper will replicate the restart service operation across all nodes in the cluster. The restart will occur as a rolling restart, ensuring that each node is fully restarted before the next node begins restarting.

Body

{
  "operation": "restart_service",
  "service": "http_workers"
}

Response: 200

{
  "message": "Restarting http_workers"
}

System Information

Returns detailed metrics on the host system.

Operation is restricted to super_user roles only

  • operation (required) - must always be system_information

  • attributes (optional) - string array of top level attributes desired in the response, if no value is supplied all attributes will be returned. Available attributes are: ['system', 'time', 'cpu', 'memory', 'disk', 'network', 'harperdb_processes', 'table_size', 'metrics', 'threads', 'replication']

Body

{
  "operation": "system_information"
}

Set Status

Sets a status value that can be used for application-specific status tracking. Status values are stored in memory and are not persisted across restarts.

Operation is restricted to super_user roles only

  • operation (required) - must always be set_status

  • id (required) - the key identifier for the status

  • status (required) - the status value to set (string between 1-512 characters)

Body

{
  "operation": "set_status",
  "id": "primary",
  "status": "active"
}

Response: 200

{
  "id": "primary",
  "status": "active",
  "__createdtime__": 1621364589543,
  "__updatedtime__": 1621364589543
}

Notes

  • The id parameter must be one of the allowed status types: 'primary', 'maintenance', or 'availability'

  • If no id is specified, it defaults to 'primary'

  • For 'availability' status, only 'Available' or 'Unavailable' values are accepted

  • For other status types, any string value is accepted


Get Status

Retrieves a status value previously set with the set_status operation.

Operation is restricted to super_user roles only

  • operation (required) - must always be get_status

  • id (optional) - the key identifier for the status to retrieve (defaults to all statuses if not provided)

Body

{
  "operation": "get_status",
  "id": "primary"
}

Response: 200

{
  "id": "primary",
  "status": "active",
  "__createdtime__": 1621364589543,
  "__updatedtime__": 1621364589543
}

If no id parameter is provided, all status values will be returned:

[
  {
    "id": "primary",
    "status": "active",
    "__createdtime__": 1621364589543,
    "__updatedtime__": 1621364589543
  },
  {
    "id": "maintenance",
    "status": "scheduled",
    "__createdtime__": 1621364600123,
    "__updatedtime__": 1621364600123
  }
]

Clear Status

Removes a status entry by its ID.

Operation is restricted to super_user roles only

  • operation (required) - must always be clear_status

  • id (required) - the key identifier for the status to remove

Body

{
  "operation": "clear_status",
  "id": "primary"
}

Response: 200

{
  "message": "Status successfully cleared"
}

Last updated