Astarte.API.Pairing.Agent (astarte_device v1.0.1)

Astarte Pairing API used by agents. The :auth_token provided when creating the client for this module should be a JWT to access Pairing API.

Link to this section Summary

Link to this section Functions

Link to this function

register_device(client, device_id)

Specs

register_device(client :: Astarte.API.client(), device_id :: String.t()) ::
  Astarte.API.result()

Registers a device.

client is a Pairing API client created with Astarte.API.Pairing.client/3.

device_id is a valid Astarte device id, you can create a random one with :crypto.strong_rand_bytes(16) |> Base.url_encode64(padding: false)

Return values

  • {:ok, result} if the HTTP request can be performed. result will be a map with status, headers and body.
  • {:error, reason} if the HTTP request can't be performed.