### Device Matching Configuration Examples Source: https://networkmanager.dev/docs/api/latest/NetworkManager.conf.html Examples of device selection strings using interface names, MAC addresses, and negative matching. ```text interface-name:em4 mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4;interface-name:eth2 interface-name:vboxnet*,except:interface-name:vboxnet2 *,except:mac:00:22:68:1c:59:b1 ``` -------------------------------- ### Activate Connection Asynchronously Source: https://networkmanager.dev/docs/libnm/latest/NMClient.html Starts a connection to a network using specified settings and device. The callback triggers when activation starts, not when it completes. ```C void nm_client_activate_connection_async (NMClient *client, NMConnection *connection, NMDevice *device, const char *specific_object, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); ``` -------------------------------- ### Finish Start Discovery Source: https://networkmanager.dev/docs/libnm/latest/NMDeviceWifiP2P.html Completes the asynchronous start discovery operation. ```c gboolean nm_device_wifi_p2p_start_find_finish (_NMDeviceWifiP2P *device_, _GAsyncResult *result_, _GError **error_); ``` -------------------------------- ### nm_range_get_range Source: https://networkmanager.dev/docs/libnm/latest/NMSetting.html Gets the start and end values for the range. ```APIDOC ## nm_range_get_range ### Description Gets the start and end values for the range. ### Parameters #### Path Parameters - **range** (NMRange *) - Required - the NMRange - **start** (guint64 *) - Required - location to store the start value. - **end** (guint64 *) - Required - location to store the end value. ### Response - **Returns** (gboolean) - TRUE if the range contains more than one element, FALSE otherwise. ``` -------------------------------- ### Get NMRange values Source: https://networkmanager.dev/docs/libnm/latest/NMSetting.html Retrieves the start and end values of an NMRange object. ```C gboolean nm_range_get_range (_const NMRange *range_, _guint64 *start_, _guint64 *end_); ``` -------------------------------- ### StartFind Method Source: https://networkmanager.dev/docs/api/latest/gdbus-org.freedesktop.NetworkManager.Device.WifiP2P.html Initiates a search for Wi-Fi P2P peers with optional timeout settings. ```D-Bus StartFind (IN a{sv} options); ``` -------------------------------- ### nm_device_get_applied_connection_async Source: https://networkmanager.dev/docs/libnm/latest/NMDevice.html Asynchronously begins and gets the currently applied connection. ```APIDOC ## nm_device_get_applied_connection_async ### Description Asynchronously begins and gets the currently applied connection. ### Parameters #### Path Parameters - **device** (NMDevice) - Required - A NMDevice - **flags** (guint32) - Required - The flags argument. See NMDeviceReapplyFlags. - **cancellable** (GCancellable) - Optional - A GCancellable, or NULL - **callback** (GAsyncReadyCallback) - Required - Callback to be called when the reapply operation completes - **user_data** (gpointer) - Required - Caller-specific data passed to callback ``` -------------------------------- ### Enable nm-cloud-setup for Amazon EC2 Source: https://networkmanager.dev/docs/api/latest/nm-cloud-setup.html This script installs the necessary package, configures the environment variable via a systemd drop-in, and enables the service and timer. ```bash dnf install -y NetworkManager-cloud-setup mkdir -p /etc/systemd/system/nm-cloud-setup.service.d cat > /etc/systemd/system/nm-cloud-setup.service.d/10-enable-ec2.conf << EOF [Service] Environment=NM_CLOUD_SETUP_EC2=yes EOF # systemctl enable nm-cloud-setup.service mkdir -p /etc/systemd/system/NetworkManager.service.wants/ ln -s /usr/lib/systemd/system/nm-cloud-setup.service /etc/systemd/system/NetworkManager.service.wants/nm-cloud-setup.service # systemctl enable nm-cloud-setup.timer mkdir -p /etc/systemd/system/timers.target.wants/ ln -s /etc/systemd/system/timers.target.wants/nm-cloud-setup.timer /usr/lib/systemd/system/nm-cloud-setup.timer # systemctl daemon-reload ``` -------------------------------- ### Get NMSettingWireless MTU Source: https://networkmanager.dev/docs/libnm/latest/NMSettingWireless.html Retrieves the 'mtu' property of the NMSettingWireless. No specific setup or constraints are mentioned. ```c guint32 nm_setting_wireless_get_mtu (_NMSettingWireless *setting_); ``` -------------------------------- ### Create a new NMSettingInfiniband object Source: https://networkmanager.dev/docs/libnm/latest/NMSettingInfiniband.html Initializes a new instance with default values. ```C NMSetting * nm_setting_infiniband_new (_void_); ``` -------------------------------- ### Get Wait Device Timeout Source: https://networkmanager.dev/docs/libnm/latest/NMSettingConnection.html Retrieves the timeout value for waiting for a device to become available during connection setup. ```APIDOC ## nm_setting_connection_get_wait_device_timeout () ### Description Retrieves the `NM_SETTING_CONNECTION_WAIT_DEVICE_TIMEOUT` property, which specifies the timeout in milliseconds for waiting for a device. ### Method GET ### Endpoint N/A (Function call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (int32) - **timeout** (gint32) - The timeout value in milliseconds. Returns -1 if the default value is used. #### Response Example ``` 120000 ``` ``` -------------------------------- ### Add and Configure SR-IOV VFs with nmcli Source: https://networkmanager.dev/docs/api/latest/nmcli-examples.html This example demonstrates adding an Ethernet connection and configuring SR-IOV virtual functions (VFs) with specific MAC addresses, VLANs, and rate limits. The kernel is instructed not to auto-probe drivers for the VFs. ```bash $ nmcli con add type ethernet con-name EthernetPF ifname em1 $ nmcli con modify EthernetPF sriov.total-vfs 3 sriov.autoprobe-drivers false $ nmcli con modify EthernetPF sriov.vfs '0 mac=00:11:22:33:44:55 vlans=10, 1 trust=true spoof-check=false' $ nmcli con modify EthernetPF +sriov.vfs '2 max-tx-rate=20' ``` -------------------------------- ### Create NMVpnPluginInfo with Data Source: https://networkmanager.dev/docs/libnm/latest/NMVpnPluginInfo.html Creates a VPN plugin info instance using provided data instead of reading from a file. The keyfile must contain mandatory fields. ```c NMVpnPluginInfo * nm_vpn_plugin_info_new_with_data (_const char *filename_, _GKeyFile *keyfile_, _GError **error_); ``` -------------------------------- ### Get NMDeviceBt Name Source: https://networkmanager.dev/docs/libnm/latest/NMDeviceBt.html Retrieves the name of the NMDeviceBt. This function is used to get the device's name. ```c const char * nm_device_bt_get_name (_NMDeviceBt *device_); ``` -------------------------------- ### Get NMCheckpoint Rollback Timeout Source: https://networkmanager.dev/docs/libnm/latest/NMCheckpoint.html Gets the timeout in seconds for automatic rollback of a checkpoint. Requires a valid NMCheckpoint object. ```c guint32 nm_checkpoint_get_rollback_timeout (_NMCheckpoint *checkpoint_); ``` -------------------------------- ### Create a new NMSettingPrefixDelegation object Source: https://networkmanager.dev/docs/libnm/latest/NMSettingPrefixDelegation.html Initializes a new instance with default values. ```c NMSetting * nm_setting_prefix_delegation_new (_void_); ``` -------------------------------- ### Basic NetworkManager Configuration Source: https://networkmanager.dev/docs/api/latest/NetworkManager.conf.html A minimal example of a NetworkManager configuration file defining a section and a key-value pair. ```ini [main] plugins=keyfile ``` -------------------------------- ### Create a new NMSettingWifiP2P object Source: https://networkmanager.dev/docs/libnm/latest/NMSettingWifiP2P.html Initializes a new NMSettingWifiP2P instance with default values. ```C NMSetting * nm_setting_wifi_p2p_new (_void_); ``` -------------------------------- ### Initialize libnm Client in C Source: https://networkmanager.dev/docs/libnm/latest/usage.html Basic C code to initialize the NetworkManager client and print its version. Requires including NetworkManager.h. ```c #include #include int main (int argc, char *argv[]) { NMClient *client; client = nm_client_new (NULL, NULL); if (client) g_print ("NetworkManager version: %s\n", nm_client_get_version (client)); } ``` -------------------------------- ### Get Slave Interfaces of NMDeviceOvsPort Source: https://networkmanager.dev/docs/libnm/latest/NMDeviceOvsPort.html Deprecated function to get interfaces attached as ports to a device. Use nm_device_get_ports() instead. Returns an internal copy that must not be modified. ```c const GPtrArray * nm_device_ovs_port_get_slaves (_NMDeviceOvsPort *device_); ``` -------------------------------- ### Start Peer Discovery Source: https://networkmanager.dev/docs/libnm/latest/NMDeviceWifiP2P.html Initiates a search for Wi-Fi P2P peers. The operation runs asynchronously. ```c void nm_device_wifi_p2p_start_find (_NMDeviceWifiP2P *device_, _GVariant *options_, _GCancellable *cancellable_, _GAsyncReadyCallback callback_, _gpointer user_data_); ``` -------------------------------- ### Get NMCheckpoint Creation Timestamp Source: https://networkmanager.dev/docs/libnm/latest/NMCheckpoint.html Gets the timestamp of checkpoint creation in CLOCK_BOOTTIME milliseconds. Use nm_utils_get_timestamp_msec() for comparable time values. Requires a valid NMCheckpoint object. ```c gint64 nm_checkpoint_get_created (_NMCheckpoint *checkpoint_); ``` -------------------------------- ### Get NMVpnEditor instance Source: https://networkmanager.dev/docs/libnm/latest/NMVpnEditorPlugin.html Retrieves a new NMVpnEditor for the specified connection. ```c NMVpnEditor * nm_vpn_editor_plugin_get_editor (_NMVpnEditorPlugin *plugin_, _NMConnection *connection_, _GError **error_); ``` -------------------------------- ### Create NMVpnPluginInfo from File Source: https://networkmanager.dev/docs/libnm/latest/NMVpnPluginInfo.html Reads VPN plugin information from a specified file. Ensure file permissions and ownership are correct before calling. ```c NMVpnPluginInfo * nm_vpn_plugin_info_new_from_file (_const char *filename_, _GError **error_); ``` -------------------------------- ### nm_client_get_active_connections Source: https://networkmanager.dev/docs/libnm/latest/NMClient.html Gets the active connections. ```APIDOC ## nm_client_get_active_connections ### Description Gets the active connections. ### Parameters - **client** (NMClient) - Required - A NMClient instance. ### Response - **Returns** (GPtrArray*) - A GPtrArray containing all the active NMActiveConnections. ``` -------------------------------- ### Get 802.1x Phase 2 Private Key Scheme Source: https://networkmanager.dev/docs/libnm/latest/NMSetting8021x.html Returns the scheme used to store the 'phase 2' private key. Depending on the scheme, use appropriate get functions to retrieve the key data. ```c NMSetting8021xCKScheme nm_setting_802_1x_get_phase2_private_key_scheme (_NMSetting8021x *setting_); ``` -------------------------------- ### Create new NMSettingEthtool instance Source: https://networkmanager.dev/docs/libnm/latest/NMSettingEthtool.html Initializes a new NMSettingEthtool object with default values. ```C NMSetting * nm_setting_ethtool_new (void); ``` -------------------------------- ### Create a new NMSettingWpan object Source: https://networkmanager.dev/docs/libnm/latest/NMSettingWpan.html Initializes a new NMSettingWpan instance with default values. ```c NMSetting * nm_setting_wpan_new (_void_); ``` -------------------------------- ### nm_setting_vpn_get_timeout Source: https://networkmanager.dev/docs/libnm/latest/NMSettingVpn.html Gets the timeout property of the setting. ```APIDOC ## nm_setting_vpn_get_timeout ### Description Gets the timeout property of the setting. ### Method N/A (This appears to be a function signature, not a REST endpoint) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### nm_device_disconnect_finish Source: https://networkmanager.dev/docs/libnm/latest/NMDevice.html Gets the result of a call to nm_device_disconnect_async(). ```APIDOC ## nm_device_disconnect_finish ### Description Gets the result of a call to nm_device_disconnect_async(). ### Parameters #### Path Parameters - **device** (NMDevice) - Required - A NMDevice - **result** (GAsyncResult) - Required - The result passed to the GAsyncReadyCallback - **error** (GError**) - Optional - Location for a GError, or NULL ### Response - **Returns** (gboolean) - TRUE on success, FALSE on error. ``` -------------------------------- ### nm_vpn_plugin_info_list_load Source: https://networkmanager.dev/docs/libnm/latest/NMVpnPluginInfo.html Loads a list of VPN plugins from the default directories. ```APIDOC ## nm_vpn_plugin_info_list_load ### Description Loads a list of VPN plugins from the default directories, rejecting duplicates. ### Method N/A (Function) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **plugin_list** (array of NMVpnPluginInfo) - A GSList containing loaded VPN plugin information. #### Response Example ``` [ { "program": "/usr/lib/NetworkManager/nm-vpn-plugin-openvpn", "aliases": ["openvpn"] }, { "program": "/usr/lib/NetworkManager/nm-vpn-plugin-vpnc", "aliases": ["vpnc"] } ] ``` ``` -------------------------------- ### nm_device_get_applied_connection_finish Source: https://networkmanager.dev/docs/libnm/latest/NMDevice.html Gets the result of a call to nm_device_get_applied_connection_async(). ```APIDOC ## nm_device_get_applied_connection_finish ### Description Gets the result of a call to nm_device_get_applied_connection_async(). ### Parameters #### Path Parameters - **device** (NMDevice) - Required - A NMDevice - **result** (GAsyncResult) - Required - The result passed to the GAsyncReadyCallback - **version_id** (guint64*) - Optional - The current version id of the applied connection. - **error** (GError**) - Optional - Location for a GError, or NULL ### Response - **Returns** (NMConnection) - A currently applied NMConnection or NULL in case of error. ``` -------------------------------- ### Import connection from file Source: https://networkmanager.dev/docs/libnm/latest/NMVpnEditorPlugin.html Attempts to import a connection configuration from the specified file path. ```c NMConnection * nm_vpn_editor_plugin_import (_NMVpnEditorPlugin *plugin_, _const char *path_, _GError **error_); ``` -------------------------------- ### Create a new NMSettingPppoe object Source: https://networkmanager.dev/docs/libnm/latest/NMSettingPppoe.html Initializes a new NMSettingPppoe instance with default values. ```c NMSetting * nm_setting_pppoe_new (_void_); ``` -------------------------------- ### nm_client_load_connections_finish Source: https://networkmanager.dev/docs/libnm/latest/NMClient.html Gets the result of an nm_client_load_connections_async() call. ```APIDOC ## nm_client_load_connections_finish ### Description Gets the result of an `nm_client_load_connections_async()` call. See `nm_client_load_connections()` for more details. ### Method Client Function (to be used after async call) ### Endpoint N/A (Client-side function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (TRUE) Returns TRUE on success. Note that even in the success case, you might have individual failures. #### Response Example None ``` -------------------------------- ### nm_device_reapply_finish Source: https://networkmanager.dev/docs/libnm/latest/NMDevice.html Gets the result of a call to nm_device_reapply_async. ```APIDOC ## nm_device_reapply_finish ### Description Gets the result of a call to nm_device_reapply_async. ### Parameters #### Path Parameters - **device** (NMDevice) - Required - The device. - **result** (GAsyncResult) - Required - The result passed to the callback. - **error** (GError) - Optional - Location for a GError. ### Response - **Returns** (gboolean) - TRUE on success, FALSE on error. ``` -------------------------------- ### Create new NMSettingVpn Source: https://networkmanager.dev/docs/libnm/latest/NMSettingVpn.html Initializes a new, empty NMSettingVpn object with default values. ```C NMSetting * nm_setting_vpn_new (_void_); ``` -------------------------------- ### nm_client_add_connection2_finish Source: https://networkmanager.dev/docs/libnm/latest/NMClient.html Gets the result of a call to nm_client_add_connection2(). ```APIDOC ## nm_client_add_connection2_finish ### Description Gets the result of a call to nm_client_add_connection2(). Available since 1.20. ### Parameters - **client** (NMClient) - Required - The NMClient - **result** (GAsyncResult) - Required - The GAsyncResult - **out_result** (GVariant**) - Optional - The output GVariant from AddConnection2() - **error** (GError**) - Required - The error argument ### Response - **Returns** (NMRemoteConnection*) - On success, a pointer to the added NMRemoteConnection ``` -------------------------------- ### nm_client_add_connection_finish Source: https://networkmanager.dev/docs/libnm/latest/NMClient.html Gets the result of a call to nm_client_add_connection_async(). ```APIDOC ## nm_client_add_connection_finish ### Description Gets the result of a call to nm_client_add_connection_async(). ### Parameters - **client** (NMClient) - Required - An NMClient - **result** (GAsyncResult) - Required - The result passed to the GAsyncReadyCallback - **error** (GError**) - Optional - Location for a GError, or NULL ### Response - **Returns** (NMRemoteConnection*) - The new NMRemoteConnection on success, NULL on failure ``` -------------------------------- ### Load VPN Editor Plugin from File Source: https://networkmanager.dev/docs/libnm/latest/NMVpnEditorPlugin.html Loads a shared library and creates an NMVpnEditorPlugin instance with file validation checks. ```C NMVpnEditorPlugin * nm_vpn_editor_plugin_load_from_file (const char *plugin_name, const char *check_service, int check_owner, NMUtilsCheckFilePredicate check_file, gpointer user_data, GError **error); ``` -------------------------------- ### nm_device_get_interface_flags Source: https://networkmanager.dev/docs/libnm/latest/NMDevice.html Gets the interface flags of the device. ```APIDOC ## nm_device_get_interface_flags ### Description Gets the interface flags of the device. ### Parameters #### Path Parameters - **device** (NMDevice) - Required - The device to query. ### Response - **Returns** (NMDeviceInterfaceFlags) - The flags. ``` -------------------------------- ### Load VPN Plugin List Source: https://networkmanager.dev/docs/libnm/latest/NMVpnPluginInfo.html Loads a list of all available VPN plugins from the default directories, automatically rejecting duplicates. Returns a GSList of NMVpnPluginInfo instances. ```c GSList * nm_vpn_plugin_info_list_load (_void_); ``` -------------------------------- ### nm_device_get_metered Source: https://networkmanager.dev/docs/libnm/latest/NMDevice.html Gets the metered setting of an NMDevice. ```APIDOC ## nm_device_get_metered ### Description Gets the metered setting of a NMDevice. ### Parameters #### Path Parameters - **device** (NMDevice) - Required - The device to query. ### Response - **Returns** (NMMetered) - The metered setting. ``` -------------------------------- ### Configure Ethernet with Manual IP Source: https://networkmanager.dev/docs/api/latest/nmcli-examples.html Adds an ethernet profile with static IP, gateway, and DNS settings, then displays the configuration for verification. ```bash nmcli con add con-name my-con-em1 ifname em1 type ethernet \ ip4 192.168.100.100/24 gw4 192.168.100.1 ip4 1.2.3.4 ip6 abbe::cafe nmcli con mod my-con-em1 ipv4.dns "8.8.8.8 8.8.4.4" nmcli con mod my-con-em1 +ipv4.dns 1.2.3.4 nmcli con mod my-con-em1 ipv6.dns "2001:4860:4860::8888 2001:4860:4860::8844" nmcli -p con show my-con-em1 ``` -------------------------------- ### Create a new NMSettingVlan Source: https://networkmanager.dev/docs/libnm/latest/NMSettingVlan.html Initializes a new empty NMSettingVlan object with default values. ```C NMSetting * nm_setting_vlan_new (void); ``` -------------------------------- ### nm_client_add_and_activate_connection2_finish Source: https://networkmanager.dev/docs/libnm/latest/NMClient.html Gets the result of a call to nm_client_add_and_activate_connection2(). ```APIDOC ## nm_client_add_and_activate_connection2_finish ### Description Gets the result of a call to nm_client_add_and_activate_connection2(). You can call nm_active_connection_get_connection() on the returned NMActiveConnection to find the path of the created NMConnection. ### Parameters - **client** (NMClient) - Required - an NMClient - **result** (GAsyncResult) - Required - the result passed to the GAsyncReadyCallback - **out_result** (GVariant**) - Optional - the output result of type "a{sv}" returned by D-Bus' AddAndActivate2 call. - **error** (GError**) - Optional - location for a GError, or NULL ### Returns - **NMActiveConnection** - The new NMActiveConnection on success, NULL on failure. ``` -------------------------------- ### nm_secret_agent_old_register_finish Source: https://networkmanager.dev/docs/libnm/latest/NMSecretAgentOld.html Gets the result of a call to nm_secret_agent_old_register_async. ```APIDOC ## nm_secret_agent_old_register_finish ### Description Retrieves the result of the asynchronous registration process. ### Parameters - **self** (NMSecretAgentOld) - Required - The agent instance. - **result** (GAsyncResult) - Required - The result passed to the callback. - **error** (GError**) - Optional - Return location for a GError. ### Response - **Returns** (gboolean) - TRUE if registration was successful, FALSE on error. ``` -------------------------------- ### Declare nm_client_add_connection_async Source: https://networkmanager.dev/docs/libnm/latest/NMClient.html Requests the remote settings service to add a connection. Use this for asynchronous addition of connection settings. ```c void nm_client_add_connection_async (_NMClient *client_, _NMConnection *connection_, _gboolean save_to_disk_, _GCancellable *cancellable_, _GAsyncReadyCallback callback_, _gpointer user_data_); ``` -------------------------------- ### nm_remote_connection_update2_finish Source: https://networkmanager.dev/docs/libnm/latest/NMRemoteConnection.html Gets the result of a call to nm_remote_connection_commit_changes_async(). ```APIDOC ## nm_remote_connection_update2_finish ### Description Gets the result of a call to nm_remote_connection_commit_changes_async(). ### Parameters - **connection** (NMRemoteConnection) - The NMRemoteConnection - **result** (GAsyncResult) - The result passed to the GAsyncReadyCallback - **error** (GError**) - Location for a GError, or NULL ### Returns - **GVariant** - On success, a GVariant of type "a{sv}" with the result. On failure, NULL. ### Since 1.12 ``` -------------------------------- ### Activate Connections Source: https://networkmanager.dev/docs/api/latest/nmcli.html Commands to bring up connections, optionally specifying interfaces or BSSIDs. ```bash nmcli -p con up "My wired connection" ifname eth0 ``` ```bash nmcli con up 6b028a27-6dc9-4411-9886-e9ad1dd43761 ap 00:3A:98:7C:42:D3 ``` -------------------------------- ### NMDeviceDummy Functions and Macros Source: https://networkmanager.dev/docs/libnm/latest/api-index-full.html Functions and macros for Dummy devices. ```APIDOC ## NMDeviceDummy Functions and Macros ### Description Provides functions and macros for Dummy devices. ### Macros - **NM_DEVICE_DUMMY_HW_ADDRESS**: Hardware address of the dummy device. ### Functions - **nm_device_dummy_get_hw_address**: Get the hardware address of the dummy device. ``` -------------------------------- ### nm_client_get_devices Source: https://networkmanager.dev/docs/libnm/latest/NMClient.html Gets all the known network devices. ```APIDOC ## nm_client_get_devices ### Description Gets all the known network devices. ### Parameters - **client** (NMClient) - Required - A NMClient instance. ### Response - **Returns** (GPtrArray*) - A GPtrArray containing all the NMDevices. ``` -------------------------------- ### Create a new NMSettingLoopback object Source: https://networkmanager.dev/docs/libnm/latest/NMSettingLoopback.html Initializes a new loopback setting object with default values. ```c NMSetting * nm_setting_loopback_new (_void_); ``` -------------------------------- ### nm_client_save_hostname_finish Source: https://networkmanager.dev/docs/libnm/latest/NMClient.html Gets the result of an nm_client_save_hostname_async() call. ```APIDOC ## nm_client_save_hostname_finish ### Description Gets the result of an nm_client_save_hostname_async() call. ### Parameters - **client** (NMClient) - Required - The NMClient instance. - **result** (GAsyncResult) - Required - The result passed to the GAsyncReadyCallback. - **error** (GError**) - Optional - Return location for GError. ### Response - **Returns** (gboolean) - TRUE if the request was successful, FALSE if it failed. ``` -------------------------------- ### nm_device_get_capabilities Source: https://networkmanager.dev/docs/libnm/latest/NMDevice.html Gets the device's capabilities. ```APIDOC ## nm_device_get_capabilities ### Description Gets the device's capabilities. ### Method GET (Implied) ### Endpoint N/A (Function call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **capabilities** (NMDeviceCapabilities) - The capabilities of the device. #### Response Example ```json { "capabilities": [ "NM_DEVICE_CAP_CARRIER", "NM_DEVICE_CAP_IP4", "NM_DEVICE_CAP_IP6" ] } ``` ``` -------------------------------- ### Create a new NMSettingOvsPatch object Source: https://networkmanager.dev/docs/libnm/latest/NMSettingOvsPatch.html Initializes a new NMSettingOvsPatch instance with default values. ```c NMSetting * nm_setting_ovs_patch_new (_void_); ``` -------------------------------- ### nm_setting_get_dbus_property_type Source: https://networkmanager.dev/docs/libnm/latest/NMSetting.html Gets the D-Bus marshalling type of a property. ```APIDOC ## nm_setting_get_dbus_property_type ### Description Gets the D-Bus marshalling type of a property. property_name is a D-Bus property name, which may not necessarily be a GObject property. ### Parameters #### Path Parameters - **setting** (NMSetting) - Required - an NMSetting - **property_name** (const char *) - Required - the property of setting to get the type of ### Response - **Returns** (const GVariantType *) - the D-Bus marshalling type of property on setting. ``` -------------------------------- ### org.freedesktop.NetworkManager.Device.WifiP2P Methods Source: https://networkmanager.dev/docs/api/latest/gdbus-org.freedesktop.NetworkManager.Device.WifiP2P.html This section covers the methods available for interacting with Wi-Fi P2P devices, including starting and stopping peer discovery. ```APIDOC ## POST /org.freedesktop.NetworkManager.Device.WifiP2P ### Description Provides methods to manage Wi-Fi P2P operations on a device. ### Method Methods available: StartFind, StopFind ### Endpoint /org.freedesktop.NetworkManager.Device.WifiP2P ### Methods #### StartFind (IN a{sv} options) Initiates a Wi-Fi P2P peer discovery operation. - **options** (a{sv}) - Required - A dictionary of options for the find operation. - **i timeout** (integer) - Optional - Timeout value in seconds (1-600). Defaults to 30. #### StopFind () Stops an ongoing Wi-Fi P2P peer discovery operation. ### Request Example ```json { "method": "StartFind", "params": [{"timeout": 60}] } ``` ### Response Example ```json { "result": null } ``` ``` -------------------------------- ### Import WireGuard Configuration Source: https://networkmanager.dev/docs/libnm/latest/libnm-nm-conn-utils.html Reads a WireGuard configuration file and returns a new NMConnection object. Requires a valid file path and handles errors via GError. ```C NMConnection * nm_conn_wireguard_import (const char *filename, GError **error); ``` -------------------------------- ### nm_remote_connection_get_secrets_finish Source: https://networkmanager.dev/docs/libnm/latest/NMRemoteConnection.html Gets the result of an asynchronous secret request. ```APIDOC ## nm_remote_connection_get_secrets_finish ### Description Gets the result of a call to nm_remote_connection_get_secrets_async(). ### Parameters #### Path Parameters - **connection** (NMRemoteConnection) - Required - The NMRemoteConnection - **result** (GAsyncResult) - Required - The result passed to the GAsyncReadyCallback - **error** (GError**) - Optional - Location for a GError, or NULL ### Response #### Success Response (200) - **returns** (GVariant*) - A GVariant of type NM_VARIANT_TYPE_CONNECTION containing connection's secrets, or NULL on error. ``` -------------------------------- ### Add Ethernet Connection in nmcli Interactive Editor Source: https://networkmanager.dev/docs/api/latest/nmcli-examples.html This example shows the initial steps of adding a new Ethernet connection profile using the `nmcli connection edit` command. It enters the interactive editor and displays the default settings for a new connection. ```bash $ nmcli connection edit type ethernet ===| nmcli interactive connection editor |=== Adding a new '802-3-ethernet' connection Type 'help' or '?' for available commands. Type 'describe [.]' for detailed property description. You may edit the following settings: connection, 802-3-ethernet (ethernet), 802-1x, ipv4, ipv6, dcb nmcli> **print** =========================================================================== Connection details =========================================================================== connection.id: ethernet-4 connection.uuid: de89cdeb-a3e1-4d53-8fa0-c22546c775f4 connection.interface-name: -- connection.type: 802-3-ethernet connection.autoconnect: yes connection.autoconnect-priority: 0 connection.timestamp: 0 connection.read-only: no connection.permissions: connection.zone: -- connection.controller: -- connection.port-type: -- connection.secondaries: connection.gateway-ping-timeout: 0 --------------------------------------------------------------------------- 802-3-ethernet.port: -- 802-3-ethernet.speed: 0 802-3-ethernet.duplex: -- 802-3-ethernet.auto-negotiate: yes 802-3-ethernet.mac-address: -- 802-3-ethernet.cloned-mac-address: -- 802-3-ethernet.mac-address-blacklist: 802-3-ethernet.mtu: auto 802-3-ethernet.s390-subchannels: 802-3-ethernet.s390-nettype: -- 802-3-ethernet.s390-options: --------------------------------------------------------------------------- ipv4.method: auto ipv4.dns: ipv4.dns-search: ``` -------------------------------- ### Get Domains Source: https://networkmanager.dev/docs/libnm/latest/NMIPConfig.html Retrieves an array of domain names. ```c const char *const * nm_ip_config_get_domains (_NMIPConfig *config_); ``` -------------------------------- ### nm_client_get_all_devices Source: https://networkmanager.dev/docs/libnm/latest/NMClient.html Gets both real devices and device placeholders. ```APIDOC ## nm_client_get_all_devices ### Description Gets both real devices and device placeholders (e.g., software devices which do not currently exist). ### Parameters - **client** (NMClient) - Required - A NMClient instance. ### Response - **Returns** (GPtrArray*) - A GPtrArray containing all the NMDevices. ``` -------------------------------- ### Configure SR-IOV Settings Source: https://networkmanager.dev/docs/api/latest/nm-settings-ifcfg-rh.html Manage virtual functions and driver autoprobing for SR-IOV interfaces. ```bash SRIOV_TOTAL_VFS=16 ``` ```bash SRIOV_VF10="mac=00:11:22:33:44:55" ``` ```bash SRIOV_AUTOPROBE_DRIVERS=0,1 ``` -------------------------------- ### nm_device_get_type_description Source: https://networkmanager.dev/docs/libnm/latest/NMDevice.html Gets a non-localized description of the device type. ```APIDOC ## nm_device_get_type_description ### Description Gets a (non-localized) description of the type of device. ### Method GET (Implied) ### Endpoint N/A (Function call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **type_description** (string) - The type description of the device. #### Response Example ``` "ethernet" ``` ``` -------------------------------- ### Create NMSettingTun Object Source: https://networkmanager.dev/docs/libnm/latest/NMSettingTun.html Use this function to create a new NMSettingTun object. It initializes the object with default values. ```c NMSetting * nm_setting_tun_new (_void_); ``` -------------------------------- ### Get NMSettingIP4Config Source: https://networkmanager.dev/docs/libnm/latest/NMConnection.html Retrieves the NMSettingIP4Config from a connection if it exists. ```APIDOC ## nm_connection_get_setting_ip4_config ### Description A shortcut to return any NMSettingIP4Config the connection might contain. Note that it returns the value as type NMSettingIPConfig, since the vast majority of IPv4-setting-related methods are on that type, not NMSettingIP4Config. ### Method GET (conceptual) ### Endpoint N/A (Function call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **NMSettingIP4Config** (object) - The NMSettingIP4Config object if found, otherwise NULL. #### Response Example ```json { "example": "NMSettingIP4Config object or null" } ``` ``` -------------------------------- ### Create a new NMSettingUser Source: https://networkmanager.dev/docs/libnm/latest/NMSettingUser.html Initializes a new empty NMSettingUser object. ```C NMSetting * nm_setting_user_new (_void_); ``` -------------------------------- ### Import OpenVPN Configuration with nmcli Source: https://networkmanager.dev/docs/api/latest/nmcli.html This command imports an OpenVPN configuration file into NetworkManager. The file path must be correct. ```bash nmcli con import type openvpn file ~/Downloads/frootvpn.ovpn ``` -------------------------------- ### Get NMSettingIPTunnel Source: https://networkmanager.dev/docs/libnm/latest/NMConnection.html Retrieves the NMSettingIPTunnel from a connection if it exists. ```APIDOC ## nm_connection_get_setting_ip_tunnel ### Description A shortcut to return any NMSettingIPTunnel the connection might contain. ### Method GET (conceptual) ### Endpoint N/A (Function call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **NMSettingIPTunnel** (object) - The NMSettingIPTunnel object if found, otherwise NULL. #### Response Example ```json { "example": "NMSettingIPTunnel object or null" } ``` ``` -------------------------------- ### Get NMSettingInfiniband Source: https://networkmanager.dev/docs/libnm/latest/NMConnection.html Retrieves the NMSettingInfiniband from a connection if it exists. ```APIDOC ## nm_connection_get_setting_infiniband ### Description A shortcut to return any NMSettingInfiniband the connection might contain. ### Method GET (conceptual) ### Endpoint N/A (Function call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **NMSettingInfiniband** (object) - The NMSettingInfiniband object if found, otherwise NULL. #### Response Example ```json { "example": "NMSettingInfiniband object or null" } ``` ``` -------------------------------- ### Initialize libnm Client in Python Source: https://networkmanager.dev/docs/libnm/latest/usage.html Python code to initialize the NetworkManager client and print its version using GObject introspection. Requires the PyGObject library. ```python import gi gi.require_version('NM', '1.0') from gi.repository import NM client = NM.Client.new(None) print ("NetworkManager version " + client.get_version()) ``` -------------------------------- ### Get NMSettingGsm Source: https://networkmanager.dev/docs/libnm/latest/NMConnection.html Retrieves the NMSettingGsm from a connection if it exists. ```APIDOC ## nm_connection_get_setting_gsm ### Description A shortcut to return any NMSettingGsm the connection might contain. ### Method GET (conceptual) ### Endpoint N/A (Function call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **NMSettingGsm** (object) - The NMSettingGsm object if found, otherwise NULL. #### Response Example ```json { "example": "NMSettingGsm object or null" } ``` ``` -------------------------------- ### nm_device_reapply_async Source: https://networkmanager.dev/docs/libnm/latest/NMDevice.html Asynchronously begins an attempt to update device with changes to the currently active connection. ```APIDOC ## nm_device_reapply_async ### Description Asynchronously begins an attempt to update device with changes to the currently active connection made since it was last applied. ### Parameters #### Path Parameters - **device** (NMDevice) - Required - The device to update. - **connection** (NMConnection) - Optional - The NMConnection to replace the applied settings with. - **version_id** (guint64) - Required - The expected version id. - **flags** (guint32) - Required - Always set to zero. - **cancellable** (GCancellable) - Optional - A GCancellable object. - **callback** (GAsyncReadyCallback) - Required - Callback to be called when the operation completes. - **user_data** (gpointer) - Required - Caller-specific data. ``` -------------------------------- ### Get NMSettingGeneric Source: https://networkmanager.dev/docs/libnm/latest/NMConnection.html Retrieves the NMSettingGeneric from a connection if it exists. ```APIDOC ## nm_connection_get_setting_generic ### Description A shortcut to return any NMSettingGeneric the connection might contain. ### Method GET (conceptual) ### Endpoint N/A (Function call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **NMSettingGeneric** (object) - The NMSettingGeneric object if found, otherwise NULL. #### Response Example ```json { "example": "NMSettingGeneric object or null" } ``` ``` -------------------------------- ### POST /org.freedesktop.NetworkManager.Device.Reapply Source: https://networkmanager.dev/docs/api/latest/ix01.html The Reapply method allows for reapplying device configurations. ```APIDOC ## POST /org.freedesktop.NetworkManager.Device.Reapply ### Description Triggers the Reapply method on a NetworkManager device to refresh its configuration. ``` -------------------------------- ### Get NMSettingDummy Source: https://networkmanager.dev/docs/libnm/latest/NMConnection.html Retrieves the NMSettingDummy from a connection if it exists. ```APIDOC ## nm_connection_get_setting_dummy ### Description A shortcut to return any NMSettingDummy the connection might contain. ### Method GET (conceptual) ### Endpoint N/A (Function call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **NMSettingDummy** (object) - The NMSettingDummy object if found, otherwise NULL. #### Response Example ```json { "example": "NMSettingDummy object or null" } ``` ``` -------------------------------- ### Create New NMSettingBond Source: https://networkmanager.dev/docs/libnm/latest/NMSettingBond.html Use this function to create a new NMSettingBond object. It initializes the object with default values. ```c NMSetting * nm_setting_bond_new (_void_); ``` -------------------------------- ### Get NMSettingDcb Source: https://networkmanager.dev/docs/libnm/latest/NMConnection.html Retrieves the NMSettingDcb from a connection if it exists. ```APIDOC ## nm_connection_get_setting_dcb ### Description A shortcut to return any NMSettingDcb the connection might contain. ### Method GET (conceptual) ### Endpoint N/A (Function call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **NMSettingDcb** (object) - The NMSettingDcb object if found, otherwise NULL. #### Response Example ```json { "example": "NMSettingDcb object or null" } ``` ``` -------------------------------- ### Create a new NMSettingVeth object Source: https://networkmanager.dev/docs/libnm/latest/NMSettingVeth.html Initializes a new NMSettingVeth instance with default values. ```c NMSetting * nm_setting_veth_new (_void_); ``` -------------------------------- ### Create a new NMSettingOvsPort Source: https://networkmanager.dev/docs/libnm/latest/NMSettingOvsPort.html Initializes a new NMSettingOvsPort object with default values. ```c NMSetting * nm_setting_ovs_port_new (_void_); ``` -------------------------------- ### Get NMSettingConnection Source: https://networkmanager.dev/docs/libnm/latest/NMConnection.html Retrieves the NMSettingConnection from a connection if it exists. ```APIDOC ## nm_connection_get_setting_connection ### Description A shortcut to return any NMSettingConnection the connection might contain. ### Method GET (conceptual) ### Endpoint N/A (Function call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **NMSettingConnection** (object) - The NMSettingConnection object if found, otherwise NULL. #### Response Example ```json { "example": "NMSettingConnection object or null" } ``` ``` -------------------------------- ### Get NMSettingCdma Source: https://networkmanager.dev/docs/libnm/latest/NMConnection.html Retrieves the NMSettingCdma from a connection if it exists. ```APIDOC ## nm_connection_get_setting_cdma ### Description A shortcut to return any NMSettingCdma the connection might contain. ### Method GET (conceptual) ### Endpoint N/A (Function call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **NMSettingCdma** (object) - The NMSettingCdma object if found, otherwise NULL. #### Response Example ```json { "example": "NMSettingCdma object or null" } ``` ``` -------------------------------- ### Show Wi-Fi interface properties Source: https://networkmanager.dev/docs/api/latest/nmcli-examples.html Retrieves detailed general and Wi-Fi specific configuration for a network interface. ```bash $ nmcli -p -f general,wifi-properties device show wlan0 ``` -------------------------------- ### Get NMSettingBridgePort Source: https://networkmanager.dev/docs/libnm/latest/NMConnection.html Retrieves the NMSettingBridgePort from a connection if it exists. ```APIDOC ## nm_connection_get_setting_bridge_port ### Description A shortcut to return any NMSettingBridgePort the connection might contain. ### Method GET (conceptual) ### Endpoint N/A (Function call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **NMSettingBridgePort** (object) - The NMSettingBridgePort object if found, otherwise NULL. #### Response Example ```json { "example": "NMSettingBridgePort object or null" } ``` ``` -------------------------------- ### org.freedesktop.NetworkManager.PPP Methods Source: https://networkmanager.dev/docs/api/latest/gdbus-org.freedesktop.NetworkManager.PPP.html This section details the available methods for the org.freedesktop.NetworkManager.PPP interface. ```APIDOC ## org.freedesktop.NetworkManager.PPP ### Description Helper interface for a PPP plugin. ### Methods #### NeedSecrets ``` NeedSecrets (OUT s username, OUT s password); ``` **Description:** Retrieves the username and password required for PPP authentication. **Parameters:** - **username** (s) - OUT - The username for authentication. - **password** (s) - OUT - The password for authentication. #### SetIp4Config ``` SetIp4Config (IN a{sv} config); ``` **Description:** Sets the IPv4 configuration for the PPP connection. **Parameters:** - **config** (a{sv}) - IN - A dictionary of string-to-variant values representing the IPv4 configuration. #### SetIp6Config ``` SetIp6Config (IN a{sv} config); ``` **Description:** Sets the IPv6 configuration for the PPP connection. **Parameters:** - **config** (a{sv}) - IN - A dictionary of string-to-variant values representing the IPv6 configuration. #### SetState ``` SetState (IN u state); ``` **Description:** Sets the state of the PPP connection. **Parameters:** - **state** (u) - IN - An unsigned integer representing the connection state. #### SetIfindex ``` SetIfindex (IN i ifindex); ``` **Description:** Sets the interface index for the PPP connection. **Parameters:** - **ifindex** (i) - IN - An integer representing the interface index. ``` -------------------------------- ### Create a new NMSettingGsm object Source: https://networkmanager.dev/docs/libnm/latest/NMSettingGsm.html Initializes a new NMSettingGsm instance with default values. ```C NMSetting * nm_setting_gsm_new (_void_); ``` -------------------------------- ### Get NMSettingBridge Source: https://networkmanager.dev/docs/libnm/latest/NMConnection.html Retrieves the NMSettingBridge from a connection if it exists. ```APIDOC ## nm_connection_get_setting_bridge ### Description A shortcut to return any NMSettingBridge the connection might contain. ### Method GET (conceptual) ### Endpoint N/A (Function call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **NMSettingBridge** (object) - The NMSettingBridge object if found, otherwise NULL. #### Response Example ```json { "example": "NMSettingBridge object or null" } ``` ``` -------------------------------- ### Create Secrets Dictionary for Wi-Fi PSK Source: https://networkmanager.dev/docs/libnm/latest/NMSecretAgentOld.html Use this example to create a GVariant dictionary for Wi-Fi PSK secrets. This dictionary can then be passed to NMSecretAgentOldGetSecretsFunc. ```c NMConnection *secrets; NMSettingWirelessSecurity *s_wsec; GVariant *secrets_dict; secrets = nm_simple_connection_new (); s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new (); g_object_set (G_OBJECT (s_wsec), NM_SETTING_WIRELESS_SECURITY_PSK, "my really cool PSK", NULL); nm_connection_add_setting (secrets, NM_SETTING (s_wsec)); secrets_dict = nm_connection_to_dbus (secrets, NM_CONNECTION_SERIALIZE_ALL); (call the NMSecretAgentOldGetSecretsFunc with secrets_dict) g_object_unref (secrets); g_variant_unref (secrets_dict); ``` -------------------------------- ### Get NMSettingTeamPort Source: https://networkmanager.dev/docs/libnm/latest/NMConnection.html Retrieves the NMSettingTeamPort from a connection if it exists. ```APIDOC ## nm_connection_get_setting_team_port ### Description A shortcut to return any NMSettingTeamPort the connection might contain. ### Method GET (conceptual) ### Endpoint N/A (Function call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **NMSettingTeamPort** (object) - The NMSettingTeamPort object if found, otherwise NULL. #### Response Example ```json { "example": "NMSettingTeamPort object or null" } ``` ``` -------------------------------- ### Get NMSettingTeam Source: https://networkmanager.dev/docs/libnm/latest/NMConnection.html Retrieves the NMSettingTeam from a connection if it exists. ```APIDOC ## nm_connection_get_setting_team (Deprecated) ### Description A shortcut to return any NMSettingTeam the connection might contain. ### Method GET (conceptual) ### Endpoint N/A (Function call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **NMSettingTeam** (object) - The NMSettingTeam object if found, otherwise NULL. #### Response Example ```json { "example": "NMSettingTeam object or null" } ``` ``` -------------------------------- ### Create NMSettingIP4Config Object Source: https://networkmanager.dev/docs/libnm/latest/NMSettingIP4Config.html Use this function to create a new NMSettingIP4Config object. It initializes the object with default values. ```c NMSetting * nm_setting_ip4_config_new (_void_); ``` -------------------------------- ### nm_device_get_nm_plugin_missing Source: https://networkmanager.dev/docs/libnm/latest/NMDevice.html Indicates if the NetworkManager plugin for the device is not installed. ```APIDOC ## nm_device_get_nm_plugin_missing ### Description Indicates that the NetworkManager plugin for the device is not installed. ### Method GET (Implied) ### Endpoint N/A (Function call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **nm_plugin_missing** (boolean) - `TRUE` if the device plugin is not installed. #### Response Example ```json { "nm_plugin_missing": true } ``` ```