Page tree
Skip to end of metadata
Go to start of metadata

This page has moved to: https://github.com/linksmart/service-registrator/wiki

Follow link above if you are not automatically redirected in 5 seconds.

Overview

Third-party services can be registered in the Service Catalog using the registrar utility and a configuration file described in this section.


Configuration File

{
    "id": "service_unique_id",
	"name": "_servicename._tcp",
    "description": "service description",
    "meta": {},
    "apis": {
        "Data API" : "mqtt://test.mosquitto.org:1883",
        "Registration API": "http://example.org"
    },
    "docs": [
        {
            "description": "REST API Specs",
            "apis": ["Registration API"],
            "type": "application/openapi+json;version=2.0",
            "url": "http://link-to-openapi-specs.json"
        },
        {
            "description": "LS XYZ Documentation",
            "apis": ["Registration API", "Data API"],  
            "type": "text/html",
            "url": "http://docs.linksmart.eu/XYZ"
        }
    ],
    "ttl": 120
}





The configuration resembles the properties of the Service object described in the Service Catalog API.

Usage

The registrar is provided in the binary distribution here.

It accepts the following CLI arguments:

Given the Service config file and the endpoint of the Service Catalog, the registrar utility registers the Service in the catalog and keeps updating the registration according to the configured TTL.

Simple Example

Given the example configuration file shown above in a file named mqtt-broker.json in current directory, the described service can be registered as follows:

./service-registrator --conf=mqtt-broker.json --endpoint=http://localhost:8082

Docker

docker run -v $(pwd)/mqtt-broker.json:/home/mqtt-broker.json linksmart/service-registrator --conf=mqtt-broker.json --endpoint=http://service-catalog:8082
  • No labels