Astarte.Flow.Blocks.VirtualDevicePool (astarte_flow v0.1.0)

This is a consumer block that takes data from incoming Messages and publishes it as an Astarte device, interpreting the key as <realm>/<device_id>/<interface><path>.

The list of supported devices is configured using start_link/1.

Link to this section Summary

Functions

Starts the VirtualDevicePool.

Link to this section Functions

Link to this function

start_link(opts)

@spec start_link(options) :: GenServer.on_start()
when options: [option],
     option:
       {:pairing_url, pairing_url :: String.t()}
       | {:devices, devices}
       | {:ignore_ssl_errors, ignore_ssl_errors :: boolean()},
     devices: [device_options],
     device_options: [device_option],
     device_option:
       {:realm, realm :: String.t()}
       | {:device_id, device_id :: String.t()}
       | {:credentials_secret, credentials_secret :: String.t()}
       | {:interface_provider, {module(), term()} | String.t()}

Starts the VirtualDevicePool.

options

Options

  • :pairing_url (required) - base URL of the Astarte Pairing API instance the devices will connect to, e.g. https://astarte.api.example.com/pairing or http://localhost:4003 for a local installation. URL containing the API version suffix (i.e. /v1) are deprecated and will be removed in a future release.
  • :devices (required) - A list of supported devices, each represented by its device_options (see "Device options" below).
  • :ignore_ssl_errors - A boolean to indicate wether devices have to ignore SSL errors when connecting to the broker. Defaults to false.

device-options

Device options

  • :realm (required)
  • :device_id (required)
  • :credentials_secret (required)
  • :interface_provider (required)

See Astarte.Device.start_link/1 for more documentation.