Astarte.Flow.Blocks.DynamicVirtualDevicePool (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 devices are dynamically registered when their device id is first seens. Credentials secret obtained with the registration are stored in the chosen CredentialsStorage.

Link to this section Summary

Functions

Starts the DynamicVirtualDevicePool.

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()}
       | {:pairing_jwt_map,
          pairing_jwt_map :: %{
            optional(realm :: String.t()) => jwt :: String.t()
          }}
       | {:interface_provider, {module(), term()} | String.t()}
       | {:ignore_ssl_errors, ignore_ssl_errors :: boolean()}
       | {:credentials_storage, credentials_storage :: module()}

Starts the DynamicVirtualDevicePool.

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.
  • :pairing_jwt_map (required) - A map in the form %{realm_name => jwt} where jwt must be a JWT with the authorizations needed to register a device in that realm.
  • :interface_provider (required) - The interface_provider that will be used by the spawned devices.
  • :ignore_ssl_errors - A boolean to indicate wether devices have to ignore SSL errors when connecting to the broker. Defaults to false.
  • :credentials_storage - The module used to store and fetch credentials secrets. Defaults to DETSCredentialsStorage.
  • :pairing_agent - The module used to register the devices. Defaults to Astarte.API.Pairing.Agent