Socket
Book a DemoInstallSign in
Socket

@harperdb/status-check

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@harperdb/status-check

A Harper component for checking the status of the HarperDB instance.

latest
npmnpm
Version
1.0.2
Version published
Maintainers
0
Created
Source

@harperdb/status-check

This component enables controlling an instance's status based on a record in the database. This can be used by external systems to know the availability of a specific node.

The status of the node can be

  • retrieved with GET /status
  • set to 200 with POST /status
  • set to 404 with DELETE /status

NOTE: Replication for the data.hdb_status table should NOT be established. If the data replicates then all other nodes would be unintentionally set to offline/online.

Usage

This component exposes a route /status

GET

This method is unauthenticated and returns the current status and message.

curl http://localhost:9926/status

POST

This method is used to set the status of the node to 200. This method is authenticated and the user must either be a superuser or have write permissions to the table data.hdb_status.

curl -X POST http://localhost:9926/status --header "Authorization: Basic XXXXXXXXXXXX"

DELETE

This method is used to set the status of the node to 404. This method is authenticated and the user must either be a superuser or have write permissions to the table data.hdb_status.

curl -X DELETE http://localhost:9926/status --header "Authorization: Basic XXXXXXXXXXXX"

FAQs

Package last updated on 11 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts