astarte_device v0.11.0 Astarte.API.Pairing.Devices

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

Link to this function

get_mqtt_v1_credentials(client, device_id, csr)

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 with status, headers and body.
  • {:error, reason} if the HTTP request can't be performed.
Link to this function

info(client, device_id)

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 with status, headers and body.
  • {:error, reason} if the HTTP request can't be performed.
Link to this function

verify_mqtt_v1_credentials(client, device_id, certificate)

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 with status, headers and body.
  • {:error, reason} if the HTTP request can't be performed.