Main interface functions wrapped with lmi commands are:
- get_device_by_name()
- get_setting_by_caption()
- list_devices()
- list_settings()
- get_mac()
- get_ip_addresses()
- get_default_gateways()
- get_dns_servers()
- get_available_settings()
- get_active_settings()
- get_setting_type()
- get_setting_ip4_method()
- get_setting_ip6_method()
- get_sub_setting()
- get_applicable_devices()
- activate()
- deactivate()
- create_setting()
- delete_setting()
- add_ip_address()
- remove_ip_address()
- replace_ip_address()
All of these accept ns object as the first argument. It is an instance of lmi.shell.LMINamespace.
LMI networking provider client library.
IP configuration obtained from DHCP server
IP configuration obtained from DHCPv6 server
Disabled IP configuration
Stateless IPv6 configuration
Static IP address configuration
Configuration for bond master
Configuration for bond slave
Configuration for bridge master
Configuration for bridge slave
Configuration for ethernet
Unknown type of setting
Activate network setting on given device
Parameters: |
|
---|
Add a dns server to the given setting.
Parameters: |
|
---|
Add an IP address to the given static setting.
Parameters: |
|
---|
Add a static route to the given setting.
Parameters: |
|
---|
Create new network setting.
Parameters: |
|
---|
Deactivate network setting.
Parameters: |
|
---|
Delete existing network setting.
Parameters: | setting (LMI_IPAssignmentSettingData) -- network setting. |
---|
Create slave setting of the master_setting with given device.
Parameters: |
|
---|
Get a list of settings that are currently active on the device
Parameters: | device (LMI_IPNetworkConnection) -- network device |
---|---|
Returns: | Settings that are active on the device |
Return type: | list of LMI_IPAssignmentSettingData |
Get list of network devices that this setting can be applied to.
Parameters: | setting (LMI_IPAssignmentSettingData) -- network setting |
---|---|
Returns: | devices that the setting can be applied to |
Return type: | list of LMI_IPNetworkConnection |
Get a list of settings that can be applied to given device
Parameters: | device (LMI_IPNetworkConnection) -- network device |
---|---|
Returns: | Settings applicable to the device |
Return type: | list of LMI_IPAssignmentSettingData |
Get a list of default gateways assigned to given device
Parameters: | device (LMI_IPNetworkConnection) -- network device |
---|---|
Returns: | Default gateways assigned to the device |
Return type: | list of str |
Get instance of LMI_IPNetworkConnection class by the device name.
Parameters: | device_name (str) -- Name of the device. |
---|---|
Returns: | LMI_IPNetworkConnection representing the device. |
Return type: | LMI_IPNetworkConnection or None if not found |
Get a list of DNS servers assigned to given device
Parameters: | device (LMI_IPNetworkConnection) -- network device |
---|---|
Returns: | DNS servers assigned to the device |
Return type: | list of str |
Get a list of IP addresses assigned to given device
Parameters: | device (LMI_IPNetworkConnection) -- network device |
---|---|
Returns: | IP addresses with subnet masks (IPv4) or prefixes (IPv6) that is assigned to the device. |
Return type: | list of tuple (IPAddress, SubnetMask/Prefix) |
Get a list of IPv4 addresses assigned to given device
Parameters: | device (LMI_IPNetworkConnection) -- network device |
---|---|
Returns: | IPv4 addresses with subnet masks that is assigned to the device. |
Return type: | list of tuple (IPAddress, SubnetMask) |
Get a list of IPv6 addresses assigned to given device
Parameters: | device (LMI_IPNetworkConnection) -- network device |
---|---|
Returns: | IPv6 addresses with prefixes that is assigned to the device. |
Return type: | list of tuple (IPAddress, Prefix) |
Get a MAC address for given device.
Parameters: | device (LMI_IPNetworkConnection) -- network device |
---|---|
Returns: | MAC address of given device or 00:00:00:00:00:00 when no MAC is found. |
Return type: | str |
Get instance of LMI_IPAssignmentSettingData class by the caption.
Parameters: | caption (str) -- Caption of the setting. |
---|---|
Returns: | LMI_IPAssignmentSettingData representing the setting. |
Return type: | LMI_IPAssignmentSettingData or None if not found |
Get method of obtaining IPv4 configuration on given setting
Parameters: | setting (LMI_IPAssignmentSettingData) -- network setting |
---|---|
Returns: | IPv4 method |
Return type: | SETTING_IP_METHOD_* constant |
Get method of obtaining IPv6 configuration on given setting
Parameters: | setting (LMI_IPAssignmentSettingData) -- network setting |
---|---|
Returns: | IPv6 method |
Return type: | SETTING_IP_METHOD_* constant |
Get type of the setting
Parameters: | setting (LMI_IPAssignmentSettingData) -- network setting |
---|---|
Returns: | type of setting |
Return type: | SETTING_TYPE_* constant |
Return list of static routes for given setting
Parameters: | setting (LMI_IPAssignmentSettingData) -- network setting |
---|---|
Returns: | list of static routes |
Return type: | list of LMI_IPRouteSettingData |
Get list of detailed configuration setting for each part of the setting.
Parameters: | setting (LMI_IPAssignmentSettingData) -- network setting |
---|---|
Returns: | detailed setting |
Return type: | list of LMI_IPAssignmentSettingData subclasses |
Return true if the setting is currently active
Parameters: | setting (LMI_IPAssignmentSettingData) -- network setting |
---|---|
Retval True: | setting is currently active |
Retval False: | setting is not currently active |
Return type: | bool |
Get a list of network devices.
Parameters: | device_name (list of str) -- List of device names that will be used as filter for devices. |
---|---|
Returns: | List of instances of LMI_IPNetworkConnection |
Return type: | list of LMI_IPNetworkConnection |
Get a list of network settings.
Parameters: | captions (list of str) -- List of setting captions that will be used as filter for settings. |
---|---|
Returns: | Settings that matches given captions |
Return type: | list of LMI_IPAssignmentSettingData |
Remove dns server from given setting.
Parameters: |
|
---|
Remove the IP address from given static setting.
Parameters: |
|
---|
Remove static route to the given setting.
Parameters: |
|
---|
Remove all dns servers and add given dns server to the given setting.
Parameters: |
|
---|
Remove all IP addresses from given static setting and add new IP address.
Parameters: |
|
---|
Remove all static routes and add given static route to the given setting.
Parameters: |
|
---|