astarte_device v0.11.0 Astarte.API.Pairing.Agent
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
Functions
Registers a device.
Link to this section Functions
Link to this function
register_device(client, device_id)
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 withstatus
,headers
andbody
.{:error, reason}
if the HTTP request can't be performed.