View Source Radixir.System (radixir v0.0.4)

Provides high level interaction with the System API.

Link to this section Summary

Functions

Gets system addressbook.

Gets system configuration.

Gets system health.

Gets system metrics.

Gets system peers.

Gets prometheus metrics.

Gets system version.

Link to this section Types

@type error_message() :: String.t()
@type options() :: keyword()

Link to this section Functions

Link to this function

get_address_book(options \\ [])

View Source
@spec get_address_book(options()) :: {:ok, map()} | {:error, map() | error_message()}

Gets system addressbook.

parameters

Parameters

  • options: Keyword list that contains
    • api: Keyword list that contains
      • url (optional, string): If url is not in options then the url set in the configs will be used.
      • any other options one may want to pass along to the http layer - for example headers
      • auth_index (optional, integer): Index of the username + password combo to be used for endpoint authentication.
      • username: (optional, string): Username to be used for endpoint authentication.
      • password: (optional, string): Password to be used for endpoint authentication.

note

Note

  • Either username and password or auth_index must be provided.
  • If all three are provided auth_index is used.

If the following usernames and passwords are exported as follows:

export USERNAMES='admin, superadmin, metrics'
export PASSWORDS='funny cats very Jack 21!, harry Kack love h39! LW, monitor Kat darrel 23 Jack!'

then an auth_index of 0 would result in admin being used as the username and funny cats very Jack 21! being used as the password.

Link to this function

get_configuration(options \\ [])

View Source
@spec get_configuration(options()) :: {:ok, map()} | {:error, map() | error_message()}

Gets system configuration.

parameters

Parameters

  • options: Keyword list that contains
    • api: Keyword list that contains
      • url (optional, string): If url is not in options then the url set in the configs will be used.
      • any other options one may want to pass along to the http layer - for example headers
      • auth_index (optional, integer): Index of the username + password combo to be used for endpoint authentication.
      • username: (optional, string): Username to be used for endpoint authentication.
      • password: (optional, string): Password to be used for endpoint authentication.

note

Note

  • Either username and password or auth_index must be provided.
  • If all three are provided auth_index is used.

If the following usernames and passwords are exported as follows:

export USERNAMES='admin, superadmin, metrics'
export PASSWORDS='funny cats very Jack 21!, harry Kack love h39! LW, monitor Kat darrel 23 Jack!'

then an auth_index of 0 would result in admin being used as the username and funny cats very Jack 21! being used as the password.

Link to this function

get_health(options \\ [])

View Source
@spec get_health(options()) :: {:ok, map()} | {:error, map() | error_message()}

Gets system health.

parameters

Parameters

  • options: Keyword list that contains
    • api: Keyword list that contains
      • url (optional, string): If url is not in options then the url set in the configs will be used.
      • any other options one may want to pass along to the http layer - for example headers
      • auth_index (optional, integer): Index of the username + password combo to be used for endpoint authentication.
      • username: (optional, string): Username to be used for endpoint authentication.
      • password: (optional, string): Password to be used for endpoint authentication.

note

Note

  • Either username and password or auth_index must be provided.
  • If all three are provided auth_index is used.

If the following usernames and passwords are exported as follows:

export USERNAMES='admin, superadmin, metrics'
export PASSWORDS='funny cats very Jack 21!, harry Kack love h39! LW, monitor Kat darrel 23 Jack!'

then an auth_index of 0 would result in admin being used as the username and funny cats very Jack 21! being used as the password.

Link to this function

get_metrics(options \\ [])

View Source
@spec get_metrics(options()) :: {:ok, map()} | {:error, map() | error_message()}

Gets system metrics.

parameters

Parameters

  • options: Keyword list that contains
    • api: Keyword list that contains
      • url (optional, string): If url is not in options then the url set in the configs will be used.
      • any other options one may want to pass along to the http layer - for example headers
      • auth_index (optional, integer): Index of the username + password combo to be used for endpoint authentication.
      • username: (optional, string): Username to be used for endpoint authentication.
      • password: (optional, string): Password to be used for endpoint authentication.

note

Note

  • Either username and password or auth_index must be provided.
  • If all three are provided auth_index is used.

If the following usernames and passwords are exported as follows:

export USERNAMES='admin, superadmin, metrics'
export PASSWORDS='funny cats very Jack 21!, harry Kack love h39! LW, monitor Kat darrel 23 Jack!'

then an auth_index of 0 would result in admin being used as the username and funny cats very Jack 21! being used as the password.

Link to this function

get_peers(options \\ [])

View Source
@spec get_peers(options()) :: {:ok, map()} | {:error, map() | error_message()}

Gets system peers.

parameters

Parameters

  • options: Keyword list that contains
    • api: Keyword list that contains
      • url (optional, string): If url is not in options then the url set in the configs will be used.
      • any other options one may want to pass along to the http layer - for example headers
      • auth_index (optional, integer): Index of the username + password combo to be used for endpoint authentication.
      • username: (optional, string): Username to be used for endpoint authentication.
      • password: (optional, string): Password to be used for endpoint authentication.

note

Note

  • Either username and password or auth_index must be provided.
  • If all three are provided auth_index is used.

If the following usernames and passwords are exported as follows:

export USERNAMES='admin, superadmin, metrics'
export PASSWORDS='funny cats very Jack 21!, harry Kack love h39! LW, monitor Kat darrel 23 Jack!'

then an auth_index of 0 would result in admin being used as the username and funny cats very Jack 21! being used as the password.

Link to this function

get_prometheus_metrics(options \\ [])

View Source
@spec get_prometheus_metrics(options()) ::
  {:ok, map()} | {:error, map() | error_message()}

Gets prometheus metrics.

parameters

Parameters

  • options: Keyword list that contains
    • api: Keyword list that contains
      • url (optional, string): If url is not in options then the url set in the configs will be used.
      • any other options one may want to pass along to the http layer - for example headers
      • auth_index (optional, integer): Index of the username + password combo to be used for endpoint authentication.
      • username: (optional, string): Username to be used for endpoint authentication.
      • password: (optional, string): Password to be used for endpoint authentication.

note

Note

  • Either username and password or auth_index must be provided.
  • If all three are provided auth_index is used.

If the following usernames and passwords are exported as follows:

export USERNAMES='admin, superadmin, metrics'
export PASSWORDS='funny cats very Jack 21!, harry Kack love h39! LW, monitor Kat darrel 23 Jack!'

then an auth_index of 0 would result in admin being used as the username and funny cats very Jack 21! being used as the password.

Link to this function

get_version(options \\ [])

View Source
@spec get_version(options()) :: {:ok, map()} | {:error, map() | error_message()}

Gets system version.

parameters

Parameters

  • options: Keyword list that contains
    • api: Keyword list that contains
      • url (optional, string): If url is not in options then the url set in the configs will be used.
      • any other options one may want to pass along to the http layer - for example headers
      • auth_index (optional, integer): Index of the username + password combo to be used for endpoint authentication.
      • username: (optional, string): Username to be used for endpoint authentication.
      • password: (optional, string): Password to be used for endpoint authentication.

note

Note

  • Either username and password or auth_index must be provided.
  • If all three are provided auth_index is used.

If the following usernames and passwords are exported as follows:

export USERNAMES='admin, superadmin, metrics'
export PASSWORDS='funny cats very Jack 21!, harry Kack love h39! LW, monitor Kat darrel 23 Jack!'

then an auth_index of 0 would result in admin being used as the username and funny cats very Jack 21! being used as the password.