Astarte.API.Pairing.Devices (astarte_device v1.0.5)
Astarte Pairing API used by devices. The :auth_token
provided when creating the client for this module should be the credentials secret of the device.
Link to this section Summary
Functions
Request credentials for the Astarte MQTT V1 protocol (i.e. an SSL client certificate).
Get the transports info for a device.
Verify credentials for the Astarte MQTT V1 protocol (i.e. an SSL client certificate).
Link to this section Functions
get_mqtt_v1_credentials(client, device_id, csr)
Specs
get_mqtt_v1_credentials( client :: Astarte.API.client(), device_id :: String.t(), csr :: String.t() ) :: Astarte.API.result()
Request credentials for the Astarte MQTT V1 protocol (i.e. an SSL client certificate).
client
is a Pairing API client created with Astarte.API.Pairing.client/3
.
device_id
is the device id of the device requesting the certificate.
csr
is a PEM encoded certificate signing request.
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.
info(client, device_id)
Specs
info(client :: Astarte.API.client(), device_id :: String.t()) :: Astarte.API.result()
Get the transports info for a device.
client
is a Pairing API client created with Astarte.API.Pairing.client/3
.
device_id
is the device id of the device requesting its information.
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.
verify_mqtt_v1_credentials(client, device_id, certificate)
Specs
verify_mqtt_v1_credentials( client :: Astarte.API.client(), device_id :: String.t(), certificate :: String.t() ) :: Astarte.API.result()
Verify credentials for the Astarte MQTT V1 protocol (i.e. an SSL client certificate).
client
is a Pairing API client created with Astarte.API.Pairing.client/3
.
device_id
is the device id of the device requesting the certificate.
certificate
is the PEM encoded certificate to be verified.
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.