Sign inSign up

lucascorpion/local-discovery

By lucascorpion

•Updated almost 6 years ago

Simple agent discovery in your local network

Image
0

773

lucascorpion/local-discovery repository overview

⁠Local Discovery

Docker Image Version Docker Image Size Docker Pulls

A simple API which can be used to discover agents in a local network.

⁠Using the API

All endpoints only expose agents in the same network as the request origin, based on the remote client IP address.

⁠Agent Schema
AttributeDescription
nameThe name of the agent application. This will likely be the same for all agents.
versionThe version of the agent application.
addressThe local address (IP and port) at which the agent is running.
platformThe platform the agent is running on, e.g. windows, linux or mac.
hostnameThe name of the host the agent is running on.
⁠List the Agents

Send a GET request to /api/agents. This will return a JSON list of known agent information:

[
  {
    "name": "agent",
    "version": "1.0.0",
    "address": "192.168.0.110:4000",
    "platform": "windows",
    "hostname": "my-pc"
  }
]
⁠Register an Agent

Send a POST request to /api/agents, with the agent information as JSON in the request body:

{
  "name": "agent",
  "version": "1.0.0",
  "address": "192.168.0.110:4000",
  "platform": "windows",
  "hostname": "my-pc"
}

This will return the list of known agents in the local network (see "List the Agents" above).

If the agent address is the same as the address of a known agent, the known agent will be replaced with the new one.

⁠Remove an agent

Send a DELETE request to /api/agents/:address, where :address is the local address of the agent. If no agent with that address is registered, nothing happens.

This will return the list of known agents in the local network (see "List the Agents" above).

⁠Configuration

The discovery server can be configured through environment variables.

VariableDefaultDescription
LOG_LEVELINFOThe log level (DEBUG, INFO, WARN, ERROR or OFF).
PORT5000The port the server listens on.
KEEP_AGENT_TIME600The time (in seconds) to keep agents in the registry.

Tag summary

Content type

Image

Digest

Size

91.5 MB

Last updated

almost 6 years ago

docker pull lucascorpion/local-discovery