astarte_device v0.11.0 Astarte.Device.FilesystemInterfaceProvider

Link to this section Summary

Functions

Get the list of all interfaces in the provider.

Get the list of all device owned interfaces in the provider.

Returns the interface with name name by calling all_interfaces/1 and filtering the result. Get the interface by its name.

Loads interfaces from a dir or a single JSON file.

Get the list of all server owned interfaces in the provider.

Link to this section Functions

Link to this function

all_interfaces(state)

all_interfaces(state :: Astarte.Device.InterfaceProvider.state()) :: [
  %Astarte.Core.Interface{
    aggregate: term(),
    aggregation: term(),
    description: term(),
    doc: term(),
    interface_id: term(),
    interface_name: term(),
    major_version: term(),
    mappings: term(),
    minor_version: term(),
    name: term(),
    ownership: term(),
    quality: term(),
    type: term(),
    version_major: term(),
    version_minor: term()
  }
]

Get the list of all interfaces in the provider.

Link to this function

device_owned_interfaces(state)

device_owned_interfaces(state :: Astarte.Device.InterfaceProvider.state()) :: [
  %Astarte.Core.Interface{
    aggregate: term(),
    aggregation: term(),
    description: term(),
    doc: term(),
    interface_id: term(),
    interface_name: term(),
    major_version: term(),
    mappings: term(),
    minor_version: term(),
    name: term(),
    ownership: term(),
    quality: term(),
    type: term(),
    version_major: term(),
    version_minor: term()
  }
]

Get the list of all device owned interfaces in the provider.

Link to this function

fetch_interface(name, state)

fetch_interface(
  name :: String.t(),
  state :: Astarte.Device.InterfaceProvider.state()
) ::
  {:ok,
   %Astarte.Core.Interface{
     aggregate: term(),
     aggregation: term(),
     description: term(),
     doc: term(),
     interface_id: term(),
     interface_name: term(),
     major_version: term(),
     mappings: term(),
     minor_version: term(),
     name: term(),
     ownership: term(),
     quality: term(),
     type: term(),
     version_major: term(),
     version_minor: term()
   }}
  | :error

Returns the interface with name name by calling all_interfaces/1 and filtering the result. Get the interface by its name.

Returns {:ok, %Interface{}} if the interface is found, :error if it's not.

Loads interfaces from a dir or a single JSON file.

Returns {:ok, interfaces} where interfaces is a list of %Astarte.Core.Interface{}.

args is a keyword list of options.

Options

  • path - A filesystem path. This can be a single JSON file or a directory. If it's a directory, all files with a .json extension in the directory will be parsed as interfaces, otherwise the path is interpreted as a path to a single JSON file containing an interface.
Link to this function

server_owned_interfaces(state)

server_owned_interfaces(state :: Astarte.Device.InterfaceProvider.state()) :: [
  %Astarte.Core.Interface{
    aggregate: term(),
    aggregation: term(),
    description: term(),
    doc: term(),
    interface_id: term(),
    interface_name: term(),
    major_version: term(),
    mappings: term(),
    minor_version: term(),
    name: term(),
    ownership: term(),
    quality: term(),
    type: term(),
    version_major: term(),
    version_minor: term()
  }
]

Get the list of all server owned interfaces in the provider.