Skip to content

Configuring Device Catalog

Alexandr Krylovskiy edited this page Nov 7, 2014 · 9 revisions

Overview

Device Catalog is configured using a JSON configuration file, path to which is provided to the DC via -conf flag.

The default configuration file (provided in the binary distribution) is located at conf/device-catalog.json

Configuration File

{
  "description": <string>,
  "dnssdEnabled": <bool>,
  "publicAddr": <string>,
  "bindAddr": <int>,
  "bindPort": <int>,
  "apiLocation": <string>,
  "staticDir": <string>,
  "storage": {
  	"type": <string>
  },
  "serviceCatalog": [
   {
     "discover": <bool>,
     "endpoint": <string>,
     "ttl": <int>
   }
  ]
}

Where

  • description is a human-readable description
  • dnssdEnabled is a flag enabling DNS-SD advertisement of the catalog on the network
  • publicAddr is the FQDN or IP address of the host, which must be routable in the deployment environment
  • bindAddr is the bind address for the Device Catalog API
  • bindPort is the tcp port for the API
  • apiLocation is the API location (path in the endpoint URL)
  • staticDir is the path to the directory with static files
  • storage is the configuration of the storage backend
  • type is the type of the backend (only memory is currently supported)
  • serviceCatalog is an array of Service Catalogs. The Device Catalog will be published as a service to each configured Service Catalog (if not empty)
  • discover is a flag enabling automatic discovery of the Service Catalog using DNS-SD
  • endpoint is the URL of the remote Service Catalog API (http://address:port/path)
  • ttl is the TTL for the service registration

Example

The default configuration file (provided in the binary distribution) is the following:

{
  "description": "Standalone Device Catalog",
  "dnssdEnabled": true,
  "publicAddr": "fqdn-of-the-host",
  "bindAddr": "0.0.0.0",
  "bindPort": 8081,
  "apiLocation": "/dc",
  "staticDir": "./static",
  "storage": {
    "type": "memory"
  },
  "serviceCatalog": [
    {
      "discover": false,
      "endpoint": "http://remotehost:8081/dc",
      "ttl": 120
    }
  ]
}