Class NetworkManager

Manages communication with the NetworkManager over DBus Responsible for initializing various other managers/devices such as:

  • Ethernet Device
  • Wifi Device
  • Connection Settings Manager

Hierarchy

  • NetworkManager

Properties

_bus: DBusConnection
_connectionSettingsManagerSingleton: ConnectionSettingsManager
_ethernetDevices: EthernetDevice[]
_networkManagerSingleton: NetworkManager
_wifiDevices: WifiDevice[]
_networkManagerInterface: DBusInterface<AnyInterfaceMethod>
_propertiesInterface: DBusInterface<AnyInterfaceMethod>
_propertiesSubject: BehaviorSubject<NetworkManagerProperties>
properties$: Observable<NetworkManagerProperties>

Continuously updated NetworkManager properties

Methods

  • Initializes a new NetworkManager instance The NetworkManager is a singleton, so calling this twice will return the same object

    Returns

    Promise of a NetworkManager instance

    Parameters

    • Optional bus: DBusConnection

    Returns Promise<NetworkManager>

  • Returns void

  • Reset the timeout for rollback for the checkpoint.

    Note that the added seconds start counting from now, not "Created" timestamp or the previous expiration time. Note that the "Created" property of the checkpoint will stay unchanged by this call. However, the "RollbackTimeout" will be recalculated to give the approximate new expiration time. The new "RollbackTimeout" property will be approximate up to one second precision, which is the accuracy of the property.

    Returns

    Nothing, resolves on success.

    Parameters

    • checkpoint: string

      The DBus object path to the checkpoint to adjust.

    • timeout: number

      Number of seconds from now in which the timeout will expire. Set to 0 to disable the timeout.

    Returns Promise<void>

  • Initializes and returns a new ConnectionSettingsManager ConnectionSettingsManager is a singleton, so subsequent calls will return the same object

    Returns

    Promise of a new ConnectionSettingsManager

    Returns Promise<ConnectionSettingsManager>

  • Create a checkpoint of the current networking configuration for given interfaces. If rollback_timeout is not zero, a rollback is automatically performed after the given timeout.

    Returns

    A Promise of the DBus object path for the created Checkpoint

    Parameters

    • timeout: number

      The time in seconds until NetworkManager will automatically rollback to the checkpoint. Set to zero for infinite.

    • flags: number

      A bitmask of CheckpointCreateFlags for checkpoint creation.

    • devices: string[] = []

      A list of device paths for which a checkpoint should be created. An empty list means all devices. Defaults to an empty list.

    Returns Promise<string>

  • Destroy a previously created checkpoint.

    Returns

    Nothing, resolves on success.

    Parameters

    • checkpoint: string

      The DBus object path to the checkpoint to be destroyed. Set to an empty string to destroy all pending checkpoints.

    Returns Promise<void>

  • Requires root access, depending on user permissions and NetworkManager policy configuration.

    Enables or disables built in connectivity checking mechanism in NetworkManager. The URI present in ConnectivityCheckUri will be polled to determine connection status.

    See

    https://developer-old.gnome.org/NetworkManager/stable/NetworkManager.conf.html Specifically the "connectivity section" near the bottom

    Parameters

    • enable: boolean

      If true, enable connectivity checks; if false, disable connectivity checks

    Returns void

  • Requires root access, depending on user permissions and NetworkManager policy configuration.

    Enables or disables wireless functionality

    Parameters

    • enable: boolean

      If true, enable wireless; if false, disable wireless

    Returns void

  • Initializes and returns a new EthernetDevice array Creates an array of each ethernet device it finds EthernetDevices is a singleton, so subsequent calls will return the same object

    Returns

    Promise of a new EthernetDevice array

    Returns Promise<EthernetDevice[]>

  • Rollback a checkpoint before the timeout is reached.

    Returns

    A Promise of a dictionary of devices represented by their DBus paths and RollbackResult values.

    Parameters

    • checkpoint: string

      The DBus object path to the checkpoint to rollback to.

    Returns Promise<any>

  • Initializes a new WifiDevice array Creates an array of each wifi device it finds WifiDevices is a singleton, so subsequent calls will return the same object

    Returns

    Promise of a new WifiDevice array

    Returns Promise<WifiDevice[]>

Constructors

  • Parameters

    • networkManagerInterface: DBusInterface<AnyInterfaceMethod>
    • propertiesInterface: DBusInterface<AnyInterfaceMethod>
    • initialProperties: any

    Returns NetworkManager

Accessors

Generated using TypeDoc