This repository has been archived by the owner on Mar 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Farshid Tavakolizadeh edited this page May 19, 2020
·
3 revisions
Third-party services can be registered in the Service Catalog using the registrar utility and a configuration file described in this section.
{
"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.
The registrar is provided in the binary distribution here.
It accepts the following CLI arguments:
-
conf
- path to the JSON configuration file for the service -
endpoint
- the URL of the Service Catalog -
authProvider
- authentication provider name -
authProviderURL
- authentication provider URL -
authUser
- authentication username -
authPass
- authentication password -
serviceID
- authentication service ID
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.
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