Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
{
  "serviceID": "",
  "http": {
    "publicEndpoint": "http://public-endpoint",
    "bindAddr": "0.0.0.0",
    "bindPort": 8085
  },
  "web": {
    "bindAddr": "0.0.0.0",
    "bindPort": 4000,
    "staticDir": "../web"
  },
  "registry": {
    "backend": {
      "type": "leveldb",
      "dsn": "/data/hds-registry"
    },
    "retentionPeriods": ["1h", "1w"]
  },
  "data": {
  	"backend": {
      "type": "senmlstore",
      "dsn": "./hds-data"
    },
    "autoRegistration": false
  },
  "serviceCatalogsserviceCatalog": []{},
  "auth": {}
}

where

  • http is the configuration object for the http server
    • publicEndpoint is the URL of the gateway protocol://fqdn:port, which must be accessible in the deployment environment
    • bindAddr is the bind address for the service
    • bindPort is the tcp port for the service
  • web is the configuration object for the GUI web-server
    • bindAddr is the bind address for the Web GUI
    • bindPort is the tcp port for the Web GUI
    • staticDir is the directory where Web GUI source files are located
  • registry.backend is the configuration object for the backend of Registry API
    • type is the registry backend type: Supported backends are memoryleveldb
    • dsn is the Data Source Name for storage backend, the location where persistent data is stored (ignored for memory, absolute or relative path for leveldb)
  • registry.retentionPeriods is the list of accepted retention periods
  • data.backend is the configuration object for the backend of Data API
    • data.backend.type is the data backend type: Supported backend is a senml store based on boltdb
    • data.backend.dsn is the file name containing the data
  • data.autoRegistration enables implicit registration of data sources into the registry when a new data point is submitted.

Sample configuration file: historical-datastore.json

Service Catalog

The serviceCatalogs field configures Service Catalogs:

Code Block
  "serviceCatalogsserviceCatalog": [
    {
      "discover": false,
      "endpoint": "http://localhost:8082/sc",
      "ttl": 60120
    }
  ]

where

  • serviceCatalog is an array of Service Catalogs. The Historical Datastore 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

Registration to a service catalog with authentication is explained below.

...

To publish the Historical Datastore to an authenticated Service Catalog, the auth field of that catalog should be set:

Code Block
languagejs
    	"serviceCatalog": [
        {
            "discover": "bool",
            "endpoint": "string",
            "ttl": "int",
            "auth": {
                "provider": "string",
                "providerURL": "string",
                "username": "string",
                "password": "string",
                "serviceID": "string"
            }
        }
    ]
where
  • provider and providerURL are the authentication configurations used by that Service Catalog
  • username and password are the authentication credentials for accessing that Service Catalog
  • serviceID is the ID of that Service Catalog in the authentication provider

Sample configuration file (with authentication): historical-datastore-auth.json