Skip to content
This repository has been archived by the owner on Sep 11, 2022. It is now read-only.

chermehdi/heartbeat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Heartbeat

The distributed simple registry server.

API

Heartbeat exposes 2 types of APIs:

  1. REST API to talk to the UI.
  2. an RPC API to talk to the other nodes in the cluster.

REST API description

  • GET /services

This request returns the list of all available services along with their available instances

[
  {
    "name": "service-a",
    "uptime": 12312321,
    "instances": [
      "host1:port1",
      "host2:port2",
    ]
  },
  ...
]
  • GET /config

This request returns the list of all the available key-values stored in the heartbeat server

[
  {
    "key": "build-id",
    "value": "12AEDE234",
  },
  ...
]
  • PUT /config
{
  "key": "key",
  "value": "value"
}

This creates the config with the key and value in the heartbeat server, the server returns an OK status only if the key-value pair has been successfully persisted by the majority of nodes of the heartbeat server.