From f2b78953a5285fb6e6f37d21e119fac497c16c60 Mon Sep 17 00:00:00 2001 From: Jeff Kala Date: Tue, 3 Mar 2026 10:56:08 -0700 Subject: [PATCH 1/3] fix docs test failing after new model adds --- .github/workflows/release.yml | 2 +- .gitignore | 1 + docs/dev/code-reference/pyntc/__init__.html | 1255 +++++ .../pyntc/devices/__init__.html | 1001 ++++ .../pyntc/devices/aireos_device.html | 4511 +++++++++++++++++ .../pyntc/devices/asa_device.html | 4142 +++++++++++++++ .../pyntc/devices/base_device.html | 4217 +++++++++++++++ .../pyntc/devices/eos_device.html | 3008 +++++++++++ .../pyntc/devices/f5_device.html | 3055 +++++++++++ .../pyntc/devices/ios_device.html | 4269 ++++++++++++++++ .../pyntc/devices/iosxewlc_device.html | 1315 +++++ .../pyntc/devices/jnpr_device.html | 2821 +++++++++++ .../pyntc/devices/nxos_device.html | 3045 +++++++++++ .../devices/system_features/__init__.html | 1001 ++++ .../devices/system_features/base_feature.html | 1170 +++++ .../system_features/vlans/__init__.html | 1001 ++++ .../system_features/vlans/base_vlans.html | 1220 +++++ .../system_features/vlans/eos_vlans.html | 1229 +++++ .../pyntc/devices/tables/__init__.html | 1001 ++++ .../pyntc/devices/tables/jnpr/__init__.html | 1001 ++++ .../pyntc/devices/tables/jnpr/loopback.html | 1001 ++++ docs/dev/code-reference/pyntc/errors.html | 3561 +++++++++++++ docs/dev/code-reference/pyntc/log.html | 1318 +++++ .../code-reference/pyntc/utils/__init__.html | 1486 ++++++ .../pyntc/utils/converters.html | 1390 +++++ .../code-reference/pyntc/utils/models.html | 1327 +++++ .../pyntc/utils/templates/__init__.html | 1234 +++++ mkdocs.yml | 1 + 28 files changed, 51582 insertions(+), 1 deletion(-) create mode 100644 docs/dev/code-reference/pyntc/__init__.html create mode 100644 docs/dev/code-reference/pyntc/devices/__init__.html create mode 100644 docs/dev/code-reference/pyntc/devices/aireos_device.html create mode 100644 docs/dev/code-reference/pyntc/devices/asa_device.html create mode 100644 docs/dev/code-reference/pyntc/devices/base_device.html create mode 100644 docs/dev/code-reference/pyntc/devices/eos_device.html create mode 100644 docs/dev/code-reference/pyntc/devices/f5_device.html create mode 100644 docs/dev/code-reference/pyntc/devices/ios_device.html create mode 100644 docs/dev/code-reference/pyntc/devices/iosxewlc_device.html create mode 100644 docs/dev/code-reference/pyntc/devices/jnpr_device.html create mode 100644 docs/dev/code-reference/pyntc/devices/nxos_device.html create mode 100644 docs/dev/code-reference/pyntc/devices/system_features/__init__.html create mode 100644 docs/dev/code-reference/pyntc/devices/system_features/base_feature.html create mode 100644 docs/dev/code-reference/pyntc/devices/system_features/vlans/__init__.html create mode 100644 docs/dev/code-reference/pyntc/devices/system_features/vlans/base_vlans.html create mode 100644 docs/dev/code-reference/pyntc/devices/system_features/vlans/eos_vlans.html create mode 100644 docs/dev/code-reference/pyntc/devices/tables/__init__.html create mode 100644 docs/dev/code-reference/pyntc/devices/tables/jnpr/__init__.html create mode 100644 docs/dev/code-reference/pyntc/devices/tables/jnpr/loopback.html create mode 100644 docs/dev/code-reference/pyntc/errors.html create mode 100644 docs/dev/code-reference/pyntc/log.html create mode 100644 docs/dev/code-reference/pyntc/utils/__init__.html create mode 100644 docs/dev/code-reference/pyntc/utils/converters.html create mode 100644 docs/dev/code-reference/pyntc/utils/models.html create mode 100644 docs/dev/code-reference/pyntc/utils/templates/__init__.html diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7dffc187..7f8a7c15 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,6 @@ --- name: "Release" -on: # yamllint disable-line rule:truthy rule:comments +on: # yamllint disable-line rule:truthy rule:comments release: types: ["published"] diff --git a/.gitignore b/.gitignore index fabcfd8d..b770b141 100644 --- a/.gitignore +++ b/.gitignore @@ -308,3 +308,4 @@ docs/CHANGELOG.md public /compose.yaml /dump.sql +/pyntc/static/pyntc/docs diff --git a/docs/dev/code-reference/pyntc/__init__.html b/docs/dev/code-reference/pyntc/__init__.html new file mode 100644 index 00000000..9263f51f --- /dev/null +++ b/docs/dev/code-reference/pyntc/__init__.html @@ -0,0 +1,1255 @@ + + + + + + + + + + + + + + + + + + + + + init - Pyntc Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

+ pyntc + + +

+ +
+ +

Kickoff functions for getting instance of device objects.

+ + + + + + + + +
+ + + + + + + + + +
+ + +

+ pyntc.ntc_device(device_type, *args, **kwargs) + +

+ + +
+ +

Instantiate an instance of a pyntc.devices.BaseDevice by device_type.

+

The *args and **kwargs are passed directly to the device initializer.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ device_type + + str + +
+

A valid device_type +listed in pyntc.devices.supported_devices

+
+
+ required +
+ args + + tuple + +
+

Positional arguments to pass to the device initializer.

+
+
+ () +
+ kwargs + + dict + +
+

Keyword arguments to pass to the device initializer.

+
+
+ {} +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ BaseDevice + +
+

An instance of a subclass of pyntc.devices.BaseDevice.

+
+
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ UnsupportedDeviceError + +
+

if the device_type is unsupported.

+
+
+ +
+ +
+ +
+ + +

+ pyntc.ntc_device_by_name(name, filename=None) + +

+ + +
+ +

Instantiate an instance of a pyntc.devices.BaseDevice from ntc.conf file.

+

If no filename is given the environment variable PYNTC_CONF is checked +for a path, and then ~/.ntc.conf.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ name + + string + +
+

Name of the device as listed in teh NTC configuration file.

+
+
+ required +
+ filename + + string + +
+

(Optional) Path to NTC configuration file that includes +the name argument as section header.

+
+
+ None +
+ + +

Raises:

+ + + + + + + + + + + + + + + + + +
TypeDescription
+ DeviceNameNotFoundError + +
+

If the name is not found in the NTC configuration file.

+
+
+ ConfFileNotFoundError + +
+

If no NTC configuration can be found.

+
+
+ +
+ +
+ + + +
+ +
+ +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/__init__.html b/docs/dev/code-reference/pyntc/devices/__init__.html new file mode 100644 index 00000000..91136491 --- /dev/null +++ b/docs/dev/code-reference/pyntc/devices/__init__.html @@ -0,0 +1,1001 @@ + + + + + + + + + + + + + + + + + + + + + init - Pyntc Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

+ pyntc.devices + + +

+ +
+ +

Device drivers.

+ + + + + + + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/aireos_device.html b/docs/dev/code-reference/pyntc/devices/aireos_device.html new file mode 100644 index 00000000..20559114 --- /dev/null +++ b/docs/dev/code-reference/pyntc/devices/aireos_device.html @@ -0,0 +1,4511 @@ + + + + + + + + + + + + + + + + + + + + + Aireos device - Pyntc Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

+ pyntc.devices.aireos_device + + +

+ +
+ +

Module for using a Cisco WLC/AIREOS device over SSH.

+ + + + + + + + +
+ + + + + + + + +
+ + + +

+ pyntc.devices.aireos_device.AIREOSDevice + + +

+ + +
+

+ Bases: BaseDevice

+ + +

Cisco AIREOS Device Implementation.

+ + + + + + + + + +
+ + + + + + + +
+ + + +

+ ap_boot_options + + + property + + +

+ + +
+ +

Boot Options for all APs associated with the controller.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ dict + +
+

The name of each AP are the keys, and the values are the primary and backup values.

+
+
+ + +
+ Example +
+
+
+

device = AIREOSDevice(**connection_args) +device.ap_boot_options +{ + 'ap1': { + 'backup': '8.8.125.0', + 'primary': '8.9.110.0', + 'status': 'complete' + }, + 'ap2': { + 'backup': '8.8.125.0', + 'primary': '8.9.110.0', + 'status': 'complete' + }, +} +

+
+
+
+
+ +
+ +
+ + + +

+ ap_image_stats + + + property + + +

+ + +
+ +

Stats of downloading the the image to all APs.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ dict + +
+

The AP count, and the downloaded, unsupported, and failed APs.

+
+
+ + +
+ Example +
+
+
+

device = AIREOSDevice(**connection_args) +device.ap_image_stats +{ + 'count': 2, + 'downloaded': 2, + 'unsupported': 0, + 'failed': 0 +} +

+
+
+
+
+ +
+ +
+ + + +

+ boot_options + + + property + + +

+ + +
+ +

Images that are candidates for booting on reload.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ dict + +
+

The boot options on the device. The "sys" key is the expected image on reload.

+
+
+ + +
+ Example +
+
+
+

device = AIREOSDevice(**connection_args) +device.boot_options +{ + 'backup': '8.8.125.0', + 'primary': '8.9.110.0', + 'sys': '8.9.110.0' +} +

+
+
+
+
+ +
+ +
+ + + +

+ connected + + + property + writable + + +

+ + +
+ +

Get connection status of the device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if the device is connected, else False.

+
+
+
+ +
+ +
+ + + +

+ disabled_wlans + + + property + + +

+ + +
+ +

IDs for all disabled WLANs.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list + +
+

Disabled WLAN IDs.

+
+
+ + +
+ Example +
+
+
+

device = AIREOSDevice(**connection_args) +device.wlans +{ + 1: {'profile': 'wlan 1', 'ssid': 'wifi', 'status': 'enabled', 'interface': '1'}, + 2: {'profile': 'wlan 2', 'ssid': 'corp', 'status': 'disabled', 'interface': '1'}, + 3: {'profile': 'wlan 3', 'ssid': 'guest', 'status': 'enabled', 'interface': '1'}, + 4: {'profile': 'wlan 4', 'ssid': 'test', 'status': 'disabled', 'interface': '1'}, + 7: {'profile': 'wlan 7', 'ssid': 'internet', 'status': 'enabled', 'interface': '1'}, + 8: {'profile': 'wlan 8', 'ssid': 'wifi-v', 'status': 'disabled', 'interface': '1'} +} +device.disabled_wlans +[2, 4, 8] +

+
+
+
+
+ +
+ +
+ + + +

+ enabled_wlans + + + property + + +

+ + +
+ +

IDs for all enabled WLANs.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list + +
+

Enabled WLAN IDs.

+
+
+ + +
+ Example +
+
+
+

device = AIREOSDevice(**connection_args) +device.wlans +{ + 1: {'profile': 'wlan 1', 'ssid': 'wifi', 'status': 'enabled', 'interface': '1'}, + 2: {'profile': 'wlan 2', 'ssid': 'corp', 'status': 'disabled', 'interface': '1'}, + 3: {'profile': 'wlan 3', 'ssid': 'guest', 'status': 'enabled', 'interface': '1'}, + 4: {'profile': 'wlan 4', 'ssid': 'test', 'status': 'disabled', 'interface': '1'}, + 7: {'profile': 'wlan 7', 'ssid': 'internet', 'status': 'enabled', 'interface': '1'}, + 8: {'profile': 'wlan 8', 'ssid': 'wifi-v', 'status': 'disabled', 'interface': '1'} +} +device.enabled_wlans +[1, 3, 7] +

+
+
+
+
+ +
+ +
+ + + +

+ hostname + + + property + + +

+ + +
+ +

Retrieve hostname from sysinfo.

+
+ +
+ +
+ + + +

+ peer_redundancy_state + + + property + + +

+ + +
+ +

Determine the redundancy state of the peer processor.

+ + +

Returns:

+ + + + + + + + + + + + + + + + + +
TypeDescription
+ str + +
+

The redundancy state of the peer processor.

+
+
+ None + +
+

When the processor does not support redundancy.

+
+
+ + +
+ Example +
+
+
+

device = AIREOSDevice(**connection_args) +device.peer_redundancy_state +'standby hot' +

+
+
+
+
+ +
+ +
+ + + +

+ redundancy_mode + + + property + + +

+ + +
+ +

Get operating redundancy mode of the controller.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

The redundancy mode the device is operating in.

+
+
+ + +
+ Example +
+
+
+

device = AIREOSDevice(**connection_args) +device.redundancy_mode +'sso enabled' +

+
+
+
+
+ +
+ +
+ + + +

+ redundancy_state + + + property + + +

+ + +
+ +

Determine the redundancy state of the current processor.

+ + +

Returns:

+ + + + + + + + + + + + + + + + + +
TypeDescription
+ str + +
+

The redundancy state of the current processor.

+
+
+ None + +
+

When the processor does not support redundancy.

+
+
+ + +
+ Example +
+
+
+

device = AIREOSDevice(**connection_args) +device.redundancy_state +'active' +

+
+
+
+
+ +
+ +
+ + + +

+ running_config + + + property + + +

+ + +
+ +

Show running config.

+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

Function currently not implemented.

+
+
+
+ +
+ +
+ + + +

+ startup_config + + + property + + +

+ + +
+ +

Get startup config.

+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

Function currently not implemented.

+
+
+
+ +
+ +
+ + + +

+ uptime + + + property + + +

+ + +
+ +

Get uptime of the device in seconds.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ int + +
+

The number of seconds the device has been up.

+
+
+ + +
+ Example +
+
+
+

device = AIREOSDevice(**connection_args) +device.uptime +109303 +

+
+
+
+
+ +
+ +
+ + + +

+ uptime_string + + + property + + +

+ + +
+ +

Get uptime of the device as a string in the format is dd::hh::mm.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

The uptime of the device.

+
+
+ + +
+ Example +
+
+
+

device = AIREOSDevice(**connection_args) +device.uptime_string +22:04:39 +

+
+
+
+
+ +
+ +
+ + + +

+ wlans + + + property + + +

+ + +
+ +

All configured WLANs.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ dict + +
+

WLAN IDs mapped to their operational data.

+
+
+ + +
+ Example +
+
+
+

device = AIREOSDevice(**connection_args) +device.wlans +{ + 1: {'profile': 'wlan 1', 'ssid': 'wifi', 'status': 'enabled', 'interface': '1'}, + 2: {'profile': 'wlan 2', 'ssid': 'corp', 'status': 'disabled', 'interface': '1'}, + 3: {'profile': 'wlan 3', 'ssid': 'guest', 'status': 'enabled', 'interface': '1'}, + 4: {'profile': 'wlan 4', 'ssid': 'test', 'status': 'disabled', 'interface': '1'}, + 7: {'profile': 'wlan 7', 'ssid': 'internet', 'status': 'enabled', 'interface': '1'}, + 8: {'profile': 'wlan 8', 'ssid': 'wifi-v', 'status': 'disabled', 'interface': '1'} +} +

+
+
+
+
+ +
+ + + +
+ + +

+ __init__(host, username, password, secret='', port=None, confirm_active=True, **kwargs) + +

+ + +
+ +

PyNTC Device implementation for Cisco WLC.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ host + + str + +
+

The address of the network device.

+
+
+ required +
+ username + + str + +
+

The username to authenticate with the device.

+
+
+ required +
+ password + + str + +
+

The password to authenticate with the device.

+
+
+ required +
+ secret + + str + +
+

The password to escalate privilege on the device.

+
+
+ '' +
+ port + + int + +
+

The port to use to establish the connection. Defaults to 22.

+
+
+ None +
+ confirm_active + + bool + +
+

Determines if device's high availability state should be validated before leaving connection open.

+
+
+ True +
+ **kwargs + + dict + +
+

Additional keyword arguments for device customization.

+
+
+ {} +
+ +
+ +
+ +
+ + +

+ backup_running_config(filename) + +

+ + +
+ +

Create backup of running config.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ filename + + str + +
+

Name of backup file.

+
+
+ required +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

Function currently not implemented

+
+
+ +
+ +
+ +
+ + +

+ checkpoint(filename) + +

+ + +
+ +

Create a checkpoint file of the current config.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ filename + + str + +
+

Saves a checkpoint file with the name provided to the function.

+
+
+ required +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

Function currently not implemented

+
+
+ +
+ +
+ +
+ + +

+ close() + +

+ + +
+ +

Close the SSH connection to the device.

+ +
+ +
+ +
+ + +

+ config(command, **netmiko_args) + +

+ + +
+ +

Send config commands to device.

+

By default, entering and exiting config mode is handled automatically. +To disable entering and exiting config mode, pass enter_config_mode and exit_config_mode in **netmiko_args. +This supports all arguments supported by Netmiko's send_config_set method using netmiko_args. +This will send each command in command until either an Error is caught or all commands have been sent.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ command + + str | list + +
+

The command or commands to send to the device.

+
+
+ required +
+ **netmiko_args + + dict + +
+

Any argument supported by netmiko.base_connection.BaseConnection.send_config_set.

+
+
+ {} +
+ + +

Returns:

+ + + + + + + + + + + + + + + + + +
TypeDescription
+ str + +
+

When command is a str, the config session input and ouput from sending command.

+
+
+ list + +
+

When command is a list, the config session input and ouput from sending command.

+
+
+ + +

Raises:

+ + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ TypeError + +
+

When sending an argument in **netmiko_args that is not supported.

+
+
+ CommandError + +
+

When command is a str and its results report an error.

+
+
+ CommandListError + +
+

When command is a list and one of the commands reports an error.

+
+
+ + +
+ Example +
+
+
+

device = AIREOSDevice(**connection_args) +device.config("boot primary") +'(host) config>boot primary\n\n(host) config>' +

+
+
+
+
+
+ +
+ +
+ + +

+ confirm_is_active() + +

+ + +
+ +

Confirm that the device is either standalone or the active device in a high availability cluster.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True when the device is considered active.

+
+
+ + +
+ Rasies +

DeviceNotActiveError: When the device is not considered the active device.

+
+ +
+ Example +
+
+
+

device = AIREOSDevice(**connection_args) +device.redundancy_state +'standby hot' +device.confirm_is_active() +raised DeviceNotActiveError: +host1 is not the active device.

+
+
+
+

device state: standby hot +peer state: active

+
+
+
+

device.redundancy_state +'active' +device.confirm_is_active() +True +

+
+
+
+
+
+ +
+ +
+ + +

+ disable_wlans(wlan_ids) + +

+ + +
+ +

Disable all given WLAN IDs.

+

The string all can be passed to disable all WLANs. +Commands are sent to disable WLAN IDs that are not in self.disabled_wlans. +If trying to disable all WLANS, then "all" will be sent, +unless all WLANs in self.wlans are in self.disabled_wlans.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ wlan_ids + + str | list + +
+

List of WLAN IDs or all.

+
+
+ required +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ WLANDisableError + +
+

When wlan_ids are not in self.disabled_wlans after configuration.

+
+
+ + +
+ Example +
+
+
+

device = AIREOSDevice(**connection_args) +device.disabled_wlans +[2, 4, 8] +device.disable_wlans([1]) +device.disabled_wlans +[1, 2, 4, 8] +device.disable_wlans("all") +[1, 2, 3, 4, 7, 8] +

+
+
+
+
+
+ +
+ +
+ + +

+ enable() + +

+ + +
+ +

Ensure device is in enable mode.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ None + +
+

Device prompt is set to enable mode.

+
+
+ +
+ +
+ +
+ + +

+ enable_wlans(wlan_ids) + +

+ + +
+ +

Enable all given WLAN IDs.

+

The string all can be passed to enable all WLANs. +Commands are sent to enable WLAN IDs that are not in self.enabled_wlans. +If trying to enable all WLANS, then "all" will be sent, +unless all WLANs in self.wlans are in self.enabled_wlans.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ wlan_ids + + str | list + +
+

List of WLAN IDs or all.

+
+
+ required +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ WLANEnableError + +
+

When wlan_ids are not in self.enabled_wlans after configuration.

+
+
+ + +
+ Example +
+
+
+

device = AIREOSDevice(**connection_args) +device.enabled_wlans +[1, 3, 7] +device.enable_wlans([2]) +device.enabled_wlans +[1, 2, 3, 7] +device.enable_wlans("all") +dev.enabled_wlans +[1, 2, 3, 4, 7, 8] +

+
+
+
+
+
+ +
+ +
+ + +

+ facts() + +

+ + +
+ +

Get facts from device.

+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

Function currently not implemented.

+
+
+ +
+ +
+ +
+ + +

+ file_copy(username, password, server, filepath, protocol='sftp', filetype='code', read_timeout=1000) + +

+ + +
+ +

Copy a file from server to Controller.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ username + + str + +
+

The username to authenticate with the server.

+
+
+ required +
+ password + + str + +
+

The password to authenticate with the server.

+
+
+ required +
+ server + + str + +
+

The address of the file server.

+
+
+ required +
+ filepath + + str + +
+

The full path to the file on the server.

+
+
+ required +
+ protocol + + str + +
+

The transfer protocol to use to transfer the file. Defaults to "sftp".

+
+
+ 'sftp' +
+ filetype + + str + +
+

The type of file per aireos definitions. Defaults to "code".

+
+
+ 'code' +
+ read_timeout + + int + +
+

The Netmiko read_timeout to wait for device to complete transfer. Defaults to 1000.

+
+
+ 1000 +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True when the file was transferred, False when the file is deemed to already be on the device.

+
+
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ FileTransferError + +
+

When an error is detected in transferring the file.

+
+
+ + +
+ Example +
+
+
+

device = AIREOSDevice(**connection_args) +device.boot_options +{ + 'backup': '8.8.125.0', + 'primary': '8.9.100.0', + 'sys': '8.9.100.0' +} +device.file_copy("user", "password", "10.1.1.1", "/images/aireos/AIR-CT5500-K9-8-10-105-0.aes") +device.boot_options +{ + 'backup': '8.9.100.0', + 'primary': '8.10.105.0', + 'sys': '8.10.105.0' +} +

+
+
+
+
+
+ +
+ +
+ + +

+ file_copy_remote_exists(src, dest=None, **kwargs) + +

+ + +
+ +

Copy 'src' file to remote device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ src + + str + +
+

The path to the file to be copied to the device.

+
+
+ required +
+ dest + + str + +
+

The name to use for storing the file on the device. +Defaults to use the name of the src file.

+
+
+ None +
+ kwargs + + dict + +
+

Any additional arguments supported by Netmiko's file_copy method.

+
+
+ {} +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

Function currently not implemented.

+
+
+ +
+ +
+ +
+ + +

+ install_os(image_name, controller='both', save_config=True, disable_wlans=None, **vendor_specifics) + +

+ + +
+ +

Install an operating system on the controller.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ image_name + + str + +
+

The version to install on the device.

+
+
+ required +
+ controller + + str + +
+

The controller(s) to reboot for install (only applies to HA device).

+
+
+ 'both' +
+ save_config + + bool + +
+

Whether the config should be saved to the device before reboot.

+
+
+ True +
+ disable_wlans + + str | list + +
+

Which WLANs to disable/enable before/after upgrade. Default is None. +To disable all WLANs, pass "all". To disable select WLANs, pass a list of WLAN IDs.

+
+
+ None +
+ vendor_specifics + + dict + +
+

Any vendor specific arguments to pass to the install method.

+
+
+ {} +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True when the install is successful, False when the version is deemed to already be running.

+
+
+ + +

Raises:

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ OSInstallError + +
+

When the device is not booted with the specified image after reload.

+
+
+ RebootTimeoutError + +
+

When the device is unreachable longer than the reboot timeout value.

+
+
+ WLANDisableError + +
+

When WLANs are not disabled properly before the upgrade.

+
+
+ WLANEnableError + +
+

When WLANs are not enabled properly after the upgrade.

+
+
+ + +
+ Example +
+
+
+

device = AIREOSDevice(**connection_args) +device.boot_options +{ + 'backup': '8.8.125.0', + 'primary': '8.9.100.0', + 'sys': '8.9.100.0' +} +device.file_copy("user", "password", "10.1.1.1", "/images/aireos/AIR-CT5500-K9-8-10-105-0.aes") +device.boot_options +{ + 'backup': '8.9.100.0', + 'primary': '8.10.105.0', + 'sys': '8.10.105.0' +} +device.install_os("8.10.105.0") +

+
+
+
+
+
+ +
+ +
+ + +

+ is_active() + +

+ + +
+ +

Determine if the current processor is the active processor.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if the processor is active or does not support HA, else False.

+
+
+ + +
+ Example +
+
+
+

device = AIREOSDevice(**connection_args) +device.is_active() +True +

+
+
+
+
+
+ +
+ +
+ + +

+ open(confirm_active=True) + +

+ + +
+ +

Open a connection to the controller.

+

This method will close the connection if confirm_active is True and the device is not active. +Devices that do not have high availibility are considred active.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ confirm_active + + bool + +
+

Determines if device's high availability state should be validated before leaving connection open.

+
+
+ True +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ DeviceIsNotActiveError + +
+

When confirm_active is True, and the device high availabilit state is not active.

+
+
+ + +
+ Example +
+
+
+

device = AIREOSDevice(**connection_args) +device.open() +raised DeviceNotActiveError: +host1 is not the active device.

+
+
+
+

device state: standby hot +peer state: active

+
+
+
+

device.open(confirm_active=False) +device.connected +True +

+
+
+
+
+
+ +
+ +
+ + +

+ reboot(wait_for_reload=False, controller='self', save_config=True, **kwargs) + +

+ + +
+ +

Reload the controller or controller pair.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ wait_for_reload + + bool + +
+

Whether or not reboot method should also run _wait_for_device_reboot(). Defaults to False.

+
+
+ False +
+ controller + + str + +
+

Which controller(s) to reboot (only applies to HA pairs).

+
+
+ 'self' +
+ save_config + + bool + +
+

Whether the configuration should be saved before reload.

+
+
+ True +
+ kwargs + + dict + +
+

Additional arguments that are not used, but are accepted for backwards compatibility.

+
+
+ {} +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ ReloadTimeoutError + +
+

When the device is still unreachable after the timeout period.

+
+
+ + +
+ Example +
+
+
+

device = AIREOSDevice(**connection_args) +device.reboot() +

+
+
+
+
+
+ +
+ +
+ + +

+ rollback() + +

+ + +
+ +

Rollback to stored file config.

+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

Function currently not implemented.

+
+
+ +
+ +
+ +
+ + +

+ save() + +

+ + +
+ +

Save the configuration on the device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if the save command did not fail.

+
+
+ + +
+ Example +
+
+
+

device = AIREOSDevice(**connection_args) +device.save() +

+
+
+
+
+
+ +
+ +
+ + +

+ set_boot_options(image_name, **vendor_specifics) + +

+ + +
+ +

Set the version to boot on the device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ image_name + + str + +
+

The version to boot into on next reload.

+
+
+ required +
+ **vendor_specifics + + dict + +
+

Additional vendor-specific arguments (unused).

+
+
+ {} +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NTCFileNotFoundError + +
+

When the version is not listed in boot_options.

+
+
+ + +
+ Example +
+
+
+

device = AIREOSDevice(**connection_args) +device.boot_options +{ +'backup': '8.8.125.0', +'primary': '8.9.100.0', +'sys': '8.9.100.0' +} +device.set_boot_options("8.8.125.0") +device.boot_options +{ +'backup': '8.8.125.0', +'primary': '8.9.100.0', +'sys': '8.8.125.0' +}

+
+
+
+
+
+ +
+ +
+ + +

+ show(command, expect_string=None, **netmiko_args) + +

+ + +
+ +

Send an operational command to the device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ command + + str | list + +
+

The commands to send to the device.

+
+
+ required +
+ expect_string + + str + +
+

The expected prompt after running the command.

+
+
+ None +
+ **netmiko_args + + dict + +
+

Any argument supported by netmiko.ConnectHandler.send_command.

+
+
+ {} +
+ + +

Returns:

+ + + + + + + + + + + + + + + + + +
TypeDescription
+ str + +
+

When command is str, the data returned from the device.

+
+
+ list + +
+

When command is list, the data returned from the device for each command.

+
+
+ + +

Raises:

+ + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ TypeError + +
+

When sending an argument in **netmiko_args that is not supported.

+
+
+ CommandError + +
+

When command is str, and the returned data indicates the command failed.

+
+
+ CommandListError + +
+

When command is list, and the return data indicates the command failed.

+
+
+ + +
+ Example +
+
+
+

device = AIREOSDevice(**connection_args) +sysinfo = device._send_command("show sysinfo") +print(sysinfo) +Product Version.....8.2.170.0 +System Up Time......3 days 2 hrs 20 mins 30 sec +... +sysinfo = device._send_command(["show sysinfo"]) +print(sysinfo[0]) +Product Version.....8.2.170.0 +System Up Time......3 days 2 hrs 20 mins 30 sec +... +

+
+
+
+
+
+ +
+ +
+ + +

+ transfer_image_to_ap(image) + +

+ + +
+ +

Transfer image file to all APs connected to the WLC.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ image + + str + +
+

The image that should be sent to the APs.

+
+
+ required +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if AP images are transferred or swapped, False otherwise.

+
+
+ + +
+ Example +
+
+
+

device = AIREOSDevice(**connection_args) +device.ap_boot_options +{ + 'ap1': { + 'backup': '8.8.125.0', + 'primary': '8.9.110.0', + 'status': 'complete' + }, + 'ap2': { + 'backup': '8.8.125.0', + 'primary': '8.9.110.0', + 'status': 'complete' + }, +} +device.transfer_image_to_ap("8.10.1.0") +device.ap_boot_options +{ + 'ap1': { + 'backup': '8.9.110.0', + 'primary': '8.10.1.0', + 'status': 'complete' + }, + 'ap2': { + 'backup': '8.9.110.0', + 'primary': '8.10.1.0', + 'status': 'complete' + }, +} +

+
+
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ pyntc.devices.aireos_device.RebootSignal + + +

+ + +
+

+ Bases: NTCError

+ + +

Handles reboot interrupts.

+ + + + + + + + + +
+ + + + + + + + + + + +
+ +
+ +
+ + +
+ + +

+ pyntc.devices.aireos_device.convert_filename_to_version(filename) + +

+ + +
+ +

Extract the aireos version number from image filename.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ filename + + str + +
+

The name of the file downloaded from Cisco.

+
+
+ required +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

The version number.

+
+
+ + +
+ Example +
+
+
+

version = convert_filename_to_version("AIR-CT5520-K9-8-8-125-0.aes") +print(version) +8.8.125.0 +

+
+
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/asa_device.html b/docs/dev/code-reference/pyntc/devices/asa_device.html new file mode 100644 index 00000000..40af3dd3 --- /dev/null +++ b/docs/dev/code-reference/pyntc/devices/asa_device.html @@ -0,0 +1,4142 @@ + + + + + + + + + + + + + + + + + + + + + Asa device - Pyntc Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

+ pyntc.devices.asa_device + + +

+ +
+ +

Module for using a Cisco ASA device over SSH.

+ + + + + + + + +
+ + + + + + + + +
+ + + +

+ pyntc.devices.asa_device.ASADevice + + +

+ + +
+

+ Bases: BaseDevice

+ + +

Cisco ASA Device Implementation.

+ + + + + + + + + +
+ + + + + + + +
+ + + +

+ boot_options + + + property + + +

+ + +
+ +

Determine boot image.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ dict + +
+

Key: 'sys' Value: Current boot image.

+
+
+
+ +
+ +
+ + + +

+ connected_interface + + + property + + +

+ + +
+ +

Interface that is assigned an IP Address of self.ip_address.

+ + +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
str + str + +
+

The name of the interfaces associated to self.ip_address.

+
+
+ + +
+ Example +
+
+
+

dev = ASADevice("10.1.1.1", **connection_args) +dev.connected_interface +'management' +

+
+
+
+
+ +
+ +
+ + + +

+ facts + + + property + + +

+ + +
+ +

Implement this once facts re-factor is done.

+
+ +
+ +
+ + + +

+ hostname + + + property + + +

+ + +
+ +

Get hostname of device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Hostname of device.

+
+
+
+ +
+ +
+ + + +

+ interfaces + + + property + + +

+ + +
+ +

Get list of interfaces on device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list + +
+

List of interfaces on device.

+
+
+
+ +
+ +
+ + + +

+ ip_address + + + property + + +

+ + +
+ +

IP Address used to establish the connection to the device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ Union[IPv4Address, IPv6Address] + +
+

IPv4Address/IPv6Address: The IP address used by the paramiko connection.

+
+
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ ValueError + +
+

When a valid IP Address is unable to be derived from self.host.

+
+
+ + +
+ Example +
+
+
+

dev = ASADevice("10.1.1.1", connection_args) +dev.ip_address +IPv4Address('10.1.1.1') +dev = ASADevice("asa_host", connection_args) +dev.ip_address +IPv6Address('fe80::2a0:c9ff:fe03:102') +

+
+
+
+
+ +
+ +
+ + + +

+ ip_protocol + + + property + + +

+ + +
+ +

IP Protocol of the IP Addressed used by the underlying paramiko connection.

+ + +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
str + str + +
+

"ipv4" for IPv4 Addresses and "ipv6" for IPv6 Addresses.

+
+
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ ValueError + +
+

When self.ip_address is unable to derive a valid IP Address.

+
+
+ + +
+ Example +
+
+
+

dev = ASADevice("10.1.1.1", connection_args) +dev.ip_protocol +'ipv4' +dev = ASADevice("asa_host", connection_args) +dev.ip_protocol +'ipv6' +

+
+
+
+
+ +
+ +
+ + + +

+ ipv4_addresses + + + property + + +

+ + +
+ +

IPv4 addresses of the device's interfaces.

+ + +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
dict + Dict[str, List[IPv4Address]] + +
+

The ipv4 addresses mapped to their interfaces.

+
+
+ + +
+ Example +
+
+
+

dev = ASADevice(**connection_args) +dev.ipv4_addresses

+
+
+
+
+ +
+ +
+ + + +

+ ipv6_addresses + + + property + + +

+ + +
+ +

IPv6 addresses of the device's interfaces.

+ + +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
dict + Dict[str, List[IPv6Address]] + +
+

The ipv6 addresses mapped to their interfaces.

+
+
+ + +
+ Example +
+
+
+

dev = ASADevice(**connection_args) +dev.ipv6_addresses

+
+
+
+
+ +
+ +
+ + + +

+ model + + + property + + +

+ + +
+ +

Get the device model.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Device model.

+
+
+
+ +
+ +
+ + + +

+ os_version + + + property + + +

+ + +
+ +

Get os version on device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

OS version on device.

+
+
+
+ +
+ +
+ + + +

+ peer_device + + + property + + +

+ + +
+ +

Create instance of ASADevice for peer device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ ASADevice + +
+

class~devices.ASADevice: Cisco ASA device instance.

+
+
+
+ +
+ +
+ + + +

+ peer_ip_address + + + property + + +

+ + +
+ +

IP Address associated with self.ip_address on the peer device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ Union[IPv4Address, IPv6Address] + +
+

IPv4Address/IPv6Address: The IP address used by the paramiko connection.

+
+
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ ValueError + +
+

When a valid IP Address is unable to be derived from self.host.

+
+
+ + +
+ Example +
+
+
+

dev = ASADevice("10.1.1.1", connection_args) +dev.peer_ip_address +IPv4Address('10.1.1.2') +dev = ASADevice("asa_host", connection_args) +dev.peer_ip_address +IPv6Address('fe80::2a0:c9ff:fe03:103') +

+
+
+
+
+ +
+ +
+ + + +

+ peer_ipv4_addresses + + + property + + +

+ + +
+ +

IPv4 addresses of the peer device's interfaces.

+ + +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
dict + Dict[str, List[IPv4Address]] + +
+

The ipv4 addresses mapped to their interfaces.

+
+
+ + +
+ Example +
+
+
+

dev = ASADevice(**connection_args) +dev.peer_ipv4_addresses

+
+
+
+
+ +
+ +
+ + + +

+ peer_ipv6_addresses + + + property + + +

+ + +
+ +

IPv6 addresses of the peer device's interfaces.

+ + +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
dict + Dict[str, List[IPv6Address]] + +
+

The ipv6 addresses mapped to their interfaces.

+
+
+ + +
+ Example +
+
+
+

dev = ASADevice(**connection_args) +dev.peer_ipv6_addresses

+
+
+
+
+ +
+ +
+ + + +

+ peer_redundancy_state + + + property + + +

+ + +
+ +

Determine the current redundancy state of the peer processor.

+

In the case of multi-context configurations, a peer will be considered +active if it is the active device for any context. Otherwise, the most +common state will be returned.

+ + +

Returns:

+ + + + + + + + + + + + + + + + + +
TypeDescription
+ str + +
+

The redundancy state of the peer processor.

+
+
+ None + +
+

When the processor does not support redundancy.

+
+
+ + +
+ Example +
+
+
+

device = ASADevice(**connection_args) +device.peer_redundancy_state +'standby ready' +

+
+
+
+
+ +
+ +
+ + + +

+ redundancy_mode + + + property + + +

+ + +
+ +

Operating redundancy mode of the device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

The redundancy mode the device is operating in. +If the command is not supported, then "n/a" is returned.

+
+
+ + +
+ Example +
+
+
+

device = ASADevice(**connection_args) +device.redundancy_mode +'on' +

+
+
+
+
+ +
+ +
+ + + +

+ redundancy_state + + + property + + +

+ + +
+ +

Determine the current redundancy state of the processor.

+

In the case of multi-context configurations, a device will be considered +active if it is the active device for any context. Otherwise, the most +common state will be returned.

+ + +

Returns:

+ + + + + + + + + + + + + + + + + +
TypeDescription
+ str + +
+

The redundancy state of the processor.

+
+
+ None + +
+

When the processor does not support redundancy.

+
+
+ + +
+ Example +
+
+
+

device = ASADevice(**connection_args) +device.redundancy_state +'active' +

+
+
+
+
+ +
+ +
+ + + +

+ running_config + + + property + + +

+ + +
+ +

Get current running config on device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Running configuration on device.

+
+
+
+ +
+ +
+ + + +

+ serial_number + + + property + + +

+ + +
+ +

Get serial number of device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Serial number of device.

+
+
+
+ +
+ +
+ + + +

+ startup_config + + + property + + +

+ + +
+ +

Show startup config.

+

:return: Output of command 'show startup-config'.

+
+ +
+ +
+ + + +

+ uptime + + + property + + +

+ + +
+ +

Get uptime from device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ int + +
+

Uptime in seconds.

+
+
+
+ +
+ +
+ + + +

+ uptime_string + + + property + + +

+ + +
+ +

Get uptime in format dd:hh:mm.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Uptime of device.

+
+
+
+ +
+ +
+ + + +

+ vlans + + + property + + +

+ + +
+ +

Get vlan ids from device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list + +
+

List of vlans

+
+
+
+ +
+ + + +
+ + +

+ __init__(host, username, password, secret='', port=None, **kwargs) + +

+ + +
+ +

Pyntc Device constructor for Cisco ASA.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ host + + str + +
+

The address of the network device.

+
+
+ required +
+ username + + str + +
+

The username to authenticate to the device.

+
+
+ required +
+ password + + str + +
+

The password to authenticate to the device.

+
+
+ required +
+ secret + + str + +
+

The password to escalate privilege on the device. Defaults to 22.

+
+
+ '' +
+ port + + int + +
+

Port used to establish connection. Defaults to 22.

+
+
+ None +
+ kwargs + + dict + +
+

Additional keyword arguments to pass to the Netmiko connection handler.

+
+
+ {} +
+ +
+ +
+ +
+ + +

+ backup_running_config(filename) + +

+ + +
+ +

Backups running config.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ filename + + str + +
+

Name of backup file.

+
+
+ required +
+ +
+ +
+ +
+ + +

+ checkpoint(checkpoint_file) + +

+ + +
+ +

Create a checkpoint file of the current config.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ checkpoint_file + + str + +
+

Saves a checkpoint file with the name provided to the function.

+
+
+ required +
+ +
+ +
+ +
+ + +

+ close() + +

+ + +
+ +

Disconnect from device.

+ +
+ +
+ +
+ + +

+ config(command) + +

+ + +
+ +

Send configuration commands to a device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ command + + (str, list) + +
+

String with single command, or list with multiple commands.

+
+
+ required +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ CommandListError + +
+

Message stating which command failed and the response from the device.

+
+
+ +
+ +
+ +
+ + +

+ enable() + +

+ + +
+ +

Ensure device is in enable mode.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ None + +
+

Device prompt is set to enable mode.

+
+
+ +
+ +
+ +
+ + +

+ enable_scp() + +

+ + +
+ +

Enable SCP on device by configuring "ssh scopy enable".

+

The command is ran on the active device; if the device is +currently standby, then a new connection is created to the +active device. The configuration is saved after to sync to peer.

+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ FileTransferError + +
+

When unable to configure scopy on the active device.

+
+
+ + +
+ Example +
+
+
+

device = ASADevice(**connection_args) +device.show("show run ssh | i scopy") +'' +device.enable_scp() +device.show("show run ssh | i scopy") +'ssh scopy enable' +

+
+
+
+
+
+ +
+ +
+ + +

+ file_copy(src, dest=None, file_system=None, peer=False) + +

+ + +
+ +

Copy src file to device.

+

The src file can be copied to both the device and its peer by +setting peer to True. If transferring to the peer device, the +transfer will use the address associated with the peer_interface +from "show failover" output.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ src + + str + +
+

The path to the file to be copied to the device.

+
+
+ required +
+ dest + + str + +
+

The name to use for storing the file on the device. +Default is to use the name of the src file.

+
+
+ None +
+ file_system + + str + +
+

The directory to store the file on the device. +Default will use _get_file_system() to determine the default file_system.

+
+
+ None +
+ peer + + bool + +
+

Whether to transfer the src file to the peer device.

+
+
+ False +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ FileTransferError + +
+

When the src file is unable to transfer the file to any device.

+
+
+ + +
+ Example +
+
+
+

dev = ASADevice(**connection_args) +dev.file_copy("path/to/asa-image.bin", peer=True)

+
+
+
+
+
+ +
+ +
+ + +

+ file_copy_remote_exists(src, dest=None, file_system=None) + +

+ + +
+ +

Copy src file to device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ src + + str + +
+

The path to the file to be copied to the device.

+
+
+ required +
+ dest + + str + +
+

The name to use for storing the file on the device. +Defaults to use the name of the src file..

+
+
+ None +
+ file_system + + str + +
+

The directory name to store files on the device. +Defaults to discover the default directory of the device.

+
+
+ None +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if the file exists on the device and the md5 hashes match. Otherwise, false.

+
+
+

Example:

+
+
+
+

status = file_copy_remote_exists("path/to/asa-image.bin") +print(status) +True +

+
+
+
+ +
+ +
+ +
+ + +

+ install_os(image_name, **vendor_specifics) + +

+ + +
+ +

Install OS on device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ image_name + + str + +
+

Name of the image to be installed.

+
+
+ required +
+ vendor_specifics + + dict + +
+

Vendor specific arguments to pass to the install process.

+
+
+ {} +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ OSInstallError + +
+

Message stating the end device could not boot into the new image.

+
+
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if new image is installed correctly. False if device is already running image_name.

+
+
+ +
+ +
+ +
+ + +

+ is_active() + +

+ + +
+ +

Determine if the current processor is the active processor.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if the processor is active or does not support HA, else False.

+
+
+ + +
+ Example +
+
+
+

device = ASADevice(**connection_args) +device.is_active() +True +

+
+
+
+
+
+ +
+ +
+ + +

+ open() + +

+ + +
+ +

Attempt to find device prompt. If not found, create Connecthandler object to device.

+ +
+ +
+ +
+ + +

+ reboot(wait_for_reload=False, **kwargs) + +

+ + +
+ +

Reload the controller or controller pair.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ wait_for_reload + + bool + +
+

Whether or not reboot method should also run _wait_for_device_reboot(). Defaults to False.

+
+
+ False +
+ kwargs + + dict + +
+

Additional arguments to pass to the reboot method.

+
+
+ {} +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ RebootTimeoutError + +
+

When the device is still unreachable after the timeout period.

+
+
+ + +
+ Example +
+
+
+

device = ASADevice(**connection_args) +device.reboot() +

+
+
+
+
+
+ +
+ +
+ + +

+ reboot_standby(acceptable_states=None, timeout=None) + +

+ + +
+ +

Reload the standby device from the active device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ acceptable_states + + iter + +
+

List of acceptable redundancy states for the peer device after reboot. +Default will use the current value of peer_redundancy_state.

+
+
+ None +
+ timeout + + int + +
+

The maximum time to wait for the device to boot back into an acceptable_state.

+
+
+ None +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ RebootTimeoutError + +
+

When timeout is reached before the peer reaches a state in acceptable_states.

+
+
+ + +
+ Example +
+
+
+

dev = ASADevice(**connection_args) +dev.peer_redundancy_state +'standby ready' +dev.reboot_standby() +RebootTimeoutError... +dev.peer_redundancy_state +'cold standby' +dev.reboot_standby(acceptbale_states=["standby ready", "cold standby"]) +dev.peer_redundancy_state +'cold standby' +

+
+
+
+
+
+ +
+ +
+ + +

+ rollback(rollback_to) + +

+ + +
+ +

Rollback the device configuration.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ rollback_to + + str + +
+

Name of checkpoint file to rollback to

+
+
+ required +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

Function not implemented yet.

+
+
+ +
+ +
+ +
+ + +

+ save(filename='startup-config') + +

+ + +
+ +

Save changes to startup config.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ filename + + str + +
+

Name of startup configuration file. Defaults to "startup-config".

+
+
+ 'startup-config' +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if configuration saved succesfully.

+
+
+ +
+ +
+ +
+ + +

+ set_boot_options(image_name, **vendor_specifics) + +

+ + +
+ +

Set new image as boot option on device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ image_name + + str + +
+

AName of image.

+
+
+ required +
+ vendor_specifics + + dict + +
+

Vendor specific arguments to pass to the set_boot_options process.

+
+
+ {} +
+ + +

Raises:

+ + + + + + + + + + + + + + + + + +
TypeDescription
+ NTCFileNotFoundError + +
+

File not found on device.

+
+
+ CommandError + +
+

Unable to issue command on device.

+
+
+ +
+ +
+ +
+ + +

+ show(command, expect_string=None) + +

+ + +
+ +

Send command to device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ command + + str + +
+

Command to be ran on device.

+
+
+ required +
+ expect_string + + str + +
+

Expected response from running command on device. Defaults to None.

+
+
+ None +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Output from running command on device.

+
+
+ +
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ pyntc.devices.asa_device.RebootSignal + + +

+ + +
+

+ Bases: NTCError

+ + +

Not implemented.

+ + + + + + + + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/base_device.html b/docs/dev/code-reference/pyntc/devices/base_device.html new file mode 100644 index 00000000..176e8612 --- /dev/null +++ b/docs/dev/code-reference/pyntc/devices/base_device.html @@ -0,0 +1,4217 @@ + + + + + + + + + + + + + + + + + + + + + Base device - Pyntc Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

+ pyntc.devices.base_device + + +

+ +
+ +

The module contains the base class that all device classes must inherit from.

+ + + + + + + + +
+ + + + + + + + +
+ + + +

+ pyntc.devices.base_device.BaseDevice + + +

+ + +
+ + +

Base Device ABC.

+ + + + + + + + + +
+ + + + + + + +
+ + + +

+ boot_options + + + property + + +

+ + +
+ +

Get current boot variables.

+

like system image and kickstart image.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ dict + +
+

A dictionary, e.g. {'kick': router_kick.img, 'sys': 'router_sys.img'}

+
+
+
+ +
+ +
+ + + +

+ fqdn + + + property + + +

+ + +
+ +

Get FQDN of the device.

+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

returns not implemented if not included in facts.

+
+
+
+ +
+ +
+ + + +

+ hostname + + + property + + +

+ + +
+ +

Host name string property, part of device facts.

+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

returns not implemented if not included in facts.

+
+
+
+ +
+ +
+ + + +

+ interfaces + + + property + + +

+ + +
+ +

Interfaces list of strings property, part of device facts.

+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

returns not implemented if not included in facts.

+
+
+
+ +
+ +
+ + + +

+ model + + + property + + +

+ + +
+ +

Model string property, part of device facts.

+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

returns not implemented if not included in facts.

+
+
+
+ +
+ +
+ + + +

+ os_version + + + property + + +

+ + +
+ +

Operating System string property, part of device facts.

+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

returns not implemented if not included in facts.

+
+
+
+ +
+ +
+ + + +

+ running_config + + + property + + +

+ + +
+ +

Return the running configuration of the device.

+
+ +
+ +
+ + + +

+ serial_number + + + property + + +

+ + +
+ +

Get serial number of the device.

+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

returns not implemented if not included in facts.

+
+
+
+ +
+ +
+ + + +

+ startup_config + + + property + + +

+ + +
+ +

Return the startup configuration of the device.

+
+ +
+ +
+ + + +

+ uptime + + + property + + +

+ + +
+ +

Uptime integer property, part of device facts.

+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

returns not implemented if not included in facts.

+
+
+
+ +
+ +
+ + + +

+ uptime_string + + + property + + +

+ + +
+ +

Uptime string string property, part of device facts.

+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

returns not implemented if not included in facts.

+
+
+
+ +
+ +
+ + + +

+ vlans + + + property + + +

+ + +
+ +

Vlans lost of strings property, part of device facts.

+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

returns not implemented if not included in facts.

+
+
+
+ +
+ + + +
+ + +

+ __init__(host, username, password, device_type=None, **kwargs) + +

+ + +
+ +

PyNTC base device implementation.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ host + + str + +
+

The address of the network device.

+
+
+ required +
+ username + + str + +
+

The username to authenticate with the device.

+
+
+ required +
+ password + + str + +
+

The password to authenticate with the device.

+
+
+ required +
+ device_type + + str + +
+

Denotes which device type. Defaults to None.

+
+
+ None +
+ kwargs + + dict + +
+

Additional keyword arguments that may be used by subclasses.

+
+
+ {} +
+ +
+ +
+ +
+ + +

+ backup_running_config(filename) + +

+ + +
+ +

Save a local copy of the running config.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ filename + + str + +
+

The local file path on which to save the running config.

+
+
+ required +
+ +
+ +
+ +
+ + +

+ check_file_exists(filename, **kwargs) + +

+ + +
+ +

Check if a remote file exists by filename.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ filename + + str + +
+

The name of the file to check for on the remote device.

+
+
+ required +
+ kwargs + + dict + +
+

Additional keyword arguments that may be used by subclasses.

+
+
+ {} +
+ + +

Other Parameters:

+ + + + + + + + + + + + + + + +
NameTypeDescription
file_system + str + +
+

Supported only for IOS and NXOS. The file system for the +remote file. If no file_system is provided, then the get_file_system +method is used to determine the correct file system to use.

+
+
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if the remote file exists, False if it doesn't.

+
+
+ +
+ +
+ +
+ + +

+ checkpoint(filename) + +

+ + +
+ +

Save a checkpoint of the running configuration to the device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ filename + + str + +
+

The filename to save the checkpoint as on the remote device.

+
+
+ required +
+ +
+ +
+ +
+ + +

+ close() + +

+ + +
+ +

Close the connection to the device.

+ +
+ +
+ +
+ + +

+ compare_file_checksum(checksum, filename, hashing_algorithm='md5', **kwargs) + +

+ + +
+ +

Compare the checksum of a local file with a remote file.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ checksum + + str + +
+

The checksum of the file.

+
+
+ required +
+ filename + + str + +
+

The name of the file to check for on the remote device.

+
+
+ required +
+ hashing_algorithm + + str + +
+

The hashing algorithm to use (default: "md5").

+
+
+ 'md5' +
+ kwargs + + dict + +
+

Additional keyword arguments that may be used by subclasses.

+
+
+ {} +
+ + +

Other Parameters:

+ + + + + + + + + + + + + + + +
NameTypeDescription
file_system + str + +
+

Supported only for IOS and NXOS. The file system for the +remote file. If no file_system is provided, then the get_file_system +method is used to determine the correct file system to use.

+
+
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if the checksums match, False otherwise.

+
+
+ +
+ +
+ +
+ + +

+ config(command) + +

+ + +
+ +

Send a configuration command.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ command + + str + +
+

The command to send to the device.

+
+
+ required +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ CommandError + +
+

If there is a problem with the supplied command.

+
+
+ +
+ +
+ +
+ + +

+ facts() + +

+ + +
+ +

DEPRECATED - Use individual properties to get facts.

+ +
+ +
+ +
+ + +

+ feature(feature_name) + +

+ + +
+ +

Return a feature class based on the feature_name for the appropriate subclassed device type.

+ +
+ +
+ +
+ + +

+ file_copy(src, dest=None, **kwargs) + +

+ + +
+ +

Send a local file to the device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ src + + str + +
+

Path to the local file to send.

+
+
+ required +
+ dest + + str + +
+

The destination file path to be saved on remote flash. +If none is supplied, the implementing class should use the basename +of the source path.

+
+
+ None +
+ kwargs + + dict + +
+

Additional keyword arguments that may be used by subclasses.

+
+
+ {} +
+ + +

Other Parameters:

+ + + + + + + + + + + + + + + +
NameTypeDescription
file_system + str + +
+

Supported only for IOS and NXOS. The file system for the +remote file. If no file_system is provided, then the get_file_system +method is used to determine the correct file system to use.

+
+
+ +
+ +
+ +
+ + +

+ file_copy_remote_exists(src, dest=None, **kwargs) + +

+ + +
+ +

Check if a remote file exists.

+

A remote file exists if it has the same name as supplied dest, +and the same md5 hash as the source.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ src + + str + +
+

Path to local file to check.

+
+
+ required +
+ dest + + str + +
+

The destination file path to be saved on remote the remote device. +If none is supplied, the implementing class should use the basename +of the source path.

+
+
+ None +
+ kwargs + + dict + +
+

Additional keyword arguments that may be used by subclasses.

+
+
+ {} +
+ + +

Other Parameters:

+ + + + + + + + + + + + + + + +
NameTypeDescription
file_system + str + +
+

Supported only for IOS and NXOS. The file system for the +remote file. If no file_system is provided, then the get_file_system +method is used to determine the correct file system to use.

+
+
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if the remote file exists, False if it doesn't.

+
+
+ +
+ +
+ +
+ + +

+ get_boot_options() + +

+ + +
+ +

Get current boot variables like system image and kickstart image.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ dict + +
+

A dictionary, e.g. {'kick': router_kick.img, 'sys': 'router_sys.img'}

+
+
+ +
+ +
+ +
+ + +

+ get_local_checksum(filepath, hashing_algorithm='md5', add_newline=False) + + + staticmethod + + +

+ + +
+ +

Get the checksum of a local file using a specified algorithm.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ filepath + + str + +
+

The path to the local file.

+
+
+ required +
+ hashing_algorithm + + str + +
+

The hashing algorithm to use (e.g., "md5", "sha256").

+
+
+ 'md5' +
+ add_newline + + bool + +
+

Whether to append a newline before final hashing (Some devices may require this).

+
+
+ False +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

The hex digest of the file.

+
+
+ +
+ +
+ +
+ + +

+ get_remote_checksum(filename, hashing_algorithm='md5', **kwargs) + +

+ + +
+ +

Get the checksum of a remote file.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ filename + + str + +
+

The name of the file to check for on the remote device.

+
+
+ required +
+ hashing_algorithm + + str + +
+

The hashing algorithm to use (default: "md5").

+
+
+ 'md5' +
+ kwargs + + dict + +
+

Additional keyword arguments that may be used by subclasses.

+
+
+ {} +
+ + +

Other Parameters:

+ + + + + + + + + + + + + + + +
NameTypeDescription
file_system + str + +
+

Supported only for IOS and NXOS. The file system for the +remote file. If no file_system is provided, then the get_file_system +method is used to determine the correct file system to use.

+
+
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

The checksum of the remote file.

+
+
+ +
+ +
+ +
+ + +

+ install_os(image_name, **vendor_specifics) + +

+ + +
+ +

Install the OS from specified image_name.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ image_name + + str + +
+

The name of the image on the device to install.

+
+
+ required +
+ + +

Other Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
kickstart + str + +
+

Option for NXOSDevice for devices that require a kickstart image.

+
+
volume + str + +
+

Option for F5Device to set the target boot volume.

+
+
file_system + str + +
+

Option for ASADevice, EOSDevice, IOSDevice, and +NXOSDevice to set where the OS files are stored. The default will use +the _get_file_system method.

+
+
timeout + int + +
+

Option for IOSDevice and NXOSDevice to set the wait time for +device installation to complete.

+
+
vendor_specifics + kwargs + +
+

Additional keyword arguments that may be used by subclasses.

+
+
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if system has been installed during function's call, False if OS has not been installed

+
+
+ + +

Raises:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ OSInstallError + +
+

When device finishes installation process, but the running image +does not match image_name.

+
+
+ CommandError + +
+

When sending a command to the device fails, or when the config status +after sending a command does not yield expected results.

+
+
+ CommandListError + +
+

When sending commands to the device fails.

+
+
+ NotEnoughFreeSpaceError + +
+

When the device does not have enough free space for install.

+
+
+ NTCFileNotFoundError + +
+

When the image_name is not found in the devices file_system.

+
+
+ FileSystemNotFoundError + +
+

When the file_system is left to default, +and the file_system cannot be identified.

+
+
+ RebootTimeoutError + +
+

When device is rebooted and is unreachable longer than timeout period.

+
+
+ +
+ +
+ +
+ + +

+ open() + +

+ + +
+ +

Open a connection to the device.

+ +
+ +
+ +
+ + +

+ reboot(wait_for_reload=False) + +

+ + +
+ +

Reload a device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ wait_for_reload + + bool + +
+

Whether or not reboot method should also run _wait_for_device_reboot(). Defaults to False.

+
+
+ False +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ RebootTimeoutError + +
+

When the device is still unreachable after the timeout period.

+
+
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

description

+
+
+ +
+ +
+ +
+ + +

+ refresh() + +

+ + +
+ +

Refresh caches on device instance.

+ +
+ +
+ +
+ + +

+ refresh_facts() + +

+ + +
+ +

Refresh cached facts.

+ +
+ +
+ +
+ + +

+ remote_file_copy(src=None, dest=None, **kwargs) + +

+ + +
+ +

Copy a file to a remote device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ src + + FileCopyModel + +
+

The source file model.

+
+
+ None +
+ dest + + str + +
+

The destination file path on the remote device.

+
+
+ None +
+ kwargs + + dict + +
+

Additional keyword arguments that may be used by subclasses.

+
+
+ {} +
+ + +

Other Parameters:

+ + + + + + + + + + + + + + + +
NameTypeDescription
file_system + str + +
+

Supported only for IOS and NXOS. The file system for the +remote file. If no file_system is provided, then the get_file_system +method is used to determine the correct file system to use.

+
+
+ +
+ +
+ +
+ + +

+ rollback(checkpoint_file) + +

+ + +
+ +

Rollback to a checkpoint file.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ checkpoint_file + + str + +
+

The filename of the checkpoint file to load into the running configuration.

+
+
+ required +
+ +
+ +
+ +
+ + +

+ save(filename=None) + +

+ + +
+ +

Save a device's running configuration.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ filename + + str + +
+

The filename on the remote device. +If none is supplied, the implementing class should +save to the "startup configuration".

+
+
+ None +
+ +
+ +
+ +
+ + +

+ set_boot_options(image_name, **vendor_specifics) + +

+ + +
+ +

Set boot variables like system image and kickstart image.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ image_name + + str + +
+

The main system image file name.

+
+
+ required +
+ + +

Other Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
kickstart + str + +
+

Option for NXOSDevice for devices that require a kickstart image.

+
+
volume + str + +
+

Option for F5Device to set which volume should have image installed.

+
+
file_system + str + +
+

Option for ASADevice and IOSDevice to set which directory +to use when setting the boot path. The default will use the directory returned +by the _get_file_system() method.

+
+
vendor_specifics + kwargs + +
+

Additional keyword arguments that may be used by subclasses.

+
+
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ ValueError + +
+

When the boot options returned by the boot_options +method does not match the image_name after the config command(s) +have been sent to the device.

+
+
+ +
+ +
+ +
+ + +

+ show(command, raw_text=False) + +

+ + +
+ +

Send a non-configuration command.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ command + + str + +
+

The command to send to the device.

+
+
+ required +
+ + +

Other Parameters:

+ + + + + + + + + + + + + + + +
NameTypeDescription
raw_text + bool + +
+

Whether to return raw text or structured data.

+
+
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

The output of the show command, which could be raw text or structured data.

+
+
+ +
+ +
+ +
+ + +

+ verify_file(checksum, filename, hashing_algorithm='md5', **kwargs) + +

+ + +
+ +

Verify a file on the remote device by confirming the file exists and validate the checksum.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ checksum + + str + +
+

The checksum of the file.

+
+
+ required +
+ filename + + str + +
+

The name of the file to check for on the remote device.

+
+
+ required +
+ hashing_algorithm + + str + +
+

The hashing algorithm to use (default: "md5").

+
+
+ 'md5' +
+ kwargs + + dict + +
+

Additional keyword arguments that may be used by subclasses.

+
+
+ {} +
+ + +

Other Parameters:

+ + + + + + + + + + + + + + + +
NameTypeDescription
file_system + str + +
+

Supported only for IOS and NXOS. The file system for the +remote file. If no file_system is provided, then the get_file_system +method is used to determine the correct file system to use.

+
+
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if the file is verified successfully, False otherwise.

+
+
+ +
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ pyntc.devices.base_device.RebootTimerError + + +

+ + +
+

+ Bases: NTCError

+ + +

Reboot timer error class to notify user reboot timer is not supported.

+ + + + + + + + + +
+ + + + + + + + + +
+ + +

+ __init__(device_type) + +

+ + +
+ +

Error to notify user reboot timer is not supported.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ device_type + + str + +
+

Ex: cisco_nxos_nxapi, cisco_ios_ssh

+
+
+ required +
+ +
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ pyntc.devices.base_device.RollbackError + + +

+ + +
+

+ Bases: NTCError

+ + +

Rollback error.

+ + + + + + + + + +
+ + + + + + + + + + + +
+ +
+ +
+ +
+ + + +

+ pyntc.devices.base_device.SetBootImageError + + +

+ + +
+

+ Bases: NTCError

+ + +

Set boot image error.

+ + + + + + + + + +
+ + + + + + + + + + + +
+ +
+ +
+ + +
+ + +

+ pyntc.devices.base_device.fix_docs(cls) + +

+ + +
+ +

Create docstring at runtime.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ class + +
+

Returns the class passed in.

+
+
+ +
+ +
+ + + +
+ +
+ +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/eos_device.html b/docs/dev/code-reference/pyntc/devices/eos_device.html new file mode 100644 index 00000000..c3840b52 --- /dev/null +++ b/docs/dev/code-reference/pyntc/devices/eos_device.html @@ -0,0 +1,3008 @@ + + + + + + + + + + + + + + + + + + + + + Eos device - Pyntc Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

+ pyntc.devices.eos_device + + +

+ +
+ +

Module for using an Arista EOS device over the eAPI.

+ + + + + + + + +
+ + + + + + + + +
+ + + +

+ pyntc.devices.eos_device.EOSDevice + + +

+ + +
+

+ Bases: BaseDevice

+ + +

Arista EOS Device Implementation.

+ + + + + + + + + +
+ + + + + + + +
+ + + +

+ boot_options + + + property + + +

+ + +
+ +

Get current running software.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ dict + +
+

Key is sys with value being the image on the device.

+
+
+
+ +
+ +
+ + + +

+ fqdn + + + property + + +

+ + +
+ +

Get fully-qualified domain name of device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Fully-qualified domain name of device.

+
+
+
+ +
+ +
+ + + +

+ hostname + + + property + + +

+ + +
+ +

Get hostname from device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Hostname of the device.

+
+
+
+ +
+ +
+ + + +

+ interfaces + + + property + + +

+ + +
+ +

Get list of interfaces on device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list + +
+

List of interfaces

+
+
+
+ +
+ +
+ + + +

+ model + + + property + + +

+ + +
+ +

Get model of device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Model of device.

+
+
+
+ +
+ +
+ + + +

+ os_version + + + property + + +

+ + +
+ +

Get OS version on device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

OS version of device.

+
+
+
+ +
+ +
+ + + +

+ running_config + + + property + + +

+ + +
+ +

Return running config.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Running configuration.

+
+
+
+ +
+ +
+ + + +

+ serial_number + + + property + + +

+ + +
+ +

Get serial number of device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Serial number of device.

+
+
+
+ +
+ +
+ + + +

+ startup_config + + + property + + +

+ + +
+ +

Get startup configuration.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Startup configuration.

+
+
+
+ +
+ +
+ + + +

+ uptime + + + property + + +

+ + +
+ +

Get uptime of the device in seconds.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ int + +
+

Uptime of the device.

+
+
+
+ +
+ +
+ + + +

+ uptime_string + + + property + + +

+ + +
+ +

Get uptime of the device in the format of dd::hh::mm.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Uptime in string format.

+
+
+
+ +
+ +
+ + + +

+ vlans + + + property + + +

+ + +
+ +

Get list of VLANS on device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list + +
+

List of VLANS on device.

+
+
+
+ +
+ + + +
+ + +

+ __init__(host, username, password, transport='http', port=None, timeout=None, **kwargs) + +

+ + +
+ +

PyNTC Device implementation for Arista EOS.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ host + + str + +
+

The address of the network device.

+
+
+ required +
+ username + + str + +
+

The username to authenticate with the device.

+
+
+ required +
+ password + + str + +
+

The password to authenticate with the device.

+
+
+ required +
+ transport + + str + +
+

The protocol to communicate with the device. Defaults to http.

+
+
+ 'http' +
+ port + + int + +
+

The port to use to establish the connection. Defaults to None.

+
+
+ None +
+ timeout + + int + +
+

Timeout value used for connection with the device. Defaults to None.

+
+
+ None +
+ kwargs + + dict + +
+

Additional keyword arguments.

+
+
+ {} +
+ +
+ +
+ +
+ + +

+ backup_running_config(filename) + +

+ + +
+ +

Create backup file of running configuration.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ filename + + str + +
+

The name of the file that will be saved.

+
+
+ required +
+ +
+ +
+ +
+ + +

+ checkpoint(checkpoint_file) + +

+ + +
+ +

Copy running config checkpoint.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ checkpoint_file + + str + +
+

Checkpoint file name.

+
+
+ required +
+ +
+ +
+ +
+ + +

+ close() + +

+ + +
+ +

Not implemented. Just passes.

+ +
+ +
+ +
+ + +

+ config(commands) + +

+ + +
+ +

Send configuration commands to a device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ commands + + (str, list) + +
+

String with single command, or list with multiple commands.

+
+
+ required +
+ + +

Raises:

+ + + + + + + + + + + + + + + + + +
TypeDescription
+ CommandError + +
+

Issue with the command provided.

+
+
+ CommandListError + +
+

Issue with a command in the list provided.

+
+
+ +
+ +
+ +
+ + +

+ enable() + +

+ + +
+ +

Ensure device is in enable mode.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ None + +
+

Device prompt is set to enable mode.

+
+
+ +
+ +
+ +
+ + +

+ file_copy(src, dest=None, file_system=None) + +

+ + +
+ +

Copy file to device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ src + + string + +
+

source file

+
+
+ required +
+ dest + + string + +
+

Destintion file. Defaults to None.

+
+
+ None +
+ file_system + + string + +
+

Describes device file system. Defaults to None.

+
+
+ None +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ FileTransferError + +
+

raise exception if there is an error

+
+
+ +
+ +
+ +
+ + +

+ file_copy_remote_exists(src, dest=None, file_system=None) + +

+ + +
+ +

Copy file to remote device if it exists.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ src + + str + +
+

source file

+
+
+ required +
+ dest + + str + +
+

Destintion file. Defaults to None.

+
+
+ None +
+ file_system + + str + +
+

Describes device file system. Defaults to None.

+
+
+ None +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if remote file exists.

+
+
+ +
+ +
+ +
+ + +

+ install_os(image_name, **vendor_specifics) + +

+ + +
+ +

Install new OS on device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ image_name + + str + +
+

Name of the image name to be installed.

+
+
+ required +
+ vendor_specifics + + dict + +
+

Vendor specific options for installing OS, such as timeout.

+
+
+ {} +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ OSInstallError + +
+

Error in installing new OS.

+
+
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if device OS is succesfully installed.

+
+
+ +
+ +
+ +
+ + +

+ open() + +

+ + +
+ +

Open ssh connection with Netmiko ConnectHandler to be used with FileTransfer.

+ +
+ +
+ +
+ + +

+ reboot(wait_for_reload=False, **kwargs) + +

+ + +
+ +

Reload the controller or controller pair.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ wait_for_reload + + bool + +
+

Whether or not reboot method should also run _wait_for_device_reboot(). Defaults to False.

+
+
+ False +
+ kwargs + + dict + +
+

Additional keyword arguments, such as confirm.

+
+
+ {} +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ RebootTimeoutError + +
+

When the device is still unreachable after the timeout period.

+
+
+ + +
+ Example +
+
+
+

device = EOSDevice(**connection_args) +device.reboot() +

+
+
+
+
+
+ +
+ +
+ + +

+ rollback(rollback_to) + +

+ + +
+ +

Rollback device configuration.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ rollback_to + + str + +
+

Name of file to revert configuration to.

+
+
+ required +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ RollbackError + +
+

When rollback is unsuccessful.

+
+
+ +
+ +
+ +
+ + +

+ save(filename='startup-config') + +

+ + +
+ +

Show running configuration.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Running configuration.

+
+
+ +
+ +
+ +
+ + +

+ set_boot_options(image_name, **vendor_specifics) + +

+ + +
+ +

Set boot option to specified image.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ image_name + + str + +
+

Name of the image file.

+
+
+ required +
+ vendor_specifics + + dict + +
+

Vendor specific options, such as file_system.

+
+
+ {} +
+ + +

Raises:

+ + + + + + + + + + + + + + + + + +
TypeDescription
+ NTCFileNotFoundError + +
+

File not found on device.

+
+
+ CommandError + +
+

Error in trying to set image as boot option.

+
+
+ +
+ +
+ +
+ + +

+ show(commands, raw_text=False) + +

+ + +
+ +

Send configuration commands to a device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ commands + + (str, list) + +
+

String with single command, or list with multiple commands.

+
+
+ required +
+ raw_text + + bool + +
+

False if encode should be json, True if encoding is text. Defaults to False.

+
+
+ False +
+ + +

Raises:

+ + + + + + + + + + + + + + + + + +
TypeDescription
+ CommandError + +
+

Issue with the command provided.

+
+
+ CommandListError + +
+

Issue with a command in the list provided.

+
+
+ +
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ pyntc.devices.eos_device.RebootSignal + + +

+ + +
+

+ Bases: NTCError

+ + +

Error for sending reboot signal.

+ + + + + + + + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/f5_device.html b/docs/dev/code-reference/pyntc/devices/f5_device.html new file mode 100644 index 00000000..daa29bad --- /dev/null +++ b/docs/dev/code-reference/pyntc/devices/f5_device.html @@ -0,0 +1,3055 @@ + + + + + + + + + + + + + + + + + + + + + F5 device - Pyntc Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

+ pyntc.devices.f5_device + + +

+ +
+ +

Module for using an F5 TMOS device over the REST / SOAP.

+ + + + + + + + +
+ + + + + + + + +
+ + + +

+ pyntc.devices.f5_device.F5Device + + +

+ + +
+

+ Bases: BaseDevice

+ + +

F5 LTM Device Implementation.

+ + + + + + + + + +
+ + + + + + + +
+ + + +

+ boot_options + + + property + + +

+ + +
+ +

Get active volume.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ dict + +
+

Key is active volume with value being the current active volume.

+
+
+
+ +
+ +
+ + + +

+ fqdn + + + property + + +

+ + +
+ +

Get fully-qualified domain name.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Fully qualified domain name.

+
+
+
+ +
+ +
+ + + +

+ hostname + + + property + + +

+ + +
+ +

Get hostname of device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Hostname.

+
+
+
+ +
+ +
+ + + +

+ interfaces + + + property + + +

+ + +
+ +

Get list of images on the device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list + +
+

List of images.

+
+
+
+ +
+ +
+ + + +

+ model + + + property + + +

+ + +
+ +

Get model of device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Model of device.

+
+
+
+ +
+ +
+ + + +

+ os_version + + + property + + +

+ + +
+ +

Get version of device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Version on device.

+
+
+
+ +
+ +
+ + + +

+ serial_number + + + property + + +

+ + +
+ +

Get serial number of device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Serial number of device.

+
+
+
+ +
+ +
+ + + +

+ uptime + + + property + + +

+ + +
+ +

Get uptime of device in seconds.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ float + +
+

Uptime of device.

+
+
+
+ +
+ +
+ + + +

+ uptime_string + + + property + + +

+ + +
+ +

Get uptime of device in format dd:hh:mm:ss.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Uptime of device.

+
+
+
+ +
+ +
+ + + +

+ vlans + + + property + + +

+ + +
+ +

Get list of vlans on device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list + +
+

List of vlans.

+
+
+
+ +
+ + + +
+ + +

+ __init__(host, username, password, **kwargs) + +

+ + +
+ +

PyNTC implementation for F5 device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ host + + str + +
+

The address of the network device.

+
+
+ required +
+ username + + str + +
+

The username to authenticate with the device.

+
+
+ required +
+ password + + str + +
+

The password to authenticate with the device.

+
+
+ required +
+ kwargs + + dict + +
+

Additional keyword arguments.

+
+
+ {} +
+ +
+ +
+ +
+ + +

+ backup_running_config(filename) + +

+ + +
+ +

Backup running configuration.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ filename + + str + +
+

Name of file to save running config to.

+
+
+ required +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

Function currently not implemeneted.

+
+
+ +
+ +
+ +
+ + +

+ checkpoint(filename) + +

+ + +
+ +

Create checkpoint configuration file.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ filename + + str + +
+

Name of file to save running config to.

+
+
+ required +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

Function currently not implemeneted.

+
+
+ +
+ +
+ +
+ + +

+ close() + +

+ + +
+ +

Implement pass.

+ +
+ +
+ +
+ + +

+ config(command) + +

+ + +
+ +

Send command to device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ command + + str + +
+

Command.

+
+
+ required +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

Function currently not implemented.

+
+
+ +
+ +
+ +
+ + +

+ file_copy(src, dest=None, **kwargs) + +

+ + +
+ +

Copy file to device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ src + + str + +
+

Source of file.

+
+
+ required +
+ dest + + str + +
+

Destination to save file. Defaults to None.

+
+
+ None +
+ kwargs + + dict + +
+

Additional keyword arguments.

+
+
+ {} +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ FileTransferError + +
+

Error in verifying if file existed before transfer.

+
+
+ +
+ +
+ +
+ + +

+ file_copy_remote_exists(src, dest=None, **kwargs) + +

+ + +
+ +

Copy file to device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ src + + str + +
+

Source of file.

+
+
+ required +
+ dest + + str + +
+

Destination to save file. Defaults to None.

+
+
+ None +
+ kwargs + + dict + +
+

Additional keyword arguments.

+
+
+ {} +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

Destination must be /shared/images.

+
+
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if image specified exists on device. Otherwise, false.

+
+
+ +
+ +
+ +
+ + +

+ image_installed(image_name, volume) + +

+ + +
+ +

Check if image is installed on specified volume.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ image_name + + str + +
+

Name of image.

+
+
+ required +
+ volume + + str + +
+

Volume to look for image on.

+
+
+ required +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ RuntimeError + +
+

Either image name or volume were not specified.

+
+
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if file exists on volume. Otherwise, false.

+
+
+ +
+ +
+ +
+ + +

+ install_os(image_name, **vendor_specifics) + +

+ + +
+ +

Install OS on device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ image_name + + str + +
+

Image name.

+
+
+ required +
+ vendor_specifics + + dict + +
+

Vendor specific arguments.

+
+
+ {} +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NTCFileNotFoundError + +
+

Error is image is not found on device.

+
+
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if image is installed successfully. Otherwise, false.

+
+
+ +
+ +
+ +
+ + +

+ open() + +

+ + +
+ +

Implement pass.

+ +
+ +
+ +
+ + +

+ reboot(wait_for_reload=False, volume=None, **kwargs) + +

+ + +
+ +

Reload the controller or controller pair.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ volume + + str + +
+

Active volume to reboot. Defaults to None.

+
+
+ None +
+ wait_for_reload + + bool + +
+

Whether or not reboot method should also run _wait_for_device_reboot(). Defaults to False.

+
+
+ False +
+ kwargs + + dict + +
+

Additional keyword arguments.

+
+
+ {} +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ RuntimeError + +
+

If device is unreachable after timeout period, raise an error.

+
+
+ + +
+ Example +
+
+
+

device = F5Device(**connection_args) +device.reboot() +

+
+
+
+
+
+ +
+ +
+ + +

+ rollback(checkpoint_file) + +

+ + +
+ +

Rollback to checkpoint configuration file.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ checkpoint_file + + str + +
+

Name of checkpoint file.

+
+
+ required +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

Function currently not implemented.

+
+
+ +
+ +
+ +
+ + +

+ running_config() + +

+ + +
+ +

Get running configuration.

+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

Function currently not implemented.

+
+
+ +
+ +
+ +
+ + +

+ save(filename=None) + +

+ + +
+ +

Save running configuration.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ filename + + str + +
+

Name of file to save running configuration to. Defaults to None.

+
+
+ None +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

Function currently not implemented.

+
+
+ +
+ +
+ +
+ + +

+ set_boot_options(image_name, **vendor_specifics) + +

+ + +
+ +

Set boot option on device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ image_name + + str + +
+

Name of image.

+
+
+ required +
+ vendor_specifics + + dict + +
+

Vendor specific arguments.

+
+
+ {} +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NTCFileNotFoundError + +
+

Error if file is not found on device.

+
+
+ +
+ +
+ +
+ + +

+ show(command, raw_text=False) + +

+ + +
+ +

Run cli command on device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ command + + str + +
+

Command to be ran.

+
+
+ required +
+ raw_text + + bool + +
+

Specifies if you want raw text. Defaults to False.

+
+
+ False +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

[description]

+
+
+ +
+ +
+ +
+ + +

+ startup_config() + +

+ + +
+ +

Get startup configuration.

+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

Function currently not implemented.

+
+
+ +
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/ios_device.html b/docs/dev/code-reference/pyntc/devices/ios_device.html new file mode 100644 index 00000000..11231202 --- /dev/null +++ b/docs/dev/code-reference/pyntc/devices/ios_device.html @@ -0,0 +1,4269 @@ + + + + + + + + + + + + + + + + + + + + + Ios device - Pyntc Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

+ pyntc.devices.ios_device + + +

+ +
+ +

Module for using a Cisco IOS device over SSH.

+ + + + + + + + +
+ + + + + + + + +
+ + + +

+ pyntc.devices.ios_device.IOSDevice + + +

+ + +
+

+ Bases: BaseDevice

+ + +

Cisco IOS Device Implementation.

+ + + + + + + + + +
+ + + + + + + +
+ + + +

+ boot_options + + + property + + +

+ + +
+ +

Get current boot image.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ dict + +
+

Key sys with value being the current boot image.

+
+
+
+ +
+ +
+ + + +

+ config_register + + + property + + +

+ + +
+ +

Get config register of device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Config register.

+
+
+
+ +
+ +
+ + + +

+ connected + + + property + writable + + +

+ + +
+ +

Get connection status of the device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if the device is connected, else False.

+
+
+
+ +
+ +
+ + + +

+ fqdn + + + property + + +

+ + +
+ +

Get fully qualified domain name.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Fully qualified domain name or N/A if not defined.

+
+
+
+ +
+ +
+ + + +

+ hostname + + + property + + +

+ + +
+ +

Get hostname of device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Hostname of device.

+
+
+
+ +
+ +
+ + + +

+ interfaces + + + property + + +

+ + +
+ +

Get list of interfaces on device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list + +
+

List of interfaces on device.

+
+
+
+ +
+ +
+ + + +

+ model + + + property + + +

+ + +
+ +

Get the device model.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Device model.

+
+
+
+ +
+ +
+ + + +

+ os_version + + + property + + +

+ + +
+ +

Get os version on device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

OS version on device.

+
+
+
+ +
+ +
+ + + +

+ peer_redundancy_state + + + property + + +

+ + +
+ +

Determine the current redundancy state of the peer processor.

+ + +

Returns:

+ + + + + + + + + + + + + + + + + +
TypeDescription
+ str + +
+

The redundancy state of the peer processor.

+
+
+ None + +
+

When the processor does not support redundancy.

+
+
+ + +
+ Example +
+
+
+

device = IOSDevice(**connection_args) +device.peer_redundancy_state +'standby hot' +

+
+
+
+
+ +
+ +
+ + + +

+ redundancy_mode + + + property + + +

+ + +
+ +

Get operating redundancy mode of the device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

The redundancy mode the device is operating in. +If the command is not supported, then "n/a" is returned.

+
+
+ + +
+ Example +
+
+
+

device = IOSDevice(**connection_args) +device.redundancy_mode +'stateful switchover' +

+
+
+
+
+ +
+ +
+ + + +

+ redundancy_state + + + property + + +

+ + +
+ +

Determine the current redundancy state of the processor.

+ + +

Returns:

+ + + + + + + + + + + + + + + + + +
TypeDescription
+ str + +
+

The redundancy state of the current processor.

+
+
+ None + +
+

When the processor does not support redundancy.

+
+
+ + +
+ Example +
+
+
+

device = IOSDevice(**connection_args) +device.redundancy_state +'active' +

+
+
+
+
+ +
+ +
+ + + +

+ running_config + + + property + + +

+ + +
+ +

Get running configuration.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Output of show running-config.

+
+
+
+ +
+ +
+ + + +

+ serial_number + + + property + + +

+ + +
+ +

Get serial number of device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Serial number of device.

+
+
+
+ +
+ +
+ + + +

+ startup_config + + + property + + +

+ + +
+ +

Get startup configuration.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Startup configuration from device.

+
+
+
+ +
+ +
+ + + +

+ uptime + + + property + + +

+ + +
+ +

Get uptime from device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ int + +
+

Uptime in seconds.

+
+
+
+ +
+ +
+ + + +

+ uptime_string + + + property + + +

+ + +
+ +

Get uptime in format dd:hh:mm.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Uptime of device.

+
+
+
+ +
+ +
+ + + +

+ vlans + + + property + + +

+ + +
+ +

Get list of VLANs on device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list + +
+

List of VLANs on device.

+
+
+
+ +
+ + + +
+ + +

+ __init__(host, username, password, secret='', port=None, confirm_active=True, **kwargs) + +

+ + +
+ +

PyNTC Device implementation for Cisco IOS.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ host + + str + +
+

The address of the network device.

+
+
+ required +
+ username + + str + +
+

The username to authenticate with the device.

+
+
+ required +
+ password + + str + +
+

The password to authenticate with the device.

+
+
+ required +
+ secret + + str + +
+

The password to escalate privilege on the device.

+
+
+ '' +
+ port + + int + +
+

The port to use to establish the connection. Defaults to 22.

+
+
+ None +
+ confirm_active + + bool + +
+

Determines if device's high availability state should be validated before leaving connection open.

+
+
+ True +
+ kwargs + + dict + +
+

Additional arguments to pass to the Netmiko ConnectHandler.

+
+
+ {} +
+ +
+ +
+ +
+ + +

+ backup_running_config(filename) + +

+ + +
+ +

Backup running configuration to filename specified.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ filename + + str + +
+

Filename to save running configuration to.

+
+
+ required +
+ +
+ +
+ +
+ + +

+ check_file_exists(filename, file_system=None) + +

+ + +
+ +

Check if a remote file exists by filename.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ filename + + str + +
+

The name of the file to check for on the remote device.

+
+
+ required +
+ file_system + + str + +
+

Supported only for IOS and NXOS. The file system for the +remote file. If no file_system is provided, then the get_file_system +method is used to determine the correct file system to use.

+
+
+ None +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if the remote file exists, False if it doesn't.

+
+
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ CommandError + +
+

If there is an error in executing the command to check if the file exists.

+
+
+ +
+ +
+ +
+ + +

+ checkpoint(checkpoint_file) + +

+ + +
+ +

Create checkpoint file.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ checkpoint_file + + str + +
+

Name of checkpoint file.

+
+
+ required +
+ +
+ +
+ +
+ + +

+ close() + +

+ + +
+ +

Disconnect from device.

+ +
+ +
+ +
+ + +

+ config(command, **netmiko_args) + +

+ + +
+ +

Send config commands to device.

+

By default, entering and exiting config mode is handled automatically. +To disable entering and exiting config mode, pass enter_config_mode and exit_config_mode in **netmiko_args. +This supports all arguments supported by Netmiko's send_config_set method using netmiko_args. +This will send each command in command until either an Error is caught or all commands have been sent.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ command + + str | list + +
+

The command or commands to send to the device.

+
+
+ required +
+ **netmiko_args + + dict + +
+

Any argument supported by netmiko.ConnectHandler.send_config_set.

+
+
+ {} +
+ + +

Returns:

+ + + + + + + + + + + + + + + + + +
TypeDescription
+ str + +
+

When command is a str, the config session input and output from sending command.

+
+
+ list + +
+

When command is a list, the config session input and output from sending command.

+
+
+ + +

Raises:

+ + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ TypeError + +
+

When sending an argument in **netmiko_args that is not supported.

+
+
+ CommandError + +
+

When command is a str and its results report an error.

+
+
+ CommandListError + +
+

When command is a list and one of the commands reports an error.

+
+
+ + +
+ Example +
+
+
+

device = IOSDevice(**connection_args) +device.config("no service pad") +'configure terminal\nEnter configuration commands, one per line. End with CNTL/Z.\n' +'host(config)#no service pad\nhost(config)#end\nhost#' +device.config(["interface Gig0/1", "description x-connect"]) +['host(config)#interface Gig0/1\nhost(config-if)#, 'description x-connect\nhost(config-if)#'] +

+
+
+
+
+
+ +
+ +
+ + +

+ confirm_is_active() + +

+ + +
+ +

Confirm that the device is either standalone or the active device in a high availability cluster.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True when the device is considered active.

+
+
+ + +
+ Rasies +

DeviceNotActiveError: When the device is not considered the active device.

+
+ +
+ Example +
+
+
+

device = IOSDevice(**connection_args) +device.redundancy_state +'standby hot' +device.confirm_is_active() +raised DeviceNotActiveError: +host1 is not the active device.

+
+
+
+

device state: standby hot +peer state: active

+
+
+
+

device.redundancy_state +'active' +device.confirm_is_active() +True +

+
+
+
+
+
+ +
+ +
+ + +

+ enable() + +

+ + +
+ +

Ensure device is in enable mode.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ None + +
+

Device prompt is set to enable mode.

+
+
+ +
+ +
+ +
+ + +

+ file_copy(src, dest=None, file_system=None) + +

+ + +
+ +

Copy file to device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ src + + str + +
+

Source of file.

+
+
+ required +
+ dest + + str + +
+

Destination name for file. Defaults to None.

+
+
+ None +
+ file_system + + str + +
+

File system to copy file to. Defaults to None.

+
+
+ None +
+ + +

Raises:

+ + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ SocketClosedError + +
+

Error raised if connection to device is closed.

+
+
+ FileTransferError + +
+

Error in transferring file.

+
+
+ FileTransferError + +
+

Error if unable to verify file was transferred successfully.

+
+
+ +
+ +
+ +
+ + +

+ file_copy_remote_exists(src, dest=None, file_system=None) + +

+ + +
+ +

Check if file exists on remote device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ src + + str + +
+

Source of file.

+
+
+ required +
+ dest + + str + +
+

Destination name for file. Defaults to None.

+
+
+ None +
+ file_system + + str + +
+

File system to copy file to. Defaults to None.

+
+
+ None +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if file copied succesfully and md5 hashes match. Otherwise, false.

+
+
+ +
+ +
+ +
+ + +

+ get_remote_checksum(filename, hashing_algorithm='md5', file_system=None) + +

+ + +
+ +

Get the checksum of a remote file.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ filename + + str + +
+

The name of the file to check for on the remote device.

+
+
+ required +
+ hashing_algorithm + + str + +
+

The hashing algorithm to use. Valid choices are "md5" and "sha512" (default: "md5").

+
+
+ 'md5' +
+ file_system + + str + +
+

Supported only for IOS and NXOS. The file system for the +remote file. If no file_system is provided, then the get_file_system +method is used to determine the correct file system to use.

+
+
+ None +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

The checksum of the remote file.

+
+
+ + +

Raises:

+ + + + + + + + + + + + + + + + + +
TypeDescription
+ ValueError + +
+

If an unsupported hashing algorithm is provided.

+
+
+ CommandError + +
+

If there is an error in executing the command to get the remote checksum.

+
+
+ +
+ +
+ +
+ + +

+ install_os(image_name, install_mode=False, read_timeout=2000, **vendor_specifics) + +

+ + +
+ +

Installs the prescribed Network OS, which must be present before issuing this command.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ image_name + + str + +
+

Name of the IOS image to boot into

+
+
+ required +
+ install_mode + + bool + +
+

Uses newer install method on devices. Defaults to False.

+
+
+ False +
+ read_timeout + + int + +
+

Netmiko timeout when waiting for device prompt. Default 30.

+
+
+ 2000 +
+ vendor_specifics + + dict + +
+

Vendor specific arguments to pass to the install command.

+
+
+ {} +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ OSInstallError + +
+

Unable to install OS Error type

+
+
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

False if no install is needed, true if the install completes successfully

+
+
+ +
+ +
+ +
+ + +

+ is_active() + +

+ + +
+ +

Determine if the current processor is the active processor.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if the processor is active or does not support HA, else False.

+
+
+ + +
+ Example +
+
+
+

device = IOSDevice(**connection_args) +device.is_active() +True +

+
+
+
+
+
+ +
+ +
+ + +

+ open(confirm_active=True) + +

+ + +
+ +

Open a connection to the network device.

+

This method will close the connection if confirm_active is True and the device is not active. +Devices that do not have high availability are considered active.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ confirm_active + + bool + +
+

Determines if device's high availability state should be validated before leaving connection open.

+
+
+ True +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ DeviceNotActiveError + +
+

When confirm_active is True, and the device high availability state is not active.

+
+
+ + +
+ Example +
+
+
+

device = IOSDevice(**connection_args) +device.open() +raised DeviceNotActiveError: +host1 is not the active device.

+
+
+
+

device state: standby hot +peer state: active

+
+
+
+

device.open(confirm_active=False) +device.connected +True +

+
+
+
+
+
+ +
+ +
+ + +

+ reboot(wait_for_reload=False, **kwargs) + +

+ + +
+ +

Reboot device.

+

Reload the controller or controller pair.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ wait_for_reload + + bool + +
+

Whether or not reboot method should also run _wait_for_device_reboot(). Defaults to False.

+
+
+ False +
+ kwargs + + dict + +
+

Additional arguments to pass to the Netmiko.

+
+
+ {} +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ ReloadTimeoutError + +
+

When the device is still unreachable after the timeout period.

+
+
+ +
+ +
+ +
+ + +

+ remote_file_copy(src, dest=None, file_system=None, **kwargs) + +

+ + +
+ +

Copy a file to a remote device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ src + + FileCopyModel + +
+

The source file model.

+
+
+ required +
+ dest + + str + +
+

The destination file path on the remote device.

+
+
+ None +
+ kwargs + + dict + +
+

Additional keyword arguments that may be used by subclasses.

+
+
+ {} +
+ + +

Other Parameters:

+ + + + + + + + + + + + + + + +
NameTypeDescription
file_system + str + +
+

Supported only for IOS and NXOS. The file system for the +remote file. If no file_system is provided, then the get_file_system +method is used to determine the correct file system to use.

+
+
+ + +

Raises:

+ + + + + + + + + + + + + + + + + +
TypeDescription
+ TypeError + +
+

If src is not an instance of FileCopyModel.

+
+
+ FileTransferError + +
+

If there is an error during file transfer or if the file cannot be verified after transfer.

+
+
+ +
+ +
+ +
+ + +

+ rollback(rollback_to) + +

+ + +
+ +

Rollback configuration to file on flash.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ rollback_to + + sEtr + +
+

Name of the file to rollback to.

+
+
+ required +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ RollbackError + +
+

Error if unable to rollback to configuration.

+
+
+ +
+ +
+ +
+ + +

+ save(filename='startup-config') + +

+ + +
+ +

Save running configuration.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ filename + + str + +
+

Name of file to save running configuration. Defaults to "startup-config".

+
+
+ 'startup-config' +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if save is succesfull.

+
+
+ +
+ +
+ +
+ + +

+ set_boot_options(image_name, **vendor_specifics) + +

+ + +
+ +

Set specified image as boot image.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ image_name + + str + +
+

Name of image to set as boot variable.

+
+
+ required +
+ vendor_specifics + + dict + +
+

Vendor specific arguments to pass to the set_boot_options command.

+
+
+ {} +
+ + +

Raises:

+ + + + + + + + + + + + + + + + + +
TypeDescription
+ NTCFileNotFoundError + +
+

Error if file is not found on device.

+
+
+ CommandError + +
+

Error if setting new image as boot variable fails.

+
+
+ +
+ +
+ +
+ + +

+ show(command, expect_string=None, **netmiko_args) + +

+ + +
+ +

Run command on device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ command + + str + +
+

Command to be ran.

+
+
+ required +
+ expect_string + + str + +
+

Expected string from command output. Defaults to None.

+
+
+ None +
+ netmiko_args + + dict + +
+

Additional arguments to pass to Netmiko's send_command method.

+
+
+ {} +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Output of command.

+
+
+ +
+ +
+ +
+ + +

+ verify_file(checksum, filename, hashing_algorithm='md5', file_system=None) + +

+ + +
+ +

Verify a file on the remote device by and validate the checksums.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ checksum + + str + +
+

The checksum of the file.

+
+
+ required +
+ filename + + str + +
+

The name of the file to check for on the remote device.

+
+
+ required +
+ hashing_algorithm + + str + +
+

The hashing algorithm to use (default: "md5").

+
+
+ 'md5' +
+ file_system + + str + +
+

Supported only for IOS and NXOS. The file system for the +remote file. If no file_system is provided, then the get_file_system +method is used to determine the correct file system to use.

+
+
+ None +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if the file is verified successfully, False otherwise.

+
+
+ +
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ pyntc.devices.ios_device.RebootSignal + + +

+ + +
+

+ Bases: NTCError

+ + +

RebootSignal.

+ + + + + + + + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/iosxewlc_device.html b/docs/dev/code-reference/pyntc/devices/iosxewlc_device.html new file mode 100644 index 00000000..bbb4984c --- /dev/null +++ b/docs/dev/code-reference/pyntc/devices/iosxewlc_device.html @@ -0,0 +1,1315 @@ + + + + + + + + + + + + + + + + + + + + + Iosxewlc device - Pyntc Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

+ pyntc.devices.iosxewlc_device + + +

+ +
+ +

Module for using a Cisco IOSXE WLC device over SSH.

+ + + + + + + + +
+ + + + + + + + +
+ + + +

+ pyntc.devices.iosxewlc_device.IOSXEWLCDevice + + +

+ + +
+

+ Bases: IOSDevice

+ + +

Cisco IOSXE WLC Device Implementation.

+ + + + + + + + + +
+ + + + + + + + + +
+ + +

+ install_os(image_name, read_timeout=2000, **vendor_specifics) + +

+ + +
+ +

Installs the prescribed Network OS, which must be present before issuing this command.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ image_name + + str + +
+

Name of the IOS image to boot into

+
+
+ required +
+ read_timeout + + int + +
+

Timeout for reading the output of the command.

+
+
+ 2000 +
+ vendor_specifics + + dict + +
+

Vendor specific options.

+
+
+ {} +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ OSInstallError + +
+

Unable to install OS Error type

+
+
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

False if no install is needed, true if the install completes successfully

+
+
+ +
+ +
+ +
+ + +

+ show(command, expect_string=None, **netmiko_args) + +

+ + +
+ +

Run command on device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ command + + str + +
+

Command to be ran.

+
+
+ required +
+ expect_string + + str + +
+

Expected string from command output. Defaults to None.

+
+
+ None +
+ netmiko_args + + dict + +
+

Additional arguments to pass to Netmiko's send_command method.

+
+
+ {} +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Output of command.

+
+
+ +
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/jnpr_device.html b/docs/dev/code-reference/pyntc/devices/jnpr_device.html new file mode 100644 index 00000000..d36b5112 --- /dev/null +++ b/docs/dev/code-reference/pyntc/devices/jnpr_device.html @@ -0,0 +1,2821 @@ + + + + + + + + + + + + + + + + + + + + + Jnpr device - Pyntc Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

+ pyntc.devices.jnpr_device + + +

+ +
+ +

Module for using a Juniper junOS device.

+ + + + + + + + +
+ + + + + + + + +
+ + + +

+ pyntc.devices.jnpr_device.JunosDevice + + +

+ + +
+

+ Bases: BaseDevice

+ + +

Juniper JunOS Device Implementation.

+ + + + + + + + + +
+ + + + + + + +
+ + + +

+ boot_options + + + property + + +

+ + +
+ +

Get os version on device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

OS version on device.

+
+
+
+ +
+ +
+ + + +

+ connected + + + property + + +

+ + +
+ +

Get connection status of device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if connection is active. Otherwise, false.

+
+
+
+ +
+ +
+ + + +

+ fqdn + + + property + + +

+ + +
+ +

Get fully qualified domain name.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Fully qualified domain name.

+
+
+
+ +
+ +
+ + + +

+ hostname + + + property + + +

+ + +
+ +

Get device hostname.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Device hostname.

+
+
+
+ +
+ +
+ + + +

+ interfaces + + + property + + +

+ + +
+ +

Get list of interfaces.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list + +
+

List of interfaces.

+
+
+
+ +
+ +
+ + + +

+ model + + + property + + +

+ + +
+ +

Get device model.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Device model.

+
+
+
+ +
+ +
+ + + +

+ os_version + + + property + + +

+ + +
+ +

Get OS version.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

OS version.

+
+
+
+ +
+ +
+ + + +

+ running_config + + + property + + +

+ + +
+ +

Get running configuration.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Running configuration.

+
+
+
+ +
+ +
+ + + +

+ serial_number + + + property + + +

+ + +
+ +

Get serial number.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Serial number.

+
+
+
+ +
+ +
+ + + +

+ startup_config + + + property + + +

+ + +
+ +

Get startup configuration.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Startup configuration.

+
+
+
+ +
+ +
+ + + +

+ uptime + + + property + + +

+ + +
+ +

Get device uptime in seconds.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ int + +
+

Device uptime in seconds.

+
+
+
+ +
+ +
+ + + +

+ uptime_string + + + property + + +

+ + +
+ +

Get device uptime in format dd:hh:mm:ss.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Device uptime.

+
+
+
+ +
+ + + +
+ + +

+ __init__(host, username, password, *args, **kwargs) + +

+ + +
+ +

PyNTC device implementation for Juniper JunOS.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ host + + str + +
+

The address of the network device.

+
+
+ required +
+ username + + str + +
+

The username to authenticate with the device.

+
+
+ required +
+ password + + str + +
+

The password to authenticate with the device.

+
+
+ required +
+ args + + tuple + +
+

Additional positional arguments to pass to the device.

+
+
+ () +
+ kwargs + + dict + +
+

Additional keyword arguments to pass to the device.

+
+
+ {} +
+ +
+ +
+ +
+ + +

+ backup_running_config(filename) + +

+ + +
+ +

Backup current running configuration.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ filename + + str + +
+

Name used for backup file.

+
+
+ required +
+ +
+ +
+ +
+ + +

+ checkpoint(filename) + +

+ + +
+ +

Create checkpoint file.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ filename + + str + +
+

Name of checkpoint file.

+
+
+ required +
+ +
+ +
+ +
+ + +

+ close() + +

+ + +
+ +

Close connection to device.

+ +
+ +
+ +
+ + +

+ config(commands, format_type='set') + +

+ + +
+ +

Send configuration commands to a device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ commands + + (str, list) + +
+

String with single command, or list with multiple commands.

+
+
+ required +
+ format_type + + str + +
+

Format type for the command. Defaults to "set".

+
+
+ 'set' +
+ + +

Raises:

+ + + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ ConfigLoadError + +
+

Issue with loading the command.

+
+
+ CommandError + +
+

Issue with the command provided, if its a single command, passed in as a string.

+
+
+ CommandListError + +
+

Issue with a command in the list provided.

+
+
+ +
+ +
+ +
+ + +

+ file_copy(src, dest=None, **kwargs) + +

+ + +
+ +

Copy file to device via SCP.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ src + + str + +
+

Name of file to be transferred.

+
+
+ required +
+ dest + + str + +
+

Path on device to save file. Defaults to None.

+
+
+ None +
+ kwargs + + dict + +
+

Additional keyword arguments to pass to the file_copy command.

+
+
+ {} +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ FileTransferError + +
+

Raised when unable to verify file was transferred succesfully.

+
+
+ +
+ +
+ +
+ + +

+ file_copy_remote_exists(src, dest=None, **kwargs) + +

+ + +
+ +

Verify device already has existing file.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ src + + str + +
+

Source of local file.

+
+
+ required +
+ dest + + str + +
+

Path of file on device. Defaults to None.

+
+
+ None +
+ kwargs + + dict + +
+

Additional keyword arguments to pass to the file_copy command.

+
+
+ {} +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if hashes of the file match. Otherwise, false.

+
+
+ +
+ +
+ +
+ + +

+ install_os(image_name, **vendor_specifics) + +

+ + +
+ +

Install OS on device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ image_name + + str + +
+

Name of image.

+
+
+ required +
+ vendor_specifics + + dict + +
+

Vendor specific options.

+
+
+ {} +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

Method currently not implemented.

+
+
+ +
+ +
+ +
+ + +

+ open() + +

+ + +
+ +

Open connection to device.

+ +
+ +
+ +
+ + +

+ reboot(wait_for_reload=False, **kwargs) + +

+ + +
+ +

Reload the controller or controller pair.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ wait_for_reload + + bool + +
+

Whether or not reboot method should also run _wait_for_device_reboot(). Defaults to False.

+
+
+ False +
+ kwargs + + dict + +
+

Additional keyword arguments to pass to the reboot command.

+
+
+ {} +
+ + +
+ Example +
+
+
+

device = JunosDevice(**connection_args) +device.reboot() +

+
+
+
+
+
+ +
+ +
+ + +

+ rollback(filename) + +

+ + +
+ +

Rollback to a specific configuration file.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ filename + + str + +
+

Filename to rollback device to.

+
+
+ required +
+ +
+ +
+ +
+ + +

+ save(filename=None) + +

+ + +
+ +

Save current configuration to device.

+

If filename is provided, save current configuration to file.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ filename + + str + +
+

Filename to save current configuration. Defaults to None.

+
+
+ None +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if new file created for save file. Otherwise, just returns if save is to default name.

+
+
+ +
+ +
+ +
+ + +

+ set_boot_options(sys) + +

+ + +
+ +

Set boot options.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ sys + + str + +
+

Name of image to set boot option to.

+
+
+ required +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError + +
+

Method currently not implemented.

+
+
+ +
+ +
+ +
+ + +

+ show(commands) + +

+ + +
+ +

Send configuration commands to a device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ commands + + (str, list) + +
+

String with single command, or list with multiple commands.

+
+
+ required +
+ + +

Raises:

+ + + + + + + + + + + + + + + + + +
TypeDescription
+ CommandError + +
+

Issue with the command provided.

+
+
+ CommandListError + +
+

Issue with a command in the list provided.

+
+
+ +
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/nxos_device.html b/docs/dev/code-reference/pyntc/devices/nxos_device.html new file mode 100644 index 00000000..f625e13e --- /dev/null +++ b/docs/dev/code-reference/pyntc/devices/nxos_device.html @@ -0,0 +1,3045 @@ + + + + + + + + + + + + + + + + + + + + + Nxos device - Pyntc Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

+ pyntc.devices.nxos_device + + +

+ +
+ +

Module for using an NXOS device over NX-API.

+ + + + + + + + +
+ + + + + + + + +
+ + + +

+ pyntc.devices.nxos_device.NXOSDevice + + +

+ + +
+

+ Bases: BaseDevice

+ + +

Cisco NXOS Device Implementation.

+ + + + + + + + + +
+ + + + + + + +
+ + + +

+ boot_options + + + property + + +

+ + +
+ +

Get current boot variables.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ dict + +
+

e.g . {"kick": "router_kick.img", "sys": "router_sys.img"}

+
+
+
+ +
+ +
+ + + +

+ fqdn + + + property + + +

+ + +
+ +

Get fully qualified domain name.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Fully qualified domain name.

+
+
+
+ +
+ +
+ + + +

+ hostname + + + property + + +

+ + +
+ +

Get hostname of the device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Hostname of the device.

+
+
+
+ +
+ +
+ + + +

+ interfaces + + + property + + +

+ + +
+ +

Get list of interfaces.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list + +
+

List of interfaces.

+
+
+
+ +
+ +
+ + + +

+ model + + + property + + +

+ + +
+ +

Get device model.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Model of device.

+
+
+
+ +
+ +
+ + + +

+ os_version + + + property + + +

+ + +
+ +

Get device version.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Device version.

+
+
+
+ +
+ +
+ + + +

+ running_config + + + property + + +

+ + +
+ +

Get running configuration of device.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Running configuration of device.

+
+
+
+ +
+ +
+ + + +

+ serial_number + + + property + + +

+ + +
+ +

Get device serial number.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Device serial number.

+
+
+
+ +
+ +
+ + + +

+ startup_config + + + property + + +

+ + +
+ +

Get startup configuration.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Startup configuration.

+
+
+
+ +
+ +
+ + + +

+ uptime + + + property + + +

+ + +
+ +

Get uptime of the device in seconds.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ int + +
+

Uptime of the device in seconds.

+
+
+
+ +
+ +
+ + + +

+ uptime_string + + + property + + +

+ + +
+ +

Get uptime in format dd:hh:mm.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Uptime of device.

+
+
+
+ +
+ +
+ + + +

+ vlans + + + property + + +

+ + +
+ +

Get list of vlans.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list + +
+

List of vlans on the device.

+
+
+
+ +
+ + + +
+ + +

+ __init__(host, username, password, transport='http', timeout=30, port=None, verify=True, **kwargs) + +

+ + +
+ +

PyNTC Device implementation for Cisco IOS.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ host + + str + +
+

The address of the network device.

+
+
+ required +
+ username + + str + +
+

The username to authenticate with the device.

+
+
+ required +
+ password + + str + +
+

The password to authenticate with the device.

+
+
+ required +
+ transport + + str + +
+

Transport protocol to connect to device. Defaults to "http".

+
+
+ 'http' +
+ timeout + + int + +
+

Timeout in seconds. Defaults to 30.

+
+
+ 30 +
+ port + + int + +
+

Port used to connect to device. Defaults to None.

+
+
+ None +
+ verify + + bool + +
+

SSL verification.

+
+
+ True +
+ kwargs + + dict + +
+

Left for compatibility with other tools, for instance nautobot-inventory may pass additional kwargs.

+
+
+ {} +
+ +
+ +
+ +
+ + +

+ backup_running_config(filename) + +

+ + +
+ +

Backup running configuration.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ filename + + str + +
+

Name of backup file.

+
+
+ required +
+ +
+ +
+ +
+ + +

+ checkpoint(filename) + +

+ + +
+ +

Save a checkpoint of the running configuration to the device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ filename + + str + +
+

The filename to save the checkpoint on the remote device.

+
+
+ required +
+ +
+ +
+ +
+ + +

+ close() + +

+ + +
+ +

Implements pass.

+ +
+ +
+ +
+ + +

+ config(command) + +

+ + +
+ +

Send configuration command.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ command + + (str, list) + +
+

command to be sent to the device.

+
+
+ required +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ CommandError + +
+

Error if command is not succesfully ran on device.

+
+
+ +
+ +
+ +
+ + +

+ file_copy(src, dest=None, file_system='bootflash:') + +

+ + +
+ +

Send a local file to the device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ src + + str + +
+

Path to the local file to send.

+
+
+ required +
+ dest + + str + +
+

The destination file path. Defaults to basename of source path.

+
+
+ None +
+ file_system + + str + +
+

[The file system for the remote file. Defaults to "bootflash:".

+
+
+ 'bootflash:' +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ FileTransferError + +
+

Error if transfer of file cannot be verified.

+
+
+ +
+ +
+ +
+ + +

+ file_copy_remote_exists(src, dest=None, file_system='bootflash:') + +

+ + +
+ +

Check if a remote file exists.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ src + + str + +
+

Path to the local file to send.

+
+
+ required +
+ dest + + str + +
+

The destination file path to be saved on remote device. Defaults to basename of source path.

+
+
+ None +
+ file_system + + str + +
+

The file system for the remote file. Defaults to "bootflash:".

+
+
+ 'bootflash:' +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if the remote file exists. Otherwise, false.

+
+
+ +
+ +
+ +
+ + +

+ install_os(image_name, **vendor_specifics) + +

+ + +
+ +

Upgrade device with provided image.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ image_name + + str + +
+

Name of the image file to upgrade the device to.

+
+
+ required +
+ vendor_specifics + + dict + +
+

Vendor specific options.

+
+
+ {} +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ OSInstallError + +
+

Error if boot option is not set to new image.

+
+
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if new image is boot option on device. Otherwise, false.

+
+
+ +
+ +
+ +
+ + +

+ open() + +

+ + +
+ +

Implements pass.

+ +
+ +
+ +
+ + +

+ reboot(wait_for_reload=False, **kwargs) + +

+ + +
+ +

Reload the controller or controller pair.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ wait_for_reload + + bool + +
+

Whether or not reboot method should also run _wait_for_device_reboot(). Defaults to False.

+
+
+ False +
+ kwargs + + dict + +
+

Additional arguments to pass to reboot method.

+
+
+ {} +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ RebootTimerError + +
+

When the device is still unreachable after the timeout period.

+
+
+ + +
+ Example +
+
+
+

device = NXOSDevice(**connection_args) +device.reboot() +

+
+
+
+
+
+ +
+ +
+ + +

+ refresh() + +

+ + +
+ +

Refresh caches on device instance.

+ +
+ +
+ +
+ + +

+ rollback(filename) + +

+ + +
+ +

Rollback configuration to specified file.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ filename + + str + +
+

Name of the file to rollback to.

+
+
+ required +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ RollbackError + +
+

Error if rollback command is unsuccesfull.

+
+
+ +
+ +
+ +
+ + +

+ save(filename='startup-config') + +

+ + +
+ +

Save a device's running configuration.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ filename + + str + +
+

Filename to save running configuration to. Defaults to "startup-config".

+
+
+ 'startup-config' +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ bool + +
+

True if configuration is saved.

+
+
+ +
+ +
+ +
+ + +

+ set_boot_options(image_name, kickstart=None, **vendor_specifics) + +

+ + +
+ +

Set boot variables.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ image_name + + str + +
+

Main system image file.

+
+
+ required +
+ kickstart + + str + +
+

Kickstart filename. Defaults to None.

+
+
+ None +
+ vendor_specifics + + dict + +
+

Vendor specific options.

+
+
+ {} +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NTCFileNotFoundError + +
+

Error if either image_name or kickstart image not found on device.

+
+
+ +
+ +
+ +
+ + +

+ set_timeout(timeout) + +

+ + +
+ +

Set timeout value on device connection.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ timeout + + int + +
+

Timeout value.

+
+
+ required +
+ +
+ +
+ +
+ + +

+ show(command, raw_text=False) + +

+ + +
+ +

Send a non-configuration command.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ command + + str + +
+

The command to send to the device.

+
+
+ required +
+ raw_text + + bool + +
+

Whether to return raw text or structured data. Defaults to False.

+
+
+ False +
+ + +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ CommandError + +
+

Error message stating which command failed.

+
+
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Results of the command ran.

+
+
+ +
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/system_features/__init__.html b/docs/dev/code-reference/pyntc/devices/system_features/__init__.html new file mode 100644 index 00000000..fff8ad54 --- /dev/null +++ b/docs/dev/code-reference/pyntc/devices/system_features/__init__.html @@ -0,0 +1,1001 @@ + + + + + + + + + + + + + + + + + + + + + init - Pyntc Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

+ pyntc.devices.system_features + + +

+ +
+ +

Initialize the system features module.

+ + + + + + + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/system_features/base_feature.html b/docs/dev/code-reference/pyntc/devices/system_features/base_feature.html new file mode 100644 index 00000000..5aa2ee83 --- /dev/null +++ b/docs/dev/code-reference/pyntc/devices/system_features/base_feature.html @@ -0,0 +1,1170 @@ + + + + + + + + + + + + + + + + + + + + + Base feature - Pyntc Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

+ pyntc.devices.system_features.base_feature + + +

+ +
+ +

Define base feature set.

+ + + + + + + + +
+ + + + + + + + +
+ + + +

+ pyntc.devices.system_features.base_feature.BaseFeature + + +

+ + +
+ + +

Base feature sets.

+ + + + + + + + + +
+ + + + + + + + + +
+ + +

+ config(vlan_id, **params) + +

+ + +
+ +

Base config feature.

+ +
+ +
+ +
+ + +

+ get(vlan_id) + +

+ + +
+ +

Base get feature.

+ +
+ +
+ +
+ + +

+ get_all() + +

+ + +
+ +

Base get all features.

+ +
+ +
+ +
+ + +

+ get_list() + +

+ + +
+ +

Base get_list feature.

+ +
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/system_features/vlans/__init__.html b/docs/dev/code-reference/pyntc/devices/system_features/vlans/__init__.html new file mode 100644 index 00000000..c538f88b --- /dev/null +++ b/docs/dev/code-reference/pyntc/devices/system_features/vlans/__init__.html @@ -0,0 +1,1001 @@ + + + + + + + + + + + + + + + + + + + + + init - Pyntc Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

+ pyntc.devices.system_features.vlans + + +

+ +
+ +

Initialize the system features vlans module.

+ + + + + + + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/system_features/vlans/base_vlans.html b/docs/dev/code-reference/pyntc/devices/system_features/vlans/base_vlans.html new file mode 100644 index 00000000..48ea6936 --- /dev/null +++ b/docs/dev/code-reference/pyntc/devices/system_features/vlans/base_vlans.html @@ -0,0 +1,1220 @@ + + + + + + + + + + + + + + + + + + + + + Base vlans - Pyntc Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

+ pyntc.devices.system_features.vlans.base_vlans + + +

+ +
+ +

Base Vlan checks.

+ + + + + + + + +
+ + + + + + + + +
+ + + +

+ pyntc.devices.system_features.vlans.base_vlans.BaseVlans + + +

+ + +
+

+ Bases: BaseFeature

+ + +

Subclass for base vlan feature.

+ + + + + + + + + +
+ + + + + + + + + + + +
+ +
+ +
+ +
+ + + +

+ pyntc.devices.system_features.vlans.base_vlans.VlanNotInRangeError + + +

+ + +
+

+ Bases: NTCError

+ + +

Vlan error.

+ + + + + + + + + +
+ + + + + + + + + +
+ + +

+ __init__(lower, upper) + +

+ + +
+ +

Exception for vlan range validation.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ lower + + int + +
+

lower vlan range.

+
+
+ required +
+ upper + + int + +
+

upper vlan range.

+
+
+ required +
+ +
+ +
+ + + +
+ +
+ +
+ + +
+ + +

+ pyntc.devices.system_features.vlans.base_vlans.vlan_not_in_range_error(vlan_id, lower=1, upper=4094) + +

+ + +
+ +

Validate vlan range.

+ +
+ +
+ + + +
+ +
+ +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/system_features/vlans/eos_vlans.html b/docs/dev/code-reference/pyntc/devices/system_features/vlans/eos_vlans.html new file mode 100644 index 00000000..6326abc6 --- /dev/null +++ b/docs/dev/code-reference/pyntc/devices/system_features/vlans/eos_vlans.html @@ -0,0 +1,1229 @@ + + + + + + + + + + + + + + + + + + + + + Eos vlans - Pyntc Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

+ pyntc.devices.system_features.vlans.eos_vlans + + +

+ +
+ +

System features EOS Vlans.

+ + + + + + + + +
+ + + + + + + + +
+ + + +

+ pyntc.devices.system_features.vlans.eos_vlans.EOSVlans + + +

+ + +
+

+ Bases: BaseVlans

+ + +

EOS Vlan system features.

+ + + + + + + + + +
+ + + + + + + + + +
+ + +

+ __init__(device) + +

+ + +
+ +

EOS Vlan system features.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ device + + str + +
+

Device object.

+
+
+ required +
+ +
+ +
+ +
+ + +

+ get(vlan_id) + +

+ + +
+ +

Get system vlans for EOS.

+ +
+ +
+ +
+ + +

+ get_list() + +

+ + +
+ +

Get a list of vlans for EOS.

+ +
+ +
+ +
+ + +

+ remove(vlan_id) + +

+ + +
+ +

Remove a vlan from EOS device.

+ +
+ +
+ + + +
+ +
+ +
+ + +
+ + +

+ pyntc.devices.system_features.vlans.eos_vlans.instance(device) + +

+ + +
+ +

Instance of a device.

+ +
+ +
+ + + +
+ +
+ +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/tables/__init__.html b/docs/dev/code-reference/pyntc/devices/tables/__init__.html new file mode 100644 index 00000000..d69c8bce --- /dev/null +++ b/docs/dev/code-reference/pyntc/devices/tables/__init__.html @@ -0,0 +1,1001 @@ + + + + + + + + + + + + + + + + + + + + + init - Pyntc Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

+ pyntc.devices.tables + + +

+ +
+ +

Initialization for tables.

+ + + + + + + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/tables/jnpr/__init__.html b/docs/dev/code-reference/pyntc/devices/tables/jnpr/__init__.html new file mode 100644 index 00000000..8dfc1769 --- /dev/null +++ b/docs/dev/code-reference/pyntc/devices/tables/jnpr/__init__.html @@ -0,0 +1,1001 @@ + + + + + + + + + + + + + + + + + + + + + init - Pyntc Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

+ pyntc.devices.tables.jnpr + + +

+ +
+ +

Initialization for Juniper device tables.

+ + + + + + + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/tables/jnpr/loopback.html b/docs/dev/code-reference/pyntc/devices/tables/jnpr/loopback.html new file mode 100644 index 00000000..fb71844b --- /dev/null +++ b/docs/dev/code-reference/pyntc/devices/tables/jnpr/loopback.html @@ -0,0 +1,1001 @@ + + + + + + + + + + + + + + + + + + + + + Loopback - Pyntc Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

+ pyntc.devices.tables.jnpr.loopback + + +

+ +
+ +

Pythonifier for Loopback Table/View.

+ + + + + + + + +
+ + + + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/errors.html b/docs/dev/code-reference/pyntc/errors.html new file mode 100644 index 00000000..bdb37e7f --- /dev/null +++ b/docs/dev/code-reference/pyntc/errors.html @@ -0,0 +1,3561 @@ + + + + + + + + + + + + + + + + + + + + + Errors - Pyntc Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

+ pyntc.errors + + +

+ +
+ +

pyntc custom exceptions.

+ + + + + + + + +
+ + + + + + + + +
+ + + +

+ pyntc.errors.CommandError + + +

+ + +
+

+ Bases: NTCError

+ + +

Error for issuing command on device.

+ + + + + + + + + +
+ + + + + + + + + +
+ + +

+ __init__(command, message) + +

+ + +
+ +

Error for issuing command on device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ command + + str + +
+

The command that failed.

+
+
+ required +
+ message + + str + +
+

The error message returned from the device.

+
+
+ required +
+ +
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ pyntc.errors.CommandListError + + +

+ + +
+

+ Bases: NTCError

+ + +

Error for issuing a command from a list of commands on device..

+ + + + + + + + + +
+ + + + + + + + + +
+ + +

+ __init__(commands, command, message) + +

+ + +
+ +

Error for issuing a command from a list of commands on device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ commands + + list + +
+

The list of commands that were to be sent to the device.

+
+
+ required +
+ command + + str + +
+

The command that reported an error on the device.

+
+
+ required +
+ message + + str + +
+

The error emssage returned from the device.

+
+
+ required +
+ +
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ pyntc.errors.ConfFileNotFoundError + + +

+ + +
+

+ Bases: NTCError

+ + +

Error for issues finding the config filename.

+ + + + + + + + + +
+ + + + + + + + + +
+ + +

+ __init__(filename) + +

+ + +
+ +

Error for issues finding the config filename.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ filename + + str + +
+

The name of the file used for config settings.

+
+
+ required +
+ +
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ pyntc.errors.DeviceNameNotFoundError + + +

+ + +
+

+ Bases: NTCError

+ + +

Error for issues finding name in inventory file, filename.

+ + + + + + + + + +
+ + + + + + + + + +
+ + +

+ __init__(name, filename) + +

+ + +
+ +

Error for issues finding name in inventory file, filename.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ name + + str + +
+

The hostname that failed the lookup.

+
+
+ required +
+ filename + + str + +
+

The name of the file used for inventory.

+
+
+ required +
+ +
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ pyntc.errors.DeviceNotActiveError + + +

+ + +
+

+ Bases: NTCError

+ + +

Error for when the device is part of an HA cluster, and the device is not the active device.

+ + + + + + + + + +
+ + + + + + + + + +
+ + +

+ __init__(hostname, redundancy_state, peer_redundancy_state) + +

+ + +
+ +

Error for when the device is part of an HA cluster, and the device is not the active device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ hostname + + str + +
+

The hostname of the device being validated.

+
+
+ required +
+ redundancy_state + + str + +
+

Current redundancy state.

+
+
+ required +
+ peer_redundancy_state + + str + +
+

Peer State.

+
+
+ required +
+ +
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ pyntc.errors.FeatureNotFoundError + + +

+ + +
+

+ Bases: NTCError

+ + +

Error for trying to use a PyNTC feature for an unsupported device_type.

+ + + + + + + + + +
+ + + + + + + + + +
+ + +

+ __init__(feature, device_type) + +

+ + +
+ +

Error for trying to use a PyNTC feature for an unsupported device_type.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ feature + + str + +
+

The PyNTC feature name.

+
+
+ required +
+ device_type + + str + +
+

The PyNTC device_type name.

+
+
+ required +
+

TODO: Remove this Exception when VLAN feature is removed.

+ +
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ pyntc.errors.FileSystemNotFoundError + + +

+ + +
+

+ Bases: NTCError

+ + +

Error for inability to identify the default file system on network device.

+ + + + + + + + + +
+ + + + + + + + + +
+ + +

+ __init__(hostname, command) + +

+ + +
+ +

Error for inability to identify the default file system on network device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ hostname + + str + +
+

The hostname of the device that failed.

+
+
+ required +
+ command + + str + +
+

The command used to detect the default file system.

+
+
+ required +
+ +
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ pyntc.errors.FileTransferError + + +

+ + +
+

+ Bases: NTCError

+ + +

File Transfer Error.

+ + + + + + + + + +
+ + + + + + + + + +
+ + +

+ __init__(message=None) + +

+ + +
+ +

File Transfer Error.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ message + + str + +
+

Error message to pass. Defaults to None.

+
+
+ None +
+ +
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ pyntc.errors.NTCError + + +

+ + +
+

+ Bases: Exception

+ + +

Generic Error class for PyNTC.

+ + + + + + + + + +
+ + + + + + + + + +
+ + +

+ __init__(message) + +

+ + +
+ +

Generic Error class for PyNTC.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ message + + str + +
+

The error message associated with the Exception.

+
+
+ required +
+ +
+ +
+ +
+ + +

+ __repr__() + +

+ + +
+ +

Representation of NTC error object.

+ +
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ pyntc.errors.NTCFileNotFoundError + + +

+ + +
+

+ Bases: NTCError

+ + +

Error for not being able to find a file on a device.

+ + + + + + + + + +
+ + + + + + + + + +
+ + +

+ __init__(hostname, file, directory) + +

+ + +
+ +

Error for not being able to find a file on a device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ hostname + + str + +
+

The hostname of the device that did not have the file.

+
+
+ required +
+ file + + str + +
+

The name of the file that could not be found.

+
+
+ required +
+ directory + + str + +
+

The directory on the network device where the file was searched for.

+
+
+ required +
+

TODO: Rename dir arg as that is a reserved name in python.

+ +
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ pyntc.errors.NotEnoughFreeSpaceError + + +

+ + +
+

+ Bases: NTCError

+ + +

Error for not having enough free space to transfer a file.

+ + + + + + + + + +
+ + + + + + + + + +
+ + +

+ __init__(hostname, min_space) + +

+ + +
+ +

Error for not having enough free space to transfer a file.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ hostname + + str + +
+

The hostname of the device that did not boot back up.

+
+
+ required +
+ min_space + + str + +
+

The minimum amount of space required to transfer the file.

+
+
+ required +
+ +
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ pyntc.errors.OSInstallError + + +

+ + +
+

+ Bases: NTCError

+ + +

Error for failing to install an OS on a device.

+ + + + + + + + + +
+ + + + + + + + + +
+ + +

+ __init__(hostname, desired_boot) + +

+ + +
+ +

Error for failing to install an OS on a device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ hostname + + str + +
+

The hostname of the device that failed to install OS.

+
+
+ required +
+ desired_boot + + str + +
+

The OS that was attempted to be installed.

+
+
+ required +
+ +
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ pyntc.errors.PeerFailedToFormError + + +

+ + +
+

+ Bases: NTCError

+ + +

Error for failing to have High Availability Peer form after state change.

+ + + + + + + + + +
+ + + + + + + + + +
+ + +

+ __init__(hostname, desired_state, current_state) + +

+ + +
+ +

Error for failing to have High Availability Peer form after state change.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ hostname + + str + +
+

The hostname of the device that did not peer properly.

+
+
+ required +
+ desired_state + + str + +
+

The peer redundancy state that was expected.

+
+
+ required +
+ current_state + + str + +
+

The current peer redundancy state of the device.

+
+
+ required +
+ +
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ pyntc.errors.RebootTimeoutError + + +

+ + +
+

+ Bases: NTCError

+ + +

Error for inability to log into device after waiting for max time for reboot to complete.

+ + + + + + + + + +
+ + + + + + + + + +
+ + +

+ __init__(hostname, wait_time) + +

+ + +
+ +

Error for inability to log into device after waiting for max time for reboot to complete.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ hostname + + str + +
+

The hostname of the device that did not boot back up.

+
+
+ required +
+ wait_time + + int + +
+

The amount of time waiting before considering the reboot failed.

+
+
+ required +
+ +
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ pyntc.errors.SocketClosedError + + +

+ + +
+

+ Bases: NTCError

+ + +

Error for network device closing the socket connection during operation.

+ + + + + + + + + +
+ + + + + + + + + +
+ + +

+ __init__(message=None) + +

+ + +
+ +

Error for network device closing the socket connection during operation.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ message + + str + +
+

A custom error message to use instead of the default.

+
+
+ None +
+ +
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ pyntc.errors.UnsupportedDeviceError + + +

+ + +
+

+ Bases: NTCError

+ + +

Error class for Unsupported Devices.

+ + + + + + + + + +
+ + + + + + + + + +
+ + +

+ __init__(vendor) + +

+ + +
+ +

Error class for Unsupported Devices.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ vendor + + str + +
+

The name of the deice's vendor to present in the error.

+
+
+ required +
+ +
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ pyntc.errors.WLANDisableError + + +

+ + +
+

+ Bases: NTCError

+ + +

Error for not being able to disable WLAN.

+ + + + + + + + + +
+ + + + + + + + + +
+ + +

+ __init__(hostname, desired_wlans, actual_wlans) + +

+ + +
+ +

Error for not being able to disable WLAN.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ hostname + + str + +
+

The hostname of the device that failed to disable all desired_wlans.

+
+
+ required +
+ desired_wlans + + list + +
+

The WLAN IDs that should have been disabled.

+
+
+ required +
+ actual_wlans + + list + +
+

The WLAN IDs that are disabled on the device.

+
+
+ required +
+ +
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ pyntc.errors.WLANEnableError + + +

+ + +
+

+ Bases: NTCError

+ + +

Error for not being able to enable WLAN.

+ + + + + + + + + +
+ + + + + + + + + +
+ + +

+ __init__(hostname, desired_wlans, actual_wlans) + +

+ + +
+ +

Error for not being able to enable WLAN.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ hostname + + str + +
+

The hostname of the device that failed to enable all desired_wlans.

+
+
+ required +
+ desired_wlans + + list + +
+

The WLAN IDs that should have been enabled.

+
+
+ required +
+ actual_wlans + + list + +
+

The WLAN IDs that are enabled on the device.

+
+
+ required +
+ +
+ +
+ + + +
+ +
+ +
+ +
+ + + +

+ pyntc.errors.WaitingRebootTimeoutError + + +

+ + +
+

+ Bases: NTCError

+ + +

Error for device not rebooting after sending install mode upgrade command.

+ + + + + + + + + +
+ + + + + + + + + +
+ + +

+ __init__(hostname, wait_time) + +

+ + +
+ +

Error for device not rebooting after sending install mode upgrade command.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ hostname + + str + +
+

The hostname of the device that did not boot back up.

+
+
+ required +
+ wait_time + + int + +
+

The amount of time waiting before considering the reboot failed.

+
+
+ required +
+ +
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/log.html b/docs/dev/code-reference/pyntc/log.html new file mode 100644 index 00000000..40b700d7 --- /dev/null +++ b/docs/dev/code-reference/pyntc/log.html @@ -0,0 +1,1318 @@ + + + + + + + + + + + + + + + + + + + + + Log - Pyntc Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

+ pyntc.log + + +

+ +
+ +

Logging utilities for Pyntc.

+ + + + + + + + +
+ + + + + + + +
+ + + +

+ pyntc.log.APP = 'pyntc' + + + module-attribute + + +

+ + +
+ +

Application name, used as the logging root.

+
+ +
+ +
+ + + +

+ pyntc.log.DEBUG_FORMAT = '%(asctime)s [%(levelname)s] [%(module)s] [%(funcName)s] %(name)s: %(message)s' + + + module-attribute + + +

+ + +
+ +

Logging format used when debug output is enabled.

+
+ +
+ +
+ + + +

+ pyntc.log.FORMAT = '%(asctime)s [%(levelname)s] %(name)s: %(message)s' + + + module-attribute + + +

+ + +
+ +

Logging format to use.

+
+ +
+ + + +
+ + +

+ pyntc.log.get_log(name=None) + +

+ + +
+ +

Get log namespace and creates logger and rotating file handler.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ name + + str + +
+

Sublogger name. Defaults to None.

+
+
+ None +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ logger + +
+

Return a logger instance in the :data:APP namespace.

+
+
+ +
+ +
+ +
+ + +

+ pyntc.log.init(**kwargs) + +

+ + +
+ +

Initialize logging using sensible defaults.

+

If keyword arguments are passed to this function, they will be passed +directly to the :func:logging.basicConfig call in turn.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ **kwargs + + dict + +
+

Arguments to pass for logging configuration

+
+
+ {} +
+ +
+ +
+ +
+ + +

+ pyntc.log.logger(level) + +

+ + +
+ +

Wrap around logger methods.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ level + + str + +
+

defines the log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)

+
+
+ required +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Returns logger. type of string.

+
+
+ +
+ +
+ + + +
+ +
+ +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/utils/__init__.html b/docs/dev/code-reference/pyntc/utils/__init__.html new file mode 100644 index 00000000..73863be3 --- /dev/null +++ b/docs/dev/code-reference/pyntc/utils/__init__.html @@ -0,0 +1,1486 @@ + + + + + + + + + + + + + + + + + + + + + init - Pyntc Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

+ pyntc.utils + + +

+ +
+ +

PyNTC Utilities.

+ + + + + + + + +
+ + + + + + + + + +
+ + +

+ pyntc.utils.convert_dict_by_key(original, key_map, fill_in=False, whitelist=[], blacklist=[]) + +

+ + +
+ +

Use a key map to convert a dictionary to desired keys.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ original + + dict + +
+

Original dictionary to be converted.

+
+
+ required +
+ key_map + + dict + +
+

Key map to use to convert dictionary.

+
+
+ required +
+ fill_in + + dict + +
+

Whether the returned dictionary should contain +keys and values from the original dictionary if not specified in the key map.

+
+
+ False +
+ whitelist + + list + +
+

If fill_in is True, and whitelist isn't empty, only fill in the keys +in the whitelist in the returned dictionary.

+
+
+ [] +
+ blacklist + + list + +
+

If fill_in is True, and blacklist isn't empty, fill in with all keys from +the original dictionary besides those in the blacklist.

+
+
+ [] +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ dict + +
+

A converted dictionary through the key map.

+
+
+ +
+ +
+ +
+ + +

+ pyntc.utils.convert_list_by_key(original_list, key_map, fill_in=False, whitelist=[], blacklist=[]) + +

+ + +
+ +

Apply a list conversion for all items in original_list.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ original_list + + list + +
+

Original list to be converted.

+
+
+ required +
+ key_map + + dict + +
+

Key map to use to convert list.

+
+
+ required +
+ fill_in + + dict + +
+

Whether the returned list should contain +keys and values from the original dictionary if not specified in the key map.

+
+
+ False +
+ whitelist + + list + +
+

If fill_in is True, and whitelist isn't empty, only fill in the keys +in the whitelist in the returned dictionary.

+
+
+ [] +
+ blacklist + + list + +
+

If fill_in is True, and blacklist isn't empty, fill in with all keys from +the original dictionary besides those in the blacklist.

+
+
+ [] +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list + +
+

A converted list.

+
+
+ +
+ +
+ +
+ + +

+ pyntc.utils.get_structured_data(template_name, rawtxt) + +

+ + +
+ +

Return structured data given raw text using TextFSM templates.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ template_name + + str + +
+

Name of template to use.

+
+
+ required +
+ rawtxt + + str + +
+

Raw output from device.

+
+
+ required +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list + +
+

A dict per entry returned by TextFSM.

+
+
+ +
+ +
+ +
+ + +

+ pyntc.utils.recursive_key_lookup(keys, obj) + +

+ + +
+ +

Lookup nested object by indexing through a dictionary sequentally through keys.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ keys + + list + +
+

The dictionary keys to use to lookup an object.

+
+
+ required +
+ obj + + dict + +
+

The dictionary to traverse.

+
+
+ required +
+ + +
+ Example +
+
+
+

keys = ["a", "b", "c"] +data = {"a": {"b": {"c": 1}}} +recursive_key_lookup(keys, data) +1

+
+
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/utils/converters.html b/docs/dev/code-reference/pyntc/utils/converters.html new file mode 100644 index 00000000..3f1ed151 --- /dev/null +++ b/docs/dev/code-reference/pyntc/utils/converters.html @@ -0,0 +1,1390 @@ + + + + + + + + + + + + + + + + + + + + + Converters - Pyntc Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

+ pyntc.utils.converters + + +

+ +
+ +

Provides methods for manipulating and converting data.

+ + + + + + + + +
+ + + + + + + + + +
+ + +

+ pyntc.utils.converters.convert_dict_by_key(original, key_map, fill_in=False, whitelist=[], blacklist=[]) + +

+ + +
+ +

Use a key map to convert a dictionary to desired keys.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ original + + dict + +
+

Original dictionary to be converted.

+
+
+ required +
+ key_map + + dict + +
+

Key map to use to convert dictionary.

+
+
+ required +
+ fill_in + + dict + +
+

Whether the returned dictionary should contain +keys and values from the original dictionary if not specified in the key map.

+
+
+ False +
+ whitelist + + list + +
+

If fill_in is True, and whitelist isn't empty, only fill in the keys +in the whitelist in the returned dictionary.

+
+
+ [] +
+ blacklist + + list + +
+

If fill_in is True, and blacklist isn't empty, fill in with all keys from +the original dictionary besides those in the blacklist.

+
+
+ [] +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ dict + +
+

A converted dictionary through the key map.

+
+
+ +
+ +
+ +
+ + +

+ pyntc.utils.converters.convert_list_by_key(original_list, key_map, fill_in=False, whitelist=[], blacklist=[]) + +

+ + +
+ +

Apply a list conversion for all items in original_list.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ original_list + + list + +
+

Original list to be converted.

+
+
+ required +
+ key_map + + dict + +
+

Key map to use to convert list.

+
+
+ required +
+ fill_in + + dict + +
+

Whether the returned list should contain +keys and values from the original dictionary if not specified in the key map.

+
+
+ False +
+ whitelist + + list + +
+

If fill_in is True, and whitelist isn't empty, only fill in the keys +in the whitelist in the returned dictionary.

+
+
+ [] +
+ blacklist + + list + +
+

If fill_in is True, and blacklist isn't empty, fill in with all keys from +the original dictionary besides those in the blacklist.

+
+
+ [] +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list + +
+

A converted list.

+
+
+ +
+ +
+ +
+ + +

+ pyntc.utils.converters.recursive_key_lookup(keys, obj) + +

+ + +
+ +

Lookup nested object by indexing through a dictionary sequentally through keys.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ keys + + list + +
+

The dictionary keys to use to lookup an object.

+
+
+ required +
+ obj + + dict + +
+

The dictionary to traverse.

+
+
+ required +
+ + +
+ Example +
+
+
+

keys = ["a", "b", "c"] +data = {"a": {"b": {"c": 1}}} +recursive_key_lookup(keys, data) +1

+
+
+
+
+
+ +
+ + + +
+ +
+ +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/utils/models.html b/docs/dev/code-reference/pyntc/utils/models.html new file mode 100644 index 00000000..778f3c06 --- /dev/null +++ b/docs/dev/code-reference/pyntc/utils/models.html @@ -0,0 +1,1327 @@ + + + + + + + + + + + + + + + + + + + + + Models - Pyntc Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

+ pyntc.utils.models + + +

+ +
+ +

Data Models for Pyntc.

+ + + + + + + + +
+ + + + + + + + +
+ + + +

+ pyntc.utils.models.FileCopyModel + + + + dataclass + + +

+ + +
+ + +

Data class to represent the specification for pulling a file from a URL to a network device.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ download_url + + str + +
+

The URL to download the file from. Can include credentials, but it's recommended to use the username and token fields instead for security reasons.

+
+
+ required +
+ checksum + + str + +
+

The expected checksum of the file.

+
+
+ required +
+ file_name + + str + +
+

The name of the file to be saved on the device.

+
+
+ required +
+ hashing_algorithm + + str + +
+

The hashing algorithm to use for checksum verification. Defaults to "md5".

+
+
+ 'md5' +
+ timeout + + int + +
+

The timeout for the download operation in seconds. Defaults to 900.

+
+
+ 900 +
+ file_size + + int + +
+

The expected size of the file in bytes. Optional but can be used for an additional layer of verification.

+
+
+ None +
+ username + + str + +
+

The username for authentication if required by the URL. Optional if credentials are included in the URL.

+
+
+ None +
+ token + + str + +
+

The password or token for authentication if required by the URL. Optional if credentials are included in the URL.

+
+
+ None +
+ vrf + + str + +
+

The VRF to use for the download if the device supports VRFs. Optional.

+
+
+ None +
+ ftp_passive + + bool + +
+

Whether to use passive mode for FTP downloads. Defaults to True.

+
+
+ True +
+ + + + + + + + + +
+ + + + + + + + + +
+ + +

+ __post_init__() + +

+ + +
+ +

Validate the input and prepare the clean URL after initialization.

+ +
+ +
+ +
+ + +

+ from_dict(data) + + + classmethod + + +

+ + +
+ +

Allows users to just pass a dictionary if they prefer.

+ +
+ +
+ +
+ + +

+ to_dict() + +

+ + +
+ +

Useful for logging or passing to other Nornir tasks.

+ +
+ +
+ + + +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/utils/templates/__init__.html b/docs/dev/code-reference/pyntc/utils/templates/__init__.html new file mode 100644 index 00000000..057e1195 --- /dev/null +++ b/docs/dev/code-reference/pyntc/utils/templates/__init__.html @@ -0,0 +1,1234 @@ + + + + + + + + + + + + + + + + + + + + + init - Pyntc Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + +

+ pyntc.utils.templates + + +

+ +
+ +

Module to use NTC_TEMPLATES.

+ + + + + + + + +
+ + + + + + + + + +
+ + +

+ pyntc.utils.templates.get_structured_data(template_name, rawtxt) + +

+ + +
+ +

Return structured data given raw text using TextFSM templates.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ template_name + + str + +
+

Name of template to use.

+
+
+ required +
+ rawtxt + + str + +
+

Raw output from device.

+
+
+ required +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list + +
+

A dict per entry returned by TextFSM.

+
+
+ +
+ +
+ +
+ + +

+ pyntc.utils.templates.get_template(template_name) + +

+ + +
+ +

Path to the template passed in.

+ + +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
+ template_name + + str + +
+

Name of the template.

+
+
+ required +
+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Path to the template.

+
+
+ +
+ +
+ +
+ + +

+ pyntc.utils.templates.get_template_dir() + +

+ + +
+ +

Get directory of NTC_TEMPLATE os environment.

+ + +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ str + +
+

Path to NTC_TEMPLATES environment variable if set. Otherwise, path to this file.

+
+
+ +
+ +
+ + + +
+ +
+ +
+ + + + + + + + + + + + + +
+
+ + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 3d8a3c19..603b6ad8 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -171,4 +171,5 @@ nav: - pyntc.utils: "code-reference/pyntc/utils/__init__.md" - pyntc.utils.converters: "code-reference/pyntc/utils/converters.md" - pyntc.utils.templates: "code-reference/pyntc/utils/templates/__init__.md" + - pyntc.utils.models: "code-reference/pyntc/utils/models.md" - pyntc.arch_decision: "dev/arch_decision.md" From 35bbfb76112801072a9374a4c856f927834ec0ee Mon Sep 17 00:00:00 2001 From: Jeff Kala Date: Tue, 3 Mar 2026 10:57:30 -0700 Subject: [PATCH 2/3] fix docs test failing after new model adds --- changes/+docs-fixes.housekeeping | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/+docs-fixes.housekeeping diff --git a/changes/+docs-fixes.housekeeping b/changes/+docs-fixes.housekeeping new file mode 100644 index 00000000..4dc90e2a --- /dev/null +++ b/changes/+docs-fixes.housekeeping @@ -0,0 +1 @@ +Fixed docs build and code-reference issues. From 2c4ad759ba2ecf7903e7e105d6e75c71c7dac970 Mon Sep 17 00:00:00 2001 From: Jeff Kala Date: Tue, 3 Mar 2026 11:11:52 -0700 Subject: [PATCH 3/3] remove incorrectly commited html files --- docs/dev/code-reference/pyntc/__init__.html | 1255 ----- .../pyntc/devices/__init__.html | 1001 ---- .../pyntc/devices/aireos_device.html | 4511 ----------------- .../pyntc/devices/asa_device.html | 4142 --------------- .../pyntc/devices/base_device.html | 4217 --------------- .../pyntc/devices/eos_device.html | 3008 ----------- .../pyntc/devices/f5_device.html | 3055 ----------- .../pyntc/devices/ios_device.html | 4269 ---------------- .../pyntc/devices/iosxewlc_device.html | 1315 ----- .../pyntc/devices/jnpr_device.html | 2821 ----------- .../pyntc/devices/nxos_device.html | 3045 ----------- .../devices/system_features/__init__.html | 1001 ---- .../devices/system_features/base_feature.html | 1170 ----- .../system_features/vlans/__init__.html | 1001 ---- .../system_features/vlans/base_vlans.html | 1220 ----- .../system_features/vlans/eos_vlans.html | 1229 ----- .../pyntc/devices/tables/__init__.html | 1001 ---- .../pyntc/devices/tables/jnpr/__init__.html | 1001 ---- .../pyntc/devices/tables/jnpr/loopback.html | 1001 ---- docs/dev/code-reference/pyntc/errors.html | 3561 ------------- docs/dev/code-reference/pyntc/log.html | 1318 ----- .../code-reference/pyntc/utils/__init__.html | 1486 ------ .../pyntc/utils/converters.html | 1390 ----- .../code-reference/pyntc/utils/models.html | 1327 ----- .../pyntc/utils/templates/__init__.html | 1234 ----- 25 files changed, 51579 deletions(-) delete mode 100644 docs/dev/code-reference/pyntc/__init__.html delete mode 100644 docs/dev/code-reference/pyntc/devices/__init__.html delete mode 100644 docs/dev/code-reference/pyntc/devices/aireos_device.html delete mode 100644 docs/dev/code-reference/pyntc/devices/asa_device.html delete mode 100644 docs/dev/code-reference/pyntc/devices/base_device.html delete mode 100644 docs/dev/code-reference/pyntc/devices/eos_device.html delete mode 100644 docs/dev/code-reference/pyntc/devices/f5_device.html delete mode 100644 docs/dev/code-reference/pyntc/devices/ios_device.html delete mode 100644 docs/dev/code-reference/pyntc/devices/iosxewlc_device.html delete mode 100644 docs/dev/code-reference/pyntc/devices/jnpr_device.html delete mode 100644 docs/dev/code-reference/pyntc/devices/nxos_device.html delete mode 100644 docs/dev/code-reference/pyntc/devices/system_features/__init__.html delete mode 100644 docs/dev/code-reference/pyntc/devices/system_features/base_feature.html delete mode 100644 docs/dev/code-reference/pyntc/devices/system_features/vlans/__init__.html delete mode 100644 docs/dev/code-reference/pyntc/devices/system_features/vlans/base_vlans.html delete mode 100644 docs/dev/code-reference/pyntc/devices/system_features/vlans/eos_vlans.html delete mode 100644 docs/dev/code-reference/pyntc/devices/tables/__init__.html delete mode 100644 docs/dev/code-reference/pyntc/devices/tables/jnpr/__init__.html delete mode 100644 docs/dev/code-reference/pyntc/devices/tables/jnpr/loopback.html delete mode 100644 docs/dev/code-reference/pyntc/errors.html delete mode 100644 docs/dev/code-reference/pyntc/log.html delete mode 100644 docs/dev/code-reference/pyntc/utils/__init__.html delete mode 100644 docs/dev/code-reference/pyntc/utils/converters.html delete mode 100644 docs/dev/code-reference/pyntc/utils/models.html delete mode 100644 docs/dev/code-reference/pyntc/utils/templates/__init__.html diff --git a/docs/dev/code-reference/pyntc/__init__.html b/docs/dev/code-reference/pyntc/__init__.html deleted file mode 100644 index 9263f51f..00000000 --- a/docs/dev/code-reference/pyntc/__init__.html +++ /dev/null @@ -1,1255 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - init - Pyntc Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Skip to content - - -
-
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - -

- pyntc - - -

- -
- -

Kickoff functions for getting instance of device objects.

- - - - - - - - -
- - - - - - - - - -
- - -

- pyntc.ntc_device(device_type, *args, **kwargs) - -

- - -
- -

Instantiate an instance of a pyntc.devices.BaseDevice by device_type.

-

The *args and **kwargs are passed directly to the device initializer.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- device_type - - str - -
-

A valid device_type -listed in pyntc.devices.supported_devices

-
-
- required -
- args - - tuple - -
-

Positional arguments to pass to the device initializer.

-
-
- () -
- kwargs - - dict - -
-

Keyword arguments to pass to the device initializer.

-
-
- {} -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- BaseDevice - -
-

An instance of a subclass of pyntc.devices.BaseDevice.

-
-
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- UnsupportedDeviceError - -
-

if the device_type is unsupported.

-
-
- -
- -
- -
- - -

- pyntc.ntc_device_by_name(name, filename=None) - -

- - -
- -

Instantiate an instance of a pyntc.devices.BaseDevice from ntc.conf file.

-

If no filename is given the environment variable PYNTC_CONF is checked -for a path, and then ~/.ntc.conf.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- name - - string - -
-

Name of the device as listed in teh NTC configuration file.

-
-
- required -
- filename - - string - -
-

(Optional) Path to NTC configuration file that includes -the name argument as section header.

-
-
- None -
- - -

Raises:

- - - - - - - - - - - - - - - - - -
TypeDescription
- DeviceNameNotFoundError - -
-

If the name is not found in the NTC configuration file.

-
-
- ConfFileNotFoundError - -
-

If no NTC configuration can be found.

-
-
- -
- -
- - - -
- -
- -
- - - - - - - - - - - - - -
-
- - - - - -
- -
- - - -
-
-
-
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/__init__.html b/docs/dev/code-reference/pyntc/devices/__init__.html deleted file mode 100644 index 91136491..00000000 --- a/docs/dev/code-reference/pyntc/devices/__init__.html +++ /dev/null @@ -1,1001 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - init - Pyntc Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Skip to content - - -
-
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - -

- pyntc.devices - - -

- -
- -

Device drivers.

- - - - - - - - -
- - - - - - - - - - - -
- -
- -
- - - - - - - - - - - - - -
-
- - - - - -
- -
- - - -
-
-
-
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/aireos_device.html b/docs/dev/code-reference/pyntc/devices/aireos_device.html deleted file mode 100644 index 20559114..00000000 --- a/docs/dev/code-reference/pyntc/devices/aireos_device.html +++ /dev/null @@ -1,4511 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - Aireos device - Pyntc Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Skip to content - - -
-
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - -

- pyntc.devices.aireos_device - - -

- -
- -

Module for using a Cisco WLC/AIREOS device over SSH.

- - - - - - - - -
- - - - - - - - -
- - - -

- pyntc.devices.aireos_device.AIREOSDevice - - -

- - -
-

- Bases: BaseDevice

- - -

Cisco AIREOS Device Implementation.

- - - - - - - - - -
- - - - - - - -
- - - -

- ap_boot_options - - - property - - -

- - -
- -

Boot Options for all APs associated with the controller.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- dict - -
-

The name of each AP are the keys, and the values are the primary and backup values.

-
-
- - -
- Example -
-
-
-

device = AIREOSDevice(**connection_args) -device.ap_boot_options -{ - 'ap1': { - 'backup': '8.8.125.0', - 'primary': '8.9.110.0', - 'status': 'complete' - }, - 'ap2': { - 'backup': '8.8.125.0', - 'primary': '8.9.110.0', - 'status': 'complete' - }, -} -

-
-
-
-
- -
- -
- - - -

- ap_image_stats - - - property - - -

- - -
- -

Stats of downloading the the image to all APs.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- dict - -
-

The AP count, and the downloaded, unsupported, and failed APs.

-
-
- - -
- Example -
-
-
-

device = AIREOSDevice(**connection_args) -device.ap_image_stats -{ - 'count': 2, - 'downloaded': 2, - 'unsupported': 0, - 'failed': 0 -} -

-
-
-
-
- -
- -
- - - -

- boot_options - - - property - - -

- - -
- -

Images that are candidates for booting on reload.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- dict - -
-

The boot options on the device. The "sys" key is the expected image on reload.

-
-
- - -
- Example -
-
-
-

device = AIREOSDevice(**connection_args) -device.boot_options -{ - 'backup': '8.8.125.0', - 'primary': '8.9.110.0', - 'sys': '8.9.110.0' -} -

-
-
-
-
- -
- -
- - - -

- connected - - - property - writable - - -

- - -
- -

Get connection status of the device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if the device is connected, else False.

-
-
-
- -
- -
- - - -

- disabled_wlans - - - property - - -

- - -
- -

IDs for all disabled WLANs.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- list - -
-

Disabled WLAN IDs.

-
-
- - -
- Example -
-
-
-

device = AIREOSDevice(**connection_args) -device.wlans -{ - 1: {'profile': 'wlan 1', 'ssid': 'wifi', 'status': 'enabled', 'interface': '1'}, - 2: {'profile': 'wlan 2', 'ssid': 'corp', 'status': 'disabled', 'interface': '1'}, - 3: {'profile': 'wlan 3', 'ssid': 'guest', 'status': 'enabled', 'interface': '1'}, - 4: {'profile': 'wlan 4', 'ssid': 'test', 'status': 'disabled', 'interface': '1'}, - 7: {'profile': 'wlan 7', 'ssid': 'internet', 'status': 'enabled', 'interface': '1'}, - 8: {'profile': 'wlan 8', 'ssid': 'wifi-v', 'status': 'disabled', 'interface': '1'} -} -device.disabled_wlans -[2, 4, 8] -

-
-
-
-
- -
- -
- - - -

- enabled_wlans - - - property - - -

- - -
- -

IDs for all enabled WLANs.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- list - -
-

Enabled WLAN IDs.

-
-
- - -
- Example -
-
-
-

device = AIREOSDevice(**connection_args) -device.wlans -{ - 1: {'profile': 'wlan 1', 'ssid': 'wifi', 'status': 'enabled', 'interface': '1'}, - 2: {'profile': 'wlan 2', 'ssid': 'corp', 'status': 'disabled', 'interface': '1'}, - 3: {'profile': 'wlan 3', 'ssid': 'guest', 'status': 'enabled', 'interface': '1'}, - 4: {'profile': 'wlan 4', 'ssid': 'test', 'status': 'disabled', 'interface': '1'}, - 7: {'profile': 'wlan 7', 'ssid': 'internet', 'status': 'enabled', 'interface': '1'}, - 8: {'profile': 'wlan 8', 'ssid': 'wifi-v', 'status': 'disabled', 'interface': '1'} -} -device.enabled_wlans -[1, 3, 7] -

-
-
-
-
- -
- -
- - - -

- hostname - - - property - - -

- - -
- -

Retrieve hostname from sysinfo.

-
- -
- -
- - - -

- peer_redundancy_state - - - property - - -

- - -
- -

Determine the redundancy state of the peer processor.

- - -

Returns:

- - - - - - - - - - - - - - - - - -
TypeDescription
- str - -
-

The redundancy state of the peer processor.

-
-
- None - -
-

When the processor does not support redundancy.

-
-
- - -
- Example -
-
-
-

device = AIREOSDevice(**connection_args) -device.peer_redundancy_state -'standby hot' -

-
-
-
-
- -
- -
- - - -

- redundancy_mode - - - property - - -

- - -
- -

Get operating redundancy mode of the controller.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

The redundancy mode the device is operating in.

-
-
- - -
- Example -
-
-
-

device = AIREOSDevice(**connection_args) -device.redundancy_mode -'sso enabled' -

-
-
-
-
- -
- -
- - - -

- redundancy_state - - - property - - -

- - -
- -

Determine the redundancy state of the current processor.

- - -

Returns:

- - - - - - - - - - - - - - - - - -
TypeDescription
- str - -
-

The redundancy state of the current processor.

-
-
- None - -
-

When the processor does not support redundancy.

-
-
- - -
- Example -
-
-
-

device = AIREOSDevice(**connection_args) -device.redundancy_state -'active' -

-
-
-
-
- -
- -
- - - -

- running_config - - - property - - -

- - -
- -

Show running config.

- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

Function currently not implemented.

-
-
-
- -
- -
- - - -

- startup_config - - - property - - -

- - -
- -

Get startup config.

- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

Function currently not implemented.

-
-
-
- -
- -
- - - -

- uptime - - - property - - -

- - -
- -

Get uptime of the device in seconds.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- int - -
-

The number of seconds the device has been up.

-
-
- - -
- Example -
-
-
-

device = AIREOSDevice(**connection_args) -device.uptime -109303 -

-
-
-
-
- -
- -
- - - -

- uptime_string - - - property - - -

- - -
- -

Get uptime of the device as a string in the format is dd::hh::mm.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

The uptime of the device.

-
-
- - -
- Example -
-
-
-

device = AIREOSDevice(**connection_args) -device.uptime_string -22:04:39 -

-
-
-
-
- -
- -
- - - -

- wlans - - - property - - -

- - -
- -

All configured WLANs.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- dict - -
-

WLAN IDs mapped to their operational data.

-
-
- - -
- Example -
-
-
-

device = AIREOSDevice(**connection_args) -device.wlans -{ - 1: {'profile': 'wlan 1', 'ssid': 'wifi', 'status': 'enabled', 'interface': '1'}, - 2: {'profile': 'wlan 2', 'ssid': 'corp', 'status': 'disabled', 'interface': '1'}, - 3: {'profile': 'wlan 3', 'ssid': 'guest', 'status': 'enabled', 'interface': '1'}, - 4: {'profile': 'wlan 4', 'ssid': 'test', 'status': 'disabled', 'interface': '1'}, - 7: {'profile': 'wlan 7', 'ssid': 'internet', 'status': 'enabled', 'interface': '1'}, - 8: {'profile': 'wlan 8', 'ssid': 'wifi-v', 'status': 'disabled', 'interface': '1'} -} -

-
-
-
-
- -
- - - -
- - -

- __init__(host, username, password, secret='', port=None, confirm_active=True, **kwargs) - -

- - -
- -

PyNTC Device implementation for Cisco WLC.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- host - - str - -
-

The address of the network device.

-
-
- required -
- username - - str - -
-

The username to authenticate with the device.

-
-
- required -
- password - - str - -
-

The password to authenticate with the device.

-
-
- required -
- secret - - str - -
-

The password to escalate privilege on the device.

-
-
- '' -
- port - - int - -
-

The port to use to establish the connection. Defaults to 22.

-
-
- None -
- confirm_active - - bool - -
-

Determines if device's high availability state should be validated before leaving connection open.

-
-
- True -
- **kwargs - - dict - -
-

Additional keyword arguments for device customization.

-
-
- {} -
- -
- -
- -
- - -

- backup_running_config(filename) - -

- - -
- -

Create backup of running config.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- filename - - str - -
-

Name of backup file.

-
-
- required -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

Function currently not implemented

-
-
- -
- -
- -
- - -

- checkpoint(filename) - -

- - -
- -

Create a checkpoint file of the current config.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- filename - - str - -
-

Saves a checkpoint file with the name provided to the function.

-
-
- required -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

Function currently not implemented

-
-
- -
- -
- -
- - -

- close() - -

- - -
- -

Close the SSH connection to the device.

- -
- -
- -
- - -

- config(command, **netmiko_args) - -

- - -
- -

Send config commands to device.

-

By default, entering and exiting config mode is handled automatically. -To disable entering and exiting config mode, pass enter_config_mode and exit_config_mode in **netmiko_args. -This supports all arguments supported by Netmiko's send_config_set method using netmiko_args. -This will send each command in command until either an Error is caught or all commands have been sent.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- command - - str | list - -
-

The command or commands to send to the device.

-
-
- required -
- **netmiko_args - - dict - -
-

Any argument supported by netmiko.base_connection.BaseConnection.send_config_set.

-
-
- {} -
- - -

Returns:

- - - - - - - - - - - - - - - - - -
TypeDescription
- str - -
-

When command is a str, the config session input and ouput from sending command.

-
-
- list - -
-

When command is a list, the config session input and ouput from sending command.

-
-
- - -

Raises:

- - - - - - - - - - - - - - - - - - - - - -
TypeDescription
- TypeError - -
-

When sending an argument in **netmiko_args that is not supported.

-
-
- CommandError - -
-

When command is a str and its results report an error.

-
-
- CommandListError - -
-

When command is a list and one of the commands reports an error.

-
-
- - -
- Example -
-
-
-

device = AIREOSDevice(**connection_args) -device.config("boot primary") -'(host) config>boot primary\n\n(host) config>' -

-
-
-
-
-
- -
- -
- - -

- confirm_is_active() - -

- - -
- -

Confirm that the device is either standalone or the active device in a high availability cluster.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True when the device is considered active.

-
-
- - -
- Rasies -

DeviceNotActiveError: When the device is not considered the active device.

-
- -
- Example -
-
-
-

device = AIREOSDevice(**connection_args) -device.redundancy_state -'standby hot' -device.confirm_is_active() -raised DeviceNotActiveError: -host1 is not the active device.

-
-
-
-

device state: standby hot -peer state: active

-
-
-
-

device.redundancy_state -'active' -device.confirm_is_active() -True -

-
-
-
-
-
- -
- -
- - -

- disable_wlans(wlan_ids) - -

- - -
- -

Disable all given WLAN IDs.

-

The string all can be passed to disable all WLANs. -Commands are sent to disable WLAN IDs that are not in self.disabled_wlans. -If trying to disable all WLANS, then "all" will be sent, -unless all WLANs in self.wlans are in self.disabled_wlans.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- wlan_ids - - str | list - -
-

List of WLAN IDs or all.

-
-
- required -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- WLANDisableError - -
-

When wlan_ids are not in self.disabled_wlans after configuration.

-
-
- - -
- Example -
-
-
-

device = AIREOSDevice(**connection_args) -device.disabled_wlans -[2, 4, 8] -device.disable_wlans([1]) -device.disabled_wlans -[1, 2, 4, 8] -device.disable_wlans("all") -[1, 2, 3, 4, 7, 8] -

-
-
-
-
-
- -
- -
- - -

- enable() - -

- - -
- -

Ensure device is in enable mode.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- None - -
-

Device prompt is set to enable mode.

-
-
- -
- -
- -
- - -

- enable_wlans(wlan_ids) - -

- - -
- -

Enable all given WLAN IDs.

-

The string all can be passed to enable all WLANs. -Commands are sent to enable WLAN IDs that are not in self.enabled_wlans. -If trying to enable all WLANS, then "all" will be sent, -unless all WLANs in self.wlans are in self.enabled_wlans.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- wlan_ids - - str | list - -
-

List of WLAN IDs or all.

-
-
- required -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- WLANEnableError - -
-

When wlan_ids are not in self.enabled_wlans after configuration.

-
-
- - -
- Example -
-
-
-

device = AIREOSDevice(**connection_args) -device.enabled_wlans -[1, 3, 7] -device.enable_wlans([2]) -device.enabled_wlans -[1, 2, 3, 7] -device.enable_wlans("all") -dev.enabled_wlans -[1, 2, 3, 4, 7, 8] -

-
-
-
-
-
- -
- -
- - -

- facts() - -

- - -
- -

Get facts from device.

- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

Function currently not implemented.

-
-
- -
- -
- -
- - -

- file_copy(username, password, server, filepath, protocol='sftp', filetype='code', read_timeout=1000) - -

- - -
- -

Copy a file from server to Controller.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- username - - str - -
-

The username to authenticate with the server.

-
-
- required -
- password - - str - -
-

The password to authenticate with the server.

-
-
- required -
- server - - str - -
-

The address of the file server.

-
-
- required -
- filepath - - str - -
-

The full path to the file on the server.

-
-
- required -
- protocol - - str - -
-

The transfer protocol to use to transfer the file. Defaults to "sftp".

-
-
- 'sftp' -
- filetype - - str - -
-

The type of file per aireos definitions. Defaults to "code".

-
-
- 'code' -
- read_timeout - - int - -
-

The Netmiko read_timeout to wait for device to complete transfer. Defaults to 1000.

-
-
- 1000 -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True when the file was transferred, False when the file is deemed to already be on the device.

-
-
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- FileTransferError - -
-

When an error is detected in transferring the file.

-
-
- - -
- Example -
-
-
-

device = AIREOSDevice(**connection_args) -device.boot_options -{ - 'backup': '8.8.125.0', - 'primary': '8.9.100.0', - 'sys': '8.9.100.0' -} -device.file_copy("user", "password", "10.1.1.1", "/images/aireos/AIR-CT5500-K9-8-10-105-0.aes") -device.boot_options -{ - 'backup': '8.9.100.0', - 'primary': '8.10.105.0', - 'sys': '8.10.105.0' -} -

-
-
-
-
-
- -
- -
- - -

- file_copy_remote_exists(src, dest=None, **kwargs) - -

- - -
- -

Copy 'src' file to remote device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- src - - str - -
-

The path to the file to be copied to the device.

-
-
- required -
- dest - - str - -
-

The name to use for storing the file on the device. -Defaults to use the name of the src file.

-
-
- None -
- kwargs - - dict - -
-

Any additional arguments supported by Netmiko's file_copy method.

-
-
- {} -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

Function currently not implemented.

-
-
- -
- -
- -
- - -

- install_os(image_name, controller='both', save_config=True, disable_wlans=None, **vendor_specifics) - -

- - -
- -

Install an operating system on the controller.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- image_name - - str - -
-

The version to install on the device.

-
-
- required -
- controller - - str - -
-

The controller(s) to reboot for install (only applies to HA device).

-
-
- 'both' -
- save_config - - bool - -
-

Whether the config should be saved to the device before reboot.

-
-
- True -
- disable_wlans - - str | list - -
-

Which WLANs to disable/enable before/after upgrade. Default is None. -To disable all WLANs, pass "all". To disable select WLANs, pass a list of WLAN IDs.

-
-
- None -
- vendor_specifics - - dict - -
-

Any vendor specific arguments to pass to the install method.

-
-
- {} -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True when the install is successful, False when the version is deemed to already be running.

-
-
- - -

Raises:

- - - - - - - - - - - - - - - - - - - - - - - - - -
TypeDescription
- OSInstallError - -
-

When the device is not booted with the specified image after reload.

-
-
- RebootTimeoutError - -
-

When the device is unreachable longer than the reboot timeout value.

-
-
- WLANDisableError - -
-

When WLANs are not disabled properly before the upgrade.

-
-
- WLANEnableError - -
-

When WLANs are not enabled properly after the upgrade.

-
-
- - -
- Example -
-
-
-

device = AIREOSDevice(**connection_args) -device.boot_options -{ - 'backup': '8.8.125.0', - 'primary': '8.9.100.0', - 'sys': '8.9.100.0' -} -device.file_copy("user", "password", "10.1.1.1", "/images/aireos/AIR-CT5500-K9-8-10-105-0.aes") -device.boot_options -{ - 'backup': '8.9.100.0', - 'primary': '8.10.105.0', - 'sys': '8.10.105.0' -} -device.install_os("8.10.105.0") -

-
-
-
-
-
- -
- -
- - -

- is_active() - -

- - -
- -

Determine if the current processor is the active processor.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if the processor is active or does not support HA, else False.

-
-
- - -
- Example -
-
-
-

device = AIREOSDevice(**connection_args) -device.is_active() -True -

-
-
-
-
-
- -
- -
- - -

- open(confirm_active=True) - -

- - -
- -

Open a connection to the controller.

-

This method will close the connection if confirm_active is True and the device is not active. -Devices that do not have high availibility are considred active.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- confirm_active - - bool - -
-

Determines if device's high availability state should be validated before leaving connection open.

-
-
- True -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- DeviceIsNotActiveError - -
-

When confirm_active is True, and the device high availabilit state is not active.

-
-
- - -
- Example -
-
-
-

device = AIREOSDevice(**connection_args) -device.open() -raised DeviceNotActiveError: -host1 is not the active device.

-
-
-
-

device state: standby hot -peer state: active

-
-
-
-

device.open(confirm_active=False) -device.connected -True -

-
-
-
-
-
- -
- -
- - -

- reboot(wait_for_reload=False, controller='self', save_config=True, **kwargs) - -

- - -
- -

Reload the controller or controller pair.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- wait_for_reload - - bool - -
-

Whether or not reboot method should also run _wait_for_device_reboot(). Defaults to False.

-
-
- False -
- controller - - str - -
-

Which controller(s) to reboot (only applies to HA pairs).

-
-
- 'self' -
- save_config - - bool - -
-

Whether the configuration should be saved before reload.

-
-
- True -
- kwargs - - dict - -
-

Additional arguments that are not used, but are accepted for backwards compatibility.

-
-
- {} -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- ReloadTimeoutError - -
-

When the device is still unreachable after the timeout period.

-
-
- - -
- Example -
-
-
-

device = AIREOSDevice(**connection_args) -device.reboot() -

-
-
-
-
-
- -
- -
- - -

- rollback() - -

- - -
- -

Rollback to stored file config.

- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

Function currently not implemented.

-
-
- -
- -
- -
- - -

- save() - -

- - -
- -

Save the configuration on the device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if the save command did not fail.

-
-
- - -
- Example -
-
-
-

device = AIREOSDevice(**connection_args) -device.save() -

-
-
-
-
-
- -
- -
- - -

- set_boot_options(image_name, **vendor_specifics) - -

- - -
- -

Set the version to boot on the device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- image_name - - str - -
-

The version to boot into on next reload.

-
-
- required -
- **vendor_specifics - - dict - -
-

Additional vendor-specific arguments (unused).

-
-
- {} -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NTCFileNotFoundError - -
-

When the version is not listed in boot_options.

-
-
- - -
- Example -
-
-
-

device = AIREOSDevice(**connection_args) -device.boot_options -{ -'backup': '8.8.125.0', -'primary': '8.9.100.0', -'sys': '8.9.100.0' -} -device.set_boot_options("8.8.125.0") -device.boot_options -{ -'backup': '8.8.125.0', -'primary': '8.9.100.0', -'sys': '8.8.125.0' -}

-
-
-
-
-
- -
- -
- - -

- show(command, expect_string=None, **netmiko_args) - -

- - -
- -

Send an operational command to the device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- command - - str | list - -
-

The commands to send to the device.

-
-
- required -
- expect_string - - str - -
-

The expected prompt after running the command.

-
-
- None -
- **netmiko_args - - dict - -
-

Any argument supported by netmiko.ConnectHandler.send_command.

-
-
- {} -
- - -

Returns:

- - - - - - - - - - - - - - - - - -
TypeDescription
- str - -
-

When command is str, the data returned from the device.

-
-
- list - -
-

When command is list, the data returned from the device for each command.

-
-
- - -

Raises:

- - - - - - - - - - - - - - - - - - - - - -
TypeDescription
- TypeError - -
-

When sending an argument in **netmiko_args that is not supported.

-
-
- CommandError - -
-

When command is str, and the returned data indicates the command failed.

-
-
- CommandListError - -
-

When command is list, and the return data indicates the command failed.

-
-
- - -
- Example -
-
-
-

device = AIREOSDevice(**connection_args) -sysinfo = device._send_command("show sysinfo") -print(sysinfo) -Product Version.....8.2.170.0 -System Up Time......3 days 2 hrs 20 mins 30 sec -... -sysinfo = device._send_command(["show sysinfo"]) -print(sysinfo[0]) -Product Version.....8.2.170.0 -System Up Time......3 days 2 hrs 20 mins 30 sec -... -

-
-
-
-
-
- -
- -
- - -

- transfer_image_to_ap(image) - -

- - -
- -

Transfer image file to all APs connected to the WLC.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- image - - str - -
-

The image that should be sent to the APs.

-
-
- required -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if AP images are transferred or swapped, False otherwise.

-
-
- - -
- Example -
-
-
-

device = AIREOSDevice(**connection_args) -device.ap_boot_options -{ - 'ap1': { - 'backup': '8.8.125.0', - 'primary': '8.9.110.0', - 'status': 'complete' - }, - 'ap2': { - 'backup': '8.8.125.0', - 'primary': '8.9.110.0', - 'status': 'complete' - }, -} -device.transfer_image_to_ap("8.10.1.0") -device.ap_boot_options -{ - 'ap1': { - 'backup': '8.9.110.0', - 'primary': '8.10.1.0', - 'status': 'complete' - }, - 'ap2': { - 'backup': '8.9.110.0', - 'primary': '8.10.1.0', - 'status': 'complete' - }, -} -

-
-
-
-
-
- -
- - - -
- -
- -
- -
- - - -

- pyntc.devices.aireos_device.RebootSignal - - -

- - -
-

- Bases: NTCError

- - -

Handles reboot interrupts.

- - - - - - - - - -
- - - - - - - - - - - -
- -
- -
- - -
- - -

- pyntc.devices.aireos_device.convert_filename_to_version(filename) - -

- - -
- -

Extract the aireos version number from image filename.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- filename - - str - -
-

The name of the file downloaded from Cisco.

-
-
- required -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

The version number.

-
-
- - -
- Example -
-
-
-

version = convert_filename_to_version("AIR-CT5520-K9-8-8-125-0.aes") -print(version) -8.8.125.0 -

-
-
-
-
-
- -
- - - -
- -
- -
- - - - - - - - - - - - - -
-
- - - - - -
- -
- - - -
-
-
-
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/asa_device.html b/docs/dev/code-reference/pyntc/devices/asa_device.html deleted file mode 100644 index 40af3dd3..00000000 --- a/docs/dev/code-reference/pyntc/devices/asa_device.html +++ /dev/null @@ -1,4142 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - Asa device - Pyntc Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Skip to content - - -
-
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - -

- pyntc.devices.asa_device - - -

- -
- -

Module for using a Cisco ASA device over SSH.

- - - - - - - - -
- - - - - - - - -
- - - -

- pyntc.devices.asa_device.ASADevice - - -

- - -
-

- Bases: BaseDevice

- - -

Cisco ASA Device Implementation.

- - - - - - - - - -
- - - - - - - -
- - - -

- boot_options - - - property - - -

- - -
- -

Determine boot image.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- dict - -
-

Key: 'sys' Value: Current boot image.

-
-
-
- -
- -
- - - -

- connected_interface - - - property - - -

- - -
- -

Interface that is assigned an IP Address of self.ip_address.

- - -

Returns:

- - - - - - - - - - - - - -
Name TypeDescription
str - str - -
-

The name of the interfaces associated to self.ip_address.

-
-
- - -
- Example -
-
-
-

dev = ASADevice("10.1.1.1", **connection_args) -dev.connected_interface -'management' -

-
-
-
-
- -
- -
- - - -

- facts - - - property - - -

- - -
- -

Implement this once facts re-factor is done.

-
- -
- -
- - - -

- hostname - - - property - - -

- - -
- -

Get hostname of device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Hostname of device.

-
-
-
- -
- -
- - - -

- interfaces - - - property - - -

- - -
- -

Get list of interfaces on device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- list - -
-

List of interfaces on device.

-
-
-
- -
- -
- - - -

- ip_address - - - property - - -

- - -
- -

IP Address used to establish the connection to the device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- Union[IPv4Address, IPv6Address] - -
-

IPv4Address/IPv6Address: The IP address used by the paramiko connection.

-
-
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- ValueError - -
-

When a valid IP Address is unable to be derived from self.host.

-
-
- - -
- Example -
-
-
-

dev = ASADevice("10.1.1.1", connection_args) -dev.ip_address -IPv4Address('10.1.1.1') -dev = ASADevice("asa_host", connection_args) -dev.ip_address -IPv6Address('fe80::2a0:c9ff:fe03:102') -

-
-
-
-
- -
- -
- - - -

- ip_protocol - - - property - - -

- - -
- -

IP Protocol of the IP Addressed used by the underlying paramiko connection.

- - -

Returns:

- - - - - - - - - - - - - -
Name TypeDescription
str - str - -
-

"ipv4" for IPv4 Addresses and "ipv6" for IPv6 Addresses.

-
-
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- ValueError - -
-

When self.ip_address is unable to derive a valid IP Address.

-
-
- - -
- Example -
-
-
-

dev = ASADevice("10.1.1.1", connection_args) -dev.ip_protocol -'ipv4' -dev = ASADevice("asa_host", connection_args) -dev.ip_protocol -'ipv6' -

-
-
-
-
- -
- -
- - - -

- ipv4_addresses - - - property - - -

- - -
- -

IPv4 addresses of the device's interfaces.

- - -

Returns:

- - - - - - - - - - - - - -
Name TypeDescription
dict - Dict[str, List[IPv4Address]] - -
-

The ipv4 addresses mapped to their interfaces.

-
-
- - -
- Example -
-
-
-

dev = ASADevice(**connection_args) -dev.ipv4_addresses

-
-
-
-
- -
- -
- - - -

- ipv6_addresses - - - property - - -

- - -
- -

IPv6 addresses of the device's interfaces.

- - -

Returns:

- - - - - - - - - - - - - -
Name TypeDescription
dict - Dict[str, List[IPv6Address]] - -
-

The ipv6 addresses mapped to their interfaces.

-
-
- - -
- Example -
-
-
-

dev = ASADevice(**connection_args) -dev.ipv6_addresses

-
-
-
-
- -
- -
- - - -

- model - - - property - - -

- - -
- -

Get the device model.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Device model.

-
-
-
- -
- -
- - - -

- os_version - - - property - - -

- - -
- -

Get os version on device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

OS version on device.

-
-
-
- -
- -
- - - -

- peer_device - - - property - - -

- - -
- -

Create instance of ASADevice for peer device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- ASADevice - -
-

class~devices.ASADevice: Cisco ASA device instance.

-
-
-
- -
- -
- - - -

- peer_ip_address - - - property - - -

- - -
- -

IP Address associated with self.ip_address on the peer device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- Union[IPv4Address, IPv6Address] - -
-

IPv4Address/IPv6Address: The IP address used by the paramiko connection.

-
-
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- ValueError - -
-

When a valid IP Address is unable to be derived from self.host.

-
-
- - -
- Example -
-
-
-

dev = ASADevice("10.1.1.1", connection_args) -dev.peer_ip_address -IPv4Address('10.1.1.2') -dev = ASADevice("asa_host", connection_args) -dev.peer_ip_address -IPv6Address('fe80::2a0:c9ff:fe03:103') -

-
-
-
-
- -
- -
- - - -

- peer_ipv4_addresses - - - property - - -

- - -
- -

IPv4 addresses of the peer device's interfaces.

- - -

Returns:

- - - - - - - - - - - - - -
Name TypeDescription
dict - Dict[str, List[IPv4Address]] - -
-

The ipv4 addresses mapped to their interfaces.

-
-
- - -
- Example -
-
-
-

dev = ASADevice(**connection_args) -dev.peer_ipv4_addresses

-
-
-
-
- -
- -
- - - -

- peer_ipv6_addresses - - - property - - -

- - -
- -

IPv6 addresses of the peer device's interfaces.

- - -

Returns:

- - - - - - - - - - - - - -
Name TypeDescription
dict - Dict[str, List[IPv6Address]] - -
-

The ipv6 addresses mapped to their interfaces.

-
-
- - -
- Example -
-
-
-

dev = ASADevice(**connection_args) -dev.peer_ipv6_addresses

-
-
-
-
- -
- -
- - - -

- peer_redundancy_state - - - property - - -

- - -
- -

Determine the current redundancy state of the peer processor.

-

In the case of multi-context configurations, a peer will be considered -active if it is the active device for any context. Otherwise, the most -common state will be returned.

- - -

Returns:

- - - - - - - - - - - - - - - - - -
TypeDescription
- str - -
-

The redundancy state of the peer processor.

-
-
- None - -
-

When the processor does not support redundancy.

-
-
- - -
- Example -
-
-
-

device = ASADevice(**connection_args) -device.peer_redundancy_state -'standby ready' -

-
-
-
-
- -
- -
- - - -

- redundancy_mode - - - property - - -

- - -
- -

Operating redundancy mode of the device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

The redundancy mode the device is operating in. -If the command is not supported, then "n/a" is returned.

-
-
- - -
- Example -
-
-
-

device = ASADevice(**connection_args) -device.redundancy_mode -'on' -

-
-
-
-
- -
- -
- - - -

- redundancy_state - - - property - - -

- - -
- -

Determine the current redundancy state of the processor.

-

In the case of multi-context configurations, a device will be considered -active if it is the active device for any context. Otherwise, the most -common state will be returned.

- - -

Returns:

- - - - - - - - - - - - - - - - - -
TypeDescription
- str - -
-

The redundancy state of the processor.

-
-
- None - -
-

When the processor does not support redundancy.

-
-
- - -
- Example -
-
-
-

device = ASADevice(**connection_args) -device.redundancy_state -'active' -

-
-
-
-
- -
- -
- - - -

- running_config - - - property - - -

- - -
- -

Get current running config on device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Running configuration on device.

-
-
-
- -
- -
- - - -

- serial_number - - - property - - -

- - -
- -

Get serial number of device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Serial number of device.

-
-
-
- -
- -
- - - -

- startup_config - - - property - - -

- - -
- -

Show startup config.

-

:return: Output of command 'show startup-config'.

-
- -
- -
- - - -

- uptime - - - property - - -

- - -
- -

Get uptime from device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- int - -
-

Uptime in seconds.

-
-
-
- -
- -
- - - -

- uptime_string - - - property - - -

- - -
- -

Get uptime in format dd:hh:mm.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Uptime of device.

-
-
-
- -
- -
- - - -

- vlans - - - property - - -

- - -
- -

Get vlan ids from device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- list - -
-

List of vlans

-
-
-
- -
- - - -
- - -

- __init__(host, username, password, secret='', port=None, **kwargs) - -

- - -
- -

Pyntc Device constructor for Cisco ASA.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- host - - str - -
-

The address of the network device.

-
-
- required -
- username - - str - -
-

The username to authenticate to the device.

-
-
- required -
- password - - str - -
-

The password to authenticate to the device.

-
-
- required -
- secret - - str - -
-

The password to escalate privilege on the device. Defaults to 22.

-
-
- '' -
- port - - int - -
-

Port used to establish connection. Defaults to 22.

-
-
- None -
- kwargs - - dict - -
-

Additional keyword arguments to pass to the Netmiko connection handler.

-
-
- {} -
- -
- -
- -
- - -

- backup_running_config(filename) - -

- - -
- -

Backups running config.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- filename - - str - -
-

Name of backup file.

-
-
- required -
- -
- -
- -
- - -

- checkpoint(checkpoint_file) - -

- - -
- -

Create a checkpoint file of the current config.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- checkpoint_file - - str - -
-

Saves a checkpoint file with the name provided to the function.

-
-
- required -
- -
- -
- -
- - -

- close() - -

- - -
- -

Disconnect from device.

- -
- -
- -
- - -

- config(command) - -

- - -
- -

Send configuration commands to a device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- command - - (str, list) - -
-

String with single command, or list with multiple commands.

-
-
- required -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- CommandListError - -
-

Message stating which command failed and the response from the device.

-
-
- -
- -
- -
- - -

- enable() - -

- - -
- -

Ensure device is in enable mode.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- None - -
-

Device prompt is set to enable mode.

-
-
- -
- -
- -
- - -

- enable_scp() - -

- - -
- -

Enable SCP on device by configuring "ssh scopy enable".

-

The command is ran on the active device; if the device is -currently standby, then a new connection is created to the -active device. The configuration is saved after to sync to peer.

- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- FileTransferError - -
-

When unable to configure scopy on the active device.

-
-
- - -
- Example -
-
-
-

device = ASADevice(**connection_args) -device.show("show run ssh | i scopy") -'' -device.enable_scp() -device.show("show run ssh | i scopy") -'ssh scopy enable' -

-
-
-
-
-
- -
- -
- - -

- file_copy(src, dest=None, file_system=None, peer=False) - -

- - -
- -

Copy src file to device.

-

The src file can be copied to both the device and its peer by -setting peer to True. If transferring to the peer device, the -transfer will use the address associated with the peer_interface -from "show failover" output.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- src - - str - -
-

The path to the file to be copied to the device.

-
-
- required -
- dest - - str - -
-

The name to use for storing the file on the device. -Default is to use the name of the src file.

-
-
- None -
- file_system - - str - -
-

The directory to store the file on the device. -Default will use _get_file_system() to determine the default file_system.

-
-
- None -
- peer - - bool - -
-

Whether to transfer the src file to the peer device.

-
-
- False -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- FileTransferError - -
-

When the src file is unable to transfer the file to any device.

-
-
- - -
- Example -
-
-
-

dev = ASADevice(**connection_args) -dev.file_copy("path/to/asa-image.bin", peer=True)

-
-
-
-
-
- -
- -
- - -

- file_copy_remote_exists(src, dest=None, file_system=None) - -

- - -
- -

Copy src file to device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- src - - str - -
-

The path to the file to be copied to the device.

-
-
- required -
- dest - - str - -
-

The name to use for storing the file on the device. -Defaults to use the name of the src file..

-
-
- None -
- file_system - - str - -
-

The directory name to store files on the device. -Defaults to discover the default directory of the device.

-
-
- None -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if the file exists on the device and the md5 hashes match. Otherwise, false.

-
-
-

Example:

-
-
-
-

status = file_copy_remote_exists("path/to/asa-image.bin") -print(status) -True -

-
-
-
- -
- -
- -
- - -

- install_os(image_name, **vendor_specifics) - -

- - -
- -

Install OS on device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- image_name - - str - -
-

Name of the image to be installed.

-
-
- required -
- vendor_specifics - - dict - -
-

Vendor specific arguments to pass to the install process.

-
-
- {} -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- OSInstallError - -
-

Message stating the end device could not boot into the new image.

-
-
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if new image is installed correctly. False if device is already running image_name.

-
-
- -
- -
- -
- - -

- is_active() - -

- - -
- -

Determine if the current processor is the active processor.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if the processor is active or does not support HA, else False.

-
-
- - -
- Example -
-
-
-

device = ASADevice(**connection_args) -device.is_active() -True -

-
-
-
-
-
- -
- -
- - -

- open() - -

- - -
- -

Attempt to find device prompt. If not found, create Connecthandler object to device.

- -
- -
- -
- - -

- reboot(wait_for_reload=False, **kwargs) - -

- - -
- -

Reload the controller or controller pair.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- wait_for_reload - - bool - -
-

Whether or not reboot method should also run _wait_for_device_reboot(). Defaults to False.

-
-
- False -
- kwargs - - dict - -
-

Additional arguments to pass to the reboot method.

-
-
- {} -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- RebootTimeoutError - -
-

When the device is still unreachable after the timeout period.

-
-
- - -
- Example -
-
-
-

device = ASADevice(**connection_args) -device.reboot() -

-
-
-
-
-
- -
- -
- - -

- reboot_standby(acceptable_states=None, timeout=None) - -

- - -
- -

Reload the standby device from the active device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- acceptable_states - - iter - -
-

List of acceptable redundancy states for the peer device after reboot. -Default will use the current value of peer_redundancy_state.

-
-
- None -
- timeout - - int - -
-

The maximum time to wait for the device to boot back into an acceptable_state.

-
-
- None -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- RebootTimeoutError - -
-

When timeout is reached before the peer reaches a state in acceptable_states.

-
-
- - -
- Example -
-
-
-

dev = ASADevice(**connection_args) -dev.peer_redundancy_state -'standby ready' -dev.reboot_standby() -RebootTimeoutError... -dev.peer_redundancy_state -'cold standby' -dev.reboot_standby(acceptbale_states=["standby ready", "cold standby"]) -dev.peer_redundancy_state -'cold standby' -

-
-
-
-
-
- -
- -
- - -

- rollback(rollback_to) - -

- - -
- -

Rollback the device configuration.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- rollback_to - - str - -
-

Name of checkpoint file to rollback to

-
-
- required -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

Function not implemented yet.

-
-
- -
- -
- -
- - -

- save(filename='startup-config') - -

- - -
- -

Save changes to startup config.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- filename - - str - -
-

Name of startup configuration file. Defaults to "startup-config".

-
-
- 'startup-config' -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if configuration saved succesfully.

-
-
- -
- -
- -
- - -

- set_boot_options(image_name, **vendor_specifics) - -

- - -
- -

Set new image as boot option on device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- image_name - - str - -
-

AName of image.

-
-
- required -
- vendor_specifics - - dict - -
-

Vendor specific arguments to pass to the set_boot_options process.

-
-
- {} -
- - -

Raises:

- - - - - - - - - - - - - - - - - -
TypeDescription
- NTCFileNotFoundError - -
-

File not found on device.

-
-
- CommandError - -
-

Unable to issue command on device.

-
-
- -
- -
- -
- - -

- show(command, expect_string=None) - -

- - -
- -

Send command to device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- command - - str - -
-

Command to be ran on device.

-
-
- required -
- expect_string - - str - -
-

Expected response from running command on device. Defaults to None.

-
-
- None -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Output from running command on device.

-
-
- -
- -
- - - -
- -
- -
- -
- - - -

- pyntc.devices.asa_device.RebootSignal - - -

- - -
-

- Bases: NTCError

- - -

Not implemented.

- - - - - - - - - -
- - - - - - - - - - - -
- -
- -
- - - - -
- -
- -
- - - - - - - - - - - - - -
-
- - - - - -
- -
- - - -
-
-
-
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/base_device.html b/docs/dev/code-reference/pyntc/devices/base_device.html deleted file mode 100644 index 176e8612..00000000 --- a/docs/dev/code-reference/pyntc/devices/base_device.html +++ /dev/null @@ -1,4217 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - Base device - Pyntc Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Skip to content - - -
-
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - -

- pyntc.devices.base_device - - -

- -
- -

The module contains the base class that all device classes must inherit from.

- - - - - - - - -
- - - - - - - - -
- - - -

- pyntc.devices.base_device.BaseDevice - - -

- - -
- - -

Base Device ABC.

- - - - - - - - - -
- - - - - - - -
- - - -

- boot_options - - - property - - -

- - -
- -

Get current boot variables.

-

like system image and kickstart image.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- dict - -
-

A dictionary, e.g. {'kick': router_kick.img, 'sys': 'router_sys.img'}

-
-
-
- -
- -
- - - -

- fqdn - - - property - - -

- - -
- -

Get FQDN of the device.

- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

returns not implemented if not included in facts.

-
-
-
- -
- -
- - - -

- hostname - - - property - - -

- - -
- -

Host name string property, part of device facts.

- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

returns not implemented if not included in facts.

-
-
-
- -
- -
- - - -

- interfaces - - - property - - -

- - -
- -

Interfaces list of strings property, part of device facts.

- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

returns not implemented if not included in facts.

-
-
-
- -
- -
- - - -

- model - - - property - - -

- - -
- -

Model string property, part of device facts.

- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

returns not implemented if not included in facts.

-
-
-
- -
- -
- - - -

- os_version - - - property - - -

- - -
- -

Operating System string property, part of device facts.

- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

returns not implemented if not included in facts.

-
-
-
- -
- -
- - - -

- running_config - - - property - - -

- - -
- -

Return the running configuration of the device.

-
- -
- -
- - - -

- serial_number - - - property - - -

- - -
- -

Get serial number of the device.

- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

returns not implemented if not included in facts.

-
-
-
- -
- -
- - - -

- startup_config - - - property - - -

- - -
- -

Return the startup configuration of the device.

-
- -
- -
- - - -

- uptime - - - property - - -

- - -
- -

Uptime integer property, part of device facts.

- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

returns not implemented if not included in facts.

-
-
-
- -
- -
- - - -

- uptime_string - - - property - - -

- - -
- -

Uptime string string property, part of device facts.

- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

returns not implemented if not included in facts.

-
-
-
- -
- -
- - - -

- vlans - - - property - - -

- - -
- -

Vlans lost of strings property, part of device facts.

- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

returns not implemented if not included in facts.

-
-
-
- -
- - - -
- - -

- __init__(host, username, password, device_type=None, **kwargs) - -

- - -
- -

PyNTC base device implementation.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- host - - str - -
-

The address of the network device.

-
-
- required -
- username - - str - -
-

The username to authenticate with the device.

-
-
- required -
- password - - str - -
-

The password to authenticate with the device.

-
-
- required -
- device_type - - str - -
-

Denotes which device type. Defaults to None.

-
-
- None -
- kwargs - - dict - -
-

Additional keyword arguments that may be used by subclasses.

-
-
- {} -
- -
- -
- -
- - -

- backup_running_config(filename) - -

- - -
- -

Save a local copy of the running config.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- filename - - str - -
-

The local file path on which to save the running config.

-
-
- required -
- -
- -
- -
- - -

- check_file_exists(filename, **kwargs) - -

- - -
- -

Check if a remote file exists by filename.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- filename - - str - -
-

The name of the file to check for on the remote device.

-
-
- required -
- kwargs - - dict - -
-

Additional keyword arguments that may be used by subclasses.

-
-
- {} -
- - -

Other Parameters:

- - - - - - - - - - - - - - - -
NameTypeDescription
file_system - str - -
-

Supported only for IOS and NXOS. The file system for the -remote file. If no file_system is provided, then the get_file_system -method is used to determine the correct file system to use.

-
-
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if the remote file exists, False if it doesn't.

-
-
- -
- -
- -
- - -

- checkpoint(filename) - -

- - -
- -

Save a checkpoint of the running configuration to the device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- filename - - str - -
-

The filename to save the checkpoint as on the remote device.

-
-
- required -
- -
- -
- -
- - -

- close() - -

- - -
- -

Close the connection to the device.

- -
- -
- -
- - -

- compare_file_checksum(checksum, filename, hashing_algorithm='md5', **kwargs) - -

- - -
- -

Compare the checksum of a local file with a remote file.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- checksum - - str - -
-

The checksum of the file.

-
-
- required -
- filename - - str - -
-

The name of the file to check for on the remote device.

-
-
- required -
- hashing_algorithm - - str - -
-

The hashing algorithm to use (default: "md5").

-
-
- 'md5' -
- kwargs - - dict - -
-

Additional keyword arguments that may be used by subclasses.

-
-
- {} -
- - -

Other Parameters:

- - - - - - - - - - - - - - - -
NameTypeDescription
file_system - str - -
-

Supported only for IOS and NXOS. The file system for the -remote file. If no file_system is provided, then the get_file_system -method is used to determine the correct file system to use.

-
-
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if the checksums match, False otherwise.

-
-
- -
- -
- -
- - -

- config(command) - -

- - -
- -

Send a configuration command.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- command - - str - -
-

The command to send to the device.

-
-
- required -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- CommandError - -
-

If there is a problem with the supplied command.

-
-
- -
- -
- -
- - -

- facts() - -

- - -
- -

DEPRECATED - Use individual properties to get facts.

- -
- -
- -
- - -

- feature(feature_name) - -

- - -
- -

Return a feature class based on the feature_name for the appropriate subclassed device type.

- -
- -
- -
- - -

- file_copy(src, dest=None, **kwargs) - -

- - -
- -

Send a local file to the device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- src - - str - -
-

Path to the local file to send.

-
-
- required -
- dest - - str - -
-

The destination file path to be saved on remote flash. -If none is supplied, the implementing class should use the basename -of the source path.

-
-
- None -
- kwargs - - dict - -
-

Additional keyword arguments that may be used by subclasses.

-
-
- {} -
- - -

Other Parameters:

- - - - - - - - - - - - - - - -
NameTypeDescription
file_system - str - -
-

Supported only for IOS and NXOS. The file system for the -remote file. If no file_system is provided, then the get_file_system -method is used to determine the correct file system to use.

-
-
- -
- -
- -
- - -

- file_copy_remote_exists(src, dest=None, **kwargs) - -

- - -
- -

Check if a remote file exists.

-

A remote file exists if it has the same name as supplied dest, -and the same md5 hash as the source.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- src - - str - -
-

Path to local file to check.

-
-
- required -
- dest - - str - -
-

The destination file path to be saved on remote the remote device. -If none is supplied, the implementing class should use the basename -of the source path.

-
-
- None -
- kwargs - - dict - -
-

Additional keyword arguments that may be used by subclasses.

-
-
- {} -
- - -

Other Parameters:

- - - - - - - - - - - - - - - -
NameTypeDescription
file_system - str - -
-

Supported only for IOS and NXOS. The file system for the -remote file. If no file_system is provided, then the get_file_system -method is used to determine the correct file system to use.

-
-
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if the remote file exists, False if it doesn't.

-
-
- -
- -
- -
- - -

- get_boot_options() - -

- - -
- -

Get current boot variables like system image and kickstart image.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- dict - -
-

A dictionary, e.g. {'kick': router_kick.img, 'sys': 'router_sys.img'}

-
-
- -
- -
- -
- - -

- get_local_checksum(filepath, hashing_algorithm='md5', add_newline=False) - - - staticmethod - - -

- - -
- -

Get the checksum of a local file using a specified algorithm.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- filepath - - str - -
-

The path to the local file.

-
-
- required -
- hashing_algorithm - - str - -
-

The hashing algorithm to use (e.g., "md5", "sha256").

-
-
- 'md5' -
- add_newline - - bool - -
-

Whether to append a newline before final hashing (Some devices may require this).

-
-
- False -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

The hex digest of the file.

-
-
- -
- -
- -
- - -

- get_remote_checksum(filename, hashing_algorithm='md5', **kwargs) - -

- - -
- -

Get the checksum of a remote file.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- filename - - str - -
-

The name of the file to check for on the remote device.

-
-
- required -
- hashing_algorithm - - str - -
-

The hashing algorithm to use (default: "md5").

-
-
- 'md5' -
- kwargs - - dict - -
-

Additional keyword arguments that may be used by subclasses.

-
-
- {} -
- - -

Other Parameters:

- - - - - - - - - - - - - - - -
NameTypeDescription
file_system - str - -
-

Supported only for IOS and NXOS. The file system for the -remote file. If no file_system is provided, then the get_file_system -method is used to determine the correct file system to use.

-
-
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

The checksum of the remote file.

-
-
- -
- -
- -
- - -

- install_os(image_name, **vendor_specifics) - -

- - -
- -

Install the OS from specified image_name.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- image_name - - str - -
-

The name of the image on the device to install.

-
-
- required -
- - -

Other Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
kickstart - str - -
-

Option for NXOSDevice for devices that require a kickstart image.

-
-
volume - str - -
-

Option for F5Device to set the target boot volume.

-
-
file_system - str - -
-

Option for ASADevice, EOSDevice, IOSDevice, and -NXOSDevice to set where the OS files are stored. The default will use -the _get_file_system method.

-
-
timeout - int - -
-

Option for IOSDevice and NXOSDevice to set the wait time for -device installation to complete.

-
-
vendor_specifics - kwargs - -
-

Additional keyword arguments that may be used by subclasses.

-
-
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if system has been installed during function's call, False if OS has not been installed

-
-
- - -

Raises:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeDescription
- OSInstallError - -
-

When device finishes installation process, but the running image -does not match image_name.

-
-
- CommandError - -
-

When sending a command to the device fails, or when the config status -after sending a command does not yield expected results.

-
-
- CommandListError - -
-

When sending commands to the device fails.

-
-
- NotEnoughFreeSpaceError - -
-

When the device does not have enough free space for install.

-
-
- NTCFileNotFoundError - -
-

When the image_name is not found in the devices file_system.

-
-
- FileSystemNotFoundError - -
-

When the file_system is left to default, -and the file_system cannot be identified.

-
-
- RebootTimeoutError - -
-

When device is rebooted and is unreachable longer than timeout period.

-
-
- -
- -
- -
- - -

- open() - -

- - -
- -

Open a connection to the device.

- -
- -
- -
- - -

- reboot(wait_for_reload=False) - -

- - -
- -

Reload a device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- wait_for_reload - - bool - -
-

Whether or not reboot method should also run _wait_for_device_reboot(). Defaults to False.

-
-
- False -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- RebootTimeoutError - -
-

When the device is still unreachable after the timeout period.

-
-
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

description

-
-
- -
- -
- -
- - -

- refresh() - -

- - -
- -

Refresh caches on device instance.

- -
- -
- -
- - -

- refresh_facts() - -

- - -
- -

Refresh cached facts.

- -
- -
- -
- - -

- remote_file_copy(src=None, dest=None, **kwargs) - -

- - -
- -

Copy a file to a remote device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- src - - FileCopyModel - -
-

The source file model.

-
-
- None -
- dest - - str - -
-

The destination file path on the remote device.

-
-
- None -
- kwargs - - dict - -
-

Additional keyword arguments that may be used by subclasses.

-
-
- {} -
- - -

Other Parameters:

- - - - - - - - - - - - - - - -
NameTypeDescription
file_system - str - -
-

Supported only for IOS and NXOS. The file system for the -remote file. If no file_system is provided, then the get_file_system -method is used to determine the correct file system to use.

-
-
- -
- -
- -
- - -

- rollback(checkpoint_file) - -

- - -
- -

Rollback to a checkpoint file.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- checkpoint_file - - str - -
-

The filename of the checkpoint file to load into the running configuration.

-
-
- required -
- -
- -
- -
- - -

- save(filename=None) - -

- - -
- -

Save a device's running configuration.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- filename - - str - -
-

The filename on the remote device. -If none is supplied, the implementing class should -save to the "startup configuration".

-
-
- None -
- -
- -
- -
- - -

- set_boot_options(image_name, **vendor_specifics) - -

- - -
- -

Set boot variables like system image and kickstart image.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- image_name - - str - -
-

The main system image file name.

-
-
- required -
- - -

Other Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
kickstart - str - -
-

Option for NXOSDevice for devices that require a kickstart image.

-
-
volume - str - -
-

Option for F5Device to set which volume should have image installed.

-
-
file_system - str - -
-

Option for ASADevice and IOSDevice to set which directory -to use when setting the boot path. The default will use the directory returned -by the _get_file_system() method.

-
-
vendor_specifics - kwargs - -
-

Additional keyword arguments that may be used by subclasses.

-
-
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- ValueError - -
-

When the boot options returned by the boot_options -method does not match the image_name after the config command(s) -have been sent to the device.

-
-
- -
- -
- -
- - -

- show(command, raw_text=False) - -

- - -
- -

Send a non-configuration command.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- command - - str - -
-

The command to send to the device.

-
-
- required -
- - -

Other Parameters:

- - - - - - - - - - - - - - - -
NameTypeDescription
raw_text - bool - -
-

Whether to return raw text or structured data.

-
-
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

The output of the show command, which could be raw text or structured data.

-
-
- -
- -
- -
- - -

- verify_file(checksum, filename, hashing_algorithm='md5', **kwargs) - -

- - -
- -

Verify a file on the remote device by confirming the file exists and validate the checksum.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- checksum - - str - -
-

The checksum of the file.

-
-
- required -
- filename - - str - -
-

The name of the file to check for on the remote device.

-
-
- required -
- hashing_algorithm - - str - -
-

The hashing algorithm to use (default: "md5").

-
-
- 'md5' -
- kwargs - - dict - -
-

Additional keyword arguments that may be used by subclasses.

-
-
- {} -
- - -

Other Parameters:

- - - - - - - - - - - - - - - -
NameTypeDescription
file_system - str - -
-

Supported only for IOS and NXOS. The file system for the -remote file. If no file_system is provided, then the get_file_system -method is used to determine the correct file system to use.

-
-
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if the file is verified successfully, False otherwise.

-
-
- -
- -
- - - -
- -
- -
- -
- - - -

- pyntc.devices.base_device.RebootTimerError - - -

- - -
-

- Bases: NTCError

- - -

Reboot timer error class to notify user reboot timer is not supported.

- - - - - - - - - -
- - - - - - - - - -
- - -

- __init__(device_type) - -

- - -
- -

Error to notify user reboot timer is not supported.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- device_type - - str - -
-

Ex: cisco_nxos_nxapi, cisco_ios_ssh

-
-
- required -
- -
- -
- - - -
- -
- -
- -
- - - -

- pyntc.devices.base_device.RollbackError - - -

- - -
-

- Bases: NTCError

- - -

Rollback error.

- - - - - - - - - -
- - - - - - - - - - - -
- -
- -
- -
- - - -

- pyntc.devices.base_device.SetBootImageError - - -

- - -
-

- Bases: NTCError

- - -

Set boot image error.

- - - - - - - - - -
- - - - - - - - - - - -
- -
- -
- - -
- - -

- pyntc.devices.base_device.fix_docs(cls) - -

- - -
- -

Create docstring at runtime.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- class - -
-

Returns the class passed in.

-
-
- -
- -
- - - -
- -
- -
- - - - - - - - - - - - - -
-
- - - - - -
- -
- - - -
-
-
-
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/eos_device.html b/docs/dev/code-reference/pyntc/devices/eos_device.html deleted file mode 100644 index c3840b52..00000000 --- a/docs/dev/code-reference/pyntc/devices/eos_device.html +++ /dev/null @@ -1,3008 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - Eos device - Pyntc Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Skip to content - - -
-
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - -

- pyntc.devices.eos_device - - -

- -
- -

Module for using an Arista EOS device over the eAPI.

- - - - - - - - -
- - - - - - - - -
- - - -

- pyntc.devices.eos_device.EOSDevice - - -

- - -
-

- Bases: BaseDevice

- - -

Arista EOS Device Implementation.

- - - - - - - - - -
- - - - - - - -
- - - -

- boot_options - - - property - - -

- - -
- -

Get current running software.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- dict - -
-

Key is sys with value being the image on the device.

-
-
-
- -
- -
- - - -

- fqdn - - - property - - -

- - -
- -

Get fully-qualified domain name of device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Fully-qualified domain name of device.

-
-
-
- -
- -
- - - -

- hostname - - - property - - -

- - -
- -

Get hostname from device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Hostname of the device.

-
-
-
- -
- -
- - - -

- interfaces - - - property - - -

- - -
- -

Get list of interfaces on device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- list - -
-

List of interfaces

-
-
-
- -
- -
- - - -

- model - - - property - - -

- - -
- -

Get model of device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Model of device.

-
-
-
- -
- -
- - - -

- os_version - - - property - - -

- - -
- -

Get OS version on device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

OS version of device.

-
-
-
- -
- -
- - - -

- running_config - - - property - - -

- - -
- -

Return running config.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Running configuration.

-
-
-
- -
- -
- - - -

- serial_number - - - property - - -

- - -
- -

Get serial number of device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Serial number of device.

-
-
-
- -
- -
- - - -

- startup_config - - - property - - -

- - -
- -

Get startup configuration.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Startup configuration.

-
-
-
- -
- -
- - - -

- uptime - - - property - - -

- - -
- -

Get uptime of the device in seconds.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- int - -
-

Uptime of the device.

-
-
-
- -
- -
- - - -

- uptime_string - - - property - - -

- - -
- -

Get uptime of the device in the format of dd::hh::mm.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Uptime in string format.

-
-
-
- -
- -
- - - -

- vlans - - - property - - -

- - -
- -

Get list of VLANS on device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- list - -
-

List of VLANS on device.

-
-
-
- -
- - - -
- - -

- __init__(host, username, password, transport='http', port=None, timeout=None, **kwargs) - -

- - -
- -

PyNTC Device implementation for Arista EOS.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- host - - str - -
-

The address of the network device.

-
-
- required -
- username - - str - -
-

The username to authenticate with the device.

-
-
- required -
- password - - str - -
-

The password to authenticate with the device.

-
-
- required -
- transport - - str - -
-

The protocol to communicate with the device. Defaults to http.

-
-
- 'http' -
- port - - int - -
-

The port to use to establish the connection. Defaults to None.

-
-
- None -
- timeout - - int - -
-

Timeout value used for connection with the device. Defaults to None.

-
-
- None -
- kwargs - - dict - -
-

Additional keyword arguments.

-
-
- {} -
- -
- -
- -
- - -

- backup_running_config(filename) - -

- - -
- -

Create backup file of running configuration.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- filename - - str - -
-

The name of the file that will be saved.

-
-
- required -
- -
- -
- -
- - -

- checkpoint(checkpoint_file) - -

- - -
- -

Copy running config checkpoint.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- checkpoint_file - - str - -
-

Checkpoint file name.

-
-
- required -
- -
- -
- -
- - -

- close() - -

- - -
- -

Not implemented. Just passes.

- -
- -
- -
- - -

- config(commands) - -

- - -
- -

Send configuration commands to a device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- commands - - (str, list) - -
-

String with single command, or list with multiple commands.

-
-
- required -
- - -

Raises:

- - - - - - - - - - - - - - - - - -
TypeDescription
- CommandError - -
-

Issue with the command provided.

-
-
- CommandListError - -
-

Issue with a command in the list provided.

-
-
- -
- -
- -
- - -

- enable() - -

- - -
- -

Ensure device is in enable mode.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- None - -
-

Device prompt is set to enable mode.

-
-
- -
- -
- -
- - -

- file_copy(src, dest=None, file_system=None) - -

- - -
- -

Copy file to device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- src - - string - -
-

source file

-
-
- required -
- dest - - string - -
-

Destintion file. Defaults to None.

-
-
- None -
- file_system - - string - -
-

Describes device file system. Defaults to None.

-
-
- None -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- FileTransferError - -
-

raise exception if there is an error

-
-
- -
- -
- -
- - -

- file_copy_remote_exists(src, dest=None, file_system=None) - -

- - -
- -

Copy file to remote device if it exists.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- src - - str - -
-

source file

-
-
- required -
- dest - - str - -
-

Destintion file. Defaults to None.

-
-
- None -
- file_system - - str - -
-

Describes device file system. Defaults to None.

-
-
- None -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if remote file exists.

-
-
- -
- -
- -
- - -

- install_os(image_name, **vendor_specifics) - -

- - -
- -

Install new OS on device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- image_name - - str - -
-

Name of the image name to be installed.

-
-
- required -
- vendor_specifics - - dict - -
-

Vendor specific options for installing OS, such as timeout.

-
-
- {} -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- OSInstallError - -
-

Error in installing new OS.

-
-
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if device OS is succesfully installed.

-
-
- -
- -
- -
- - -

- open() - -

- - -
- -

Open ssh connection with Netmiko ConnectHandler to be used with FileTransfer.

- -
- -
- -
- - -

- reboot(wait_for_reload=False, **kwargs) - -

- - -
- -

Reload the controller or controller pair.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- wait_for_reload - - bool - -
-

Whether or not reboot method should also run _wait_for_device_reboot(). Defaults to False.

-
-
- False -
- kwargs - - dict - -
-

Additional keyword arguments, such as confirm.

-
-
- {} -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- RebootTimeoutError - -
-

When the device is still unreachable after the timeout period.

-
-
- - -
- Example -
-
-
-

device = EOSDevice(**connection_args) -device.reboot() -

-
-
-
-
-
- -
- -
- - -

- rollback(rollback_to) - -

- - -
- -

Rollback device configuration.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- rollback_to - - str - -
-

Name of file to revert configuration to.

-
-
- required -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- RollbackError - -
-

When rollback is unsuccessful.

-
-
- -
- -
- -
- - -

- save(filename='startup-config') - -

- - -
- -

Show running configuration.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Running configuration.

-
-
- -
- -
- -
- - -

- set_boot_options(image_name, **vendor_specifics) - -

- - -
- -

Set boot option to specified image.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- image_name - - str - -
-

Name of the image file.

-
-
- required -
- vendor_specifics - - dict - -
-

Vendor specific options, such as file_system.

-
-
- {} -
- - -

Raises:

- - - - - - - - - - - - - - - - - -
TypeDescription
- NTCFileNotFoundError - -
-

File not found on device.

-
-
- CommandError - -
-

Error in trying to set image as boot option.

-
-
- -
- -
- -
- - -

- show(commands, raw_text=False) - -

- - -
- -

Send configuration commands to a device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- commands - - (str, list) - -
-

String with single command, or list with multiple commands.

-
-
- required -
- raw_text - - bool - -
-

False if encode should be json, True if encoding is text. Defaults to False.

-
-
- False -
- - -

Raises:

- - - - - - - - - - - - - - - - - -
TypeDescription
- CommandError - -
-

Issue with the command provided.

-
-
- CommandListError - -
-

Issue with a command in the list provided.

-
-
- -
- -
- - - -
- -
- -
- -
- - - -

- pyntc.devices.eos_device.RebootSignal - - -

- - -
-

- Bases: NTCError

- - -

Error for sending reboot signal.

- - - - - - - - - -
- - - - - - - - - - - -
- -
- -
- - - - -
- -
- -
- - - - - - - - - - - - - -
-
- - - - - -
- -
- - - -
-
-
-
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/f5_device.html b/docs/dev/code-reference/pyntc/devices/f5_device.html deleted file mode 100644 index daa29bad..00000000 --- a/docs/dev/code-reference/pyntc/devices/f5_device.html +++ /dev/null @@ -1,3055 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - F5 device - Pyntc Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Skip to content - - -
-
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - -

- pyntc.devices.f5_device - - -

- -
- -

Module for using an F5 TMOS device over the REST / SOAP.

- - - - - - - - -
- - - - - - - - -
- - - -

- pyntc.devices.f5_device.F5Device - - -

- - -
-

- Bases: BaseDevice

- - -

F5 LTM Device Implementation.

- - - - - - - - - -
- - - - - - - -
- - - -

- boot_options - - - property - - -

- - -
- -

Get active volume.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- dict - -
-

Key is active volume with value being the current active volume.

-
-
-
- -
- -
- - - -

- fqdn - - - property - - -

- - -
- -

Get fully-qualified domain name.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Fully qualified domain name.

-
-
-
- -
- -
- - - -

- hostname - - - property - - -

- - -
- -

Get hostname of device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Hostname.

-
-
-
- -
- -
- - - -

- interfaces - - - property - - -

- - -
- -

Get list of images on the device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- list - -
-

List of images.

-
-
-
- -
- -
- - - -

- model - - - property - - -

- - -
- -

Get model of device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Model of device.

-
-
-
- -
- -
- - - -

- os_version - - - property - - -

- - -
- -

Get version of device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Version on device.

-
-
-
- -
- -
- - - -

- serial_number - - - property - - -

- - -
- -

Get serial number of device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Serial number of device.

-
-
-
- -
- -
- - - -

- uptime - - - property - - -

- - -
- -

Get uptime of device in seconds.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- float - -
-

Uptime of device.

-
-
-
- -
- -
- - - -

- uptime_string - - - property - - -

- - -
- -

Get uptime of device in format dd:hh:mm:ss.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Uptime of device.

-
-
-
- -
- -
- - - -

- vlans - - - property - - -

- - -
- -

Get list of vlans on device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- list - -
-

List of vlans.

-
-
-
- -
- - - -
- - -

- __init__(host, username, password, **kwargs) - -

- - -
- -

PyNTC implementation for F5 device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- host - - str - -
-

The address of the network device.

-
-
- required -
- username - - str - -
-

The username to authenticate with the device.

-
-
- required -
- password - - str - -
-

The password to authenticate with the device.

-
-
- required -
- kwargs - - dict - -
-

Additional keyword arguments.

-
-
- {} -
- -
- -
- -
- - -

- backup_running_config(filename) - -

- - -
- -

Backup running configuration.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- filename - - str - -
-

Name of file to save running config to.

-
-
- required -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

Function currently not implemeneted.

-
-
- -
- -
- -
- - -

- checkpoint(filename) - -

- - -
- -

Create checkpoint configuration file.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- filename - - str - -
-

Name of file to save running config to.

-
-
- required -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

Function currently not implemeneted.

-
-
- -
- -
- -
- - -

- close() - -

- - -
- -

Implement pass.

- -
- -
- -
- - -

- config(command) - -

- - -
- -

Send command to device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- command - - str - -
-

Command.

-
-
- required -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

Function currently not implemented.

-
-
- -
- -
- -
- - -

- file_copy(src, dest=None, **kwargs) - -

- - -
- -

Copy file to device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- src - - str - -
-

Source of file.

-
-
- required -
- dest - - str - -
-

Destination to save file. Defaults to None.

-
-
- None -
- kwargs - - dict - -
-

Additional keyword arguments.

-
-
- {} -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- FileTransferError - -
-

Error in verifying if file existed before transfer.

-
-
- -
- -
- -
- - -

- file_copy_remote_exists(src, dest=None, **kwargs) - -

- - -
- -

Copy file to device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- src - - str - -
-

Source of file.

-
-
- required -
- dest - - str - -
-

Destination to save file. Defaults to None.

-
-
- None -
- kwargs - - dict - -
-

Additional keyword arguments.

-
-
- {} -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

Destination must be /shared/images.

-
-
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if image specified exists on device. Otherwise, false.

-
-
- -
- -
- -
- - -

- image_installed(image_name, volume) - -

- - -
- -

Check if image is installed on specified volume.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- image_name - - str - -
-

Name of image.

-
-
- required -
- volume - - str - -
-

Volume to look for image on.

-
-
- required -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- RuntimeError - -
-

Either image name or volume were not specified.

-
-
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if file exists on volume. Otherwise, false.

-
-
- -
- -
- -
- - -

- install_os(image_name, **vendor_specifics) - -

- - -
- -

Install OS on device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- image_name - - str - -
-

Image name.

-
-
- required -
- vendor_specifics - - dict - -
-

Vendor specific arguments.

-
-
- {} -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NTCFileNotFoundError - -
-

Error is image is not found on device.

-
-
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if image is installed successfully. Otherwise, false.

-
-
- -
- -
- -
- - -

- open() - -

- - -
- -

Implement pass.

- -
- -
- -
- - -

- reboot(wait_for_reload=False, volume=None, **kwargs) - -

- - -
- -

Reload the controller or controller pair.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- volume - - str - -
-

Active volume to reboot. Defaults to None.

-
-
- None -
- wait_for_reload - - bool - -
-

Whether or not reboot method should also run _wait_for_device_reboot(). Defaults to False.

-
-
- False -
- kwargs - - dict - -
-

Additional keyword arguments.

-
-
- {} -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- RuntimeError - -
-

If device is unreachable after timeout period, raise an error.

-
-
- - -
- Example -
-
-
-

device = F5Device(**connection_args) -device.reboot() -

-
-
-
-
-
- -
- -
- - -

- rollback(checkpoint_file) - -

- - -
- -

Rollback to checkpoint configuration file.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- checkpoint_file - - str - -
-

Name of checkpoint file.

-
-
- required -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

Function currently not implemented.

-
-
- -
- -
- -
- - -

- running_config() - -

- - -
- -

Get running configuration.

- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

Function currently not implemented.

-
-
- -
- -
- -
- - -

- save(filename=None) - -

- - -
- -

Save running configuration.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- filename - - str - -
-

Name of file to save running configuration to. Defaults to None.

-
-
- None -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

Function currently not implemented.

-
-
- -
- -
- -
- - -

- set_boot_options(image_name, **vendor_specifics) - -

- - -
- -

Set boot option on device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- image_name - - str - -
-

Name of image.

-
-
- required -
- vendor_specifics - - dict - -
-

Vendor specific arguments.

-
-
- {} -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NTCFileNotFoundError - -
-

Error if file is not found on device.

-
-
- -
- -
- -
- - -

- show(command, raw_text=False) - -

- - -
- -

Run cli command on device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- command - - str - -
-

Command to be ran.

-
-
- required -
- raw_text - - bool - -
-

Specifies if you want raw text. Defaults to False.

-
-
- False -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

[description]

-
-
- -
- -
- -
- - -

- startup_config() - -

- - -
- -

Get startup configuration.

- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

Function currently not implemented.

-
-
- -
- -
- - - -
- -
- -
- - - - -
- -
- -
- - - - - - - - - - - - - -
-
- - - - - -
- -
- - - -
-
-
-
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/ios_device.html b/docs/dev/code-reference/pyntc/devices/ios_device.html deleted file mode 100644 index 11231202..00000000 --- a/docs/dev/code-reference/pyntc/devices/ios_device.html +++ /dev/null @@ -1,4269 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - Ios device - Pyntc Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Skip to content - - -
-
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - -

- pyntc.devices.ios_device - - -

- -
- -

Module for using a Cisco IOS device over SSH.

- - - - - - - - -
- - - - - - - - -
- - - -

- pyntc.devices.ios_device.IOSDevice - - -

- - -
-

- Bases: BaseDevice

- - -

Cisco IOS Device Implementation.

- - - - - - - - - -
- - - - - - - -
- - - -

- boot_options - - - property - - -

- - -
- -

Get current boot image.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- dict - -
-

Key sys with value being the current boot image.

-
-
-
- -
- -
- - - -

- config_register - - - property - - -

- - -
- -

Get config register of device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Config register.

-
-
-
- -
- -
- - - -

- connected - - - property - writable - - -

- - -
- -

Get connection status of the device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if the device is connected, else False.

-
-
-
- -
- -
- - - -

- fqdn - - - property - - -

- - -
- -

Get fully qualified domain name.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Fully qualified domain name or N/A if not defined.

-
-
-
- -
- -
- - - -

- hostname - - - property - - -

- - -
- -

Get hostname of device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Hostname of device.

-
-
-
- -
- -
- - - -

- interfaces - - - property - - -

- - -
- -

Get list of interfaces on device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- list - -
-

List of interfaces on device.

-
-
-
- -
- -
- - - -

- model - - - property - - -

- - -
- -

Get the device model.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Device model.

-
-
-
- -
- -
- - - -

- os_version - - - property - - -

- - -
- -

Get os version on device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

OS version on device.

-
-
-
- -
- -
- - - -

- peer_redundancy_state - - - property - - -

- - -
- -

Determine the current redundancy state of the peer processor.

- - -

Returns:

- - - - - - - - - - - - - - - - - -
TypeDescription
- str - -
-

The redundancy state of the peer processor.

-
-
- None - -
-

When the processor does not support redundancy.

-
-
- - -
- Example -
-
-
-

device = IOSDevice(**connection_args) -device.peer_redundancy_state -'standby hot' -

-
-
-
-
- -
- -
- - - -

- redundancy_mode - - - property - - -

- - -
- -

Get operating redundancy mode of the device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

The redundancy mode the device is operating in. -If the command is not supported, then "n/a" is returned.

-
-
- - -
- Example -
-
-
-

device = IOSDevice(**connection_args) -device.redundancy_mode -'stateful switchover' -

-
-
-
-
- -
- -
- - - -

- redundancy_state - - - property - - -

- - -
- -

Determine the current redundancy state of the processor.

- - -

Returns:

- - - - - - - - - - - - - - - - - -
TypeDescription
- str - -
-

The redundancy state of the current processor.

-
-
- None - -
-

When the processor does not support redundancy.

-
-
- - -
- Example -
-
-
-

device = IOSDevice(**connection_args) -device.redundancy_state -'active' -

-
-
-
-
- -
- -
- - - -

- running_config - - - property - - -

- - -
- -

Get running configuration.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Output of show running-config.

-
-
-
- -
- -
- - - -

- serial_number - - - property - - -

- - -
- -

Get serial number of device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Serial number of device.

-
-
-
- -
- -
- - - -

- startup_config - - - property - - -

- - -
- -

Get startup configuration.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Startup configuration from device.

-
-
-
- -
- -
- - - -

- uptime - - - property - - -

- - -
- -

Get uptime from device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- int - -
-

Uptime in seconds.

-
-
-
- -
- -
- - - -

- uptime_string - - - property - - -

- - -
- -

Get uptime in format dd:hh:mm.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Uptime of device.

-
-
-
- -
- -
- - - -

- vlans - - - property - - -

- - -
- -

Get list of VLANs on device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- list - -
-

List of VLANs on device.

-
-
-
- -
- - - -
- - -

- __init__(host, username, password, secret='', port=None, confirm_active=True, **kwargs) - -

- - -
- -

PyNTC Device implementation for Cisco IOS.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- host - - str - -
-

The address of the network device.

-
-
- required -
- username - - str - -
-

The username to authenticate with the device.

-
-
- required -
- password - - str - -
-

The password to authenticate with the device.

-
-
- required -
- secret - - str - -
-

The password to escalate privilege on the device.

-
-
- '' -
- port - - int - -
-

The port to use to establish the connection. Defaults to 22.

-
-
- None -
- confirm_active - - bool - -
-

Determines if device's high availability state should be validated before leaving connection open.

-
-
- True -
- kwargs - - dict - -
-

Additional arguments to pass to the Netmiko ConnectHandler.

-
-
- {} -
- -
- -
- -
- - -

- backup_running_config(filename) - -

- - -
- -

Backup running configuration to filename specified.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- filename - - str - -
-

Filename to save running configuration to.

-
-
- required -
- -
- -
- -
- - -

- check_file_exists(filename, file_system=None) - -

- - -
- -

Check if a remote file exists by filename.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- filename - - str - -
-

The name of the file to check for on the remote device.

-
-
- required -
- file_system - - str - -
-

Supported only for IOS and NXOS. The file system for the -remote file. If no file_system is provided, then the get_file_system -method is used to determine the correct file system to use.

-
-
- None -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if the remote file exists, False if it doesn't.

-
-
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- CommandError - -
-

If there is an error in executing the command to check if the file exists.

-
-
- -
- -
- -
- - -

- checkpoint(checkpoint_file) - -

- - -
- -

Create checkpoint file.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- checkpoint_file - - str - -
-

Name of checkpoint file.

-
-
- required -
- -
- -
- -
- - -

- close() - -

- - -
- -

Disconnect from device.

- -
- -
- -
- - -

- config(command, **netmiko_args) - -

- - -
- -

Send config commands to device.

-

By default, entering and exiting config mode is handled automatically. -To disable entering and exiting config mode, pass enter_config_mode and exit_config_mode in **netmiko_args. -This supports all arguments supported by Netmiko's send_config_set method using netmiko_args. -This will send each command in command until either an Error is caught or all commands have been sent.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- command - - str | list - -
-

The command or commands to send to the device.

-
-
- required -
- **netmiko_args - - dict - -
-

Any argument supported by netmiko.ConnectHandler.send_config_set.

-
-
- {} -
- - -

Returns:

- - - - - - - - - - - - - - - - - -
TypeDescription
- str - -
-

When command is a str, the config session input and output from sending command.

-
-
- list - -
-

When command is a list, the config session input and output from sending command.

-
-
- - -

Raises:

- - - - - - - - - - - - - - - - - - - - - -
TypeDescription
- TypeError - -
-

When sending an argument in **netmiko_args that is not supported.

-
-
- CommandError - -
-

When command is a str and its results report an error.

-
-
- CommandListError - -
-

When command is a list and one of the commands reports an error.

-
-
- - -
- Example -
-
-
-

device = IOSDevice(**connection_args) -device.config("no service pad") -'configure terminal\nEnter configuration commands, one per line. End with CNTL/Z.\n' -'host(config)#no service pad\nhost(config)#end\nhost#' -device.config(["interface Gig0/1", "description x-connect"]) -['host(config)#interface Gig0/1\nhost(config-if)#, 'description x-connect\nhost(config-if)#'] -

-
-
-
-
-
- -
- -
- - -

- confirm_is_active() - -

- - -
- -

Confirm that the device is either standalone or the active device in a high availability cluster.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True when the device is considered active.

-
-
- - -
- Rasies -

DeviceNotActiveError: When the device is not considered the active device.

-
- -
- Example -
-
-
-

device = IOSDevice(**connection_args) -device.redundancy_state -'standby hot' -device.confirm_is_active() -raised DeviceNotActiveError: -host1 is not the active device.

-
-
-
-

device state: standby hot -peer state: active

-
-
-
-

device.redundancy_state -'active' -device.confirm_is_active() -True -

-
-
-
-
-
- -
- -
- - -

- enable() - -

- - -
- -

Ensure device is in enable mode.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- None - -
-

Device prompt is set to enable mode.

-
-
- -
- -
- -
- - -

- file_copy(src, dest=None, file_system=None) - -

- - -
- -

Copy file to device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- src - - str - -
-

Source of file.

-
-
- required -
- dest - - str - -
-

Destination name for file. Defaults to None.

-
-
- None -
- file_system - - str - -
-

File system to copy file to. Defaults to None.

-
-
- None -
- - -

Raises:

- - - - - - - - - - - - - - - - - - - - - -
TypeDescription
- SocketClosedError - -
-

Error raised if connection to device is closed.

-
-
- FileTransferError - -
-

Error in transferring file.

-
-
- FileTransferError - -
-

Error if unable to verify file was transferred successfully.

-
-
- -
- -
- -
- - -

- file_copy_remote_exists(src, dest=None, file_system=None) - -

- - -
- -

Check if file exists on remote device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- src - - str - -
-

Source of file.

-
-
- required -
- dest - - str - -
-

Destination name for file. Defaults to None.

-
-
- None -
- file_system - - str - -
-

File system to copy file to. Defaults to None.

-
-
- None -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if file copied succesfully and md5 hashes match. Otherwise, false.

-
-
- -
- -
- -
- - -

- get_remote_checksum(filename, hashing_algorithm='md5', file_system=None) - -

- - -
- -

Get the checksum of a remote file.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- filename - - str - -
-

The name of the file to check for on the remote device.

-
-
- required -
- hashing_algorithm - - str - -
-

The hashing algorithm to use. Valid choices are "md5" and "sha512" (default: "md5").

-
-
- 'md5' -
- file_system - - str - -
-

Supported only for IOS and NXOS. The file system for the -remote file. If no file_system is provided, then the get_file_system -method is used to determine the correct file system to use.

-
-
- None -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

The checksum of the remote file.

-
-
- - -

Raises:

- - - - - - - - - - - - - - - - - -
TypeDescription
- ValueError - -
-

If an unsupported hashing algorithm is provided.

-
-
- CommandError - -
-

If there is an error in executing the command to get the remote checksum.

-
-
- -
- -
- -
- - -

- install_os(image_name, install_mode=False, read_timeout=2000, **vendor_specifics) - -

- - -
- -

Installs the prescribed Network OS, which must be present before issuing this command.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- image_name - - str - -
-

Name of the IOS image to boot into

-
-
- required -
- install_mode - - bool - -
-

Uses newer install method on devices. Defaults to False.

-
-
- False -
- read_timeout - - int - -
-

Netmiko timeout when waiting for device prompt. Default 30.

-
-
- 2000 -
- vendor_specifics - - dict - -
-

Vendor specific arguments to pass to the install command.

-
-
- {} -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- OSInstallError - -
-

Unable to install OS Error type

-
-
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

False if no install is needed, true if the install completes successfully

-
-
- -
- -
- -
- - -

- is_active() - -

- - -
- -

Determine if the current processor is the active processor.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if the processor is active or does not support HA, else False.

-
-
- - -
- Example -
-
-
-

device = IOSDevice(**connection_args) -device.is_active() -True -

-
-
-
-
-
- -
- -
- - -

- open(confirm_active=True) - -

- - -
- -

Open a connection to the network device.

-

This method will close the connection if confirm_active is True and the device is not active. -Devices that do not have high availability are considered active.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- confirm_active - - bool - -
-

Determines if device's high availability state should be validated before leaving connection open.

-
-
- True -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- DeviceNotActiveError - -
-

When confirm_active is True, and the device high availability state is not active.

-
-
- - -
- Example -
-
-
-

device = IOSDevice(**connection_args) -device.open() -raised DeviceNotActiveError: -host1 is not the active device.

-
-
-
-

device state: standby hot -peer state: active

-
-
-
-

device.open(confirm_active=False) -device.connected -True -

-
-
-
-
-
- -
- -
- - -

- reboot(wait_for_reload=False, **kwargs) - -

- - -
- -

Reboot device.

-

Reload the controller or controller pair.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- wait_for_reload - - bool - -
-

Whether or not reboot method should also run _wait_for_device_reboot(). Defaults to False.

-
-
- False -
- kwargs - - dict - -
-

Additional arguments to pass to the Netmiko.

-
-
- {} -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- ReloadTimeoutError - -
-

When the device is still unreachable after the timeout period.

-
-
- -
- -
- -
- - -

- remote_file_copy(src, dest=None, file_system=None, **kwargs) - -

- - -
- -

Copy a file to a remote device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- src - - FileCopyModel - -
-

The source file model.

-
-
- required -
- dest - - str - -
-

The destination file path on the remote device.

-
-
- None -
- kwargs - - dict - -
-

Additional keyword arguments that may be used by subclasses.

-
-
- {} -
- - -

Other Parameters:

- - - - - - - - - - - - - - - -
NameTypeDescription
file_system - str - -
-

Supported only for IOS and NXOS. The file system for the -remote file. If no file_system is provided, then the get_file_system -method is used to determine the correct file system to use.

-
-
- - -

Raises:

- - - - - - - - - - - - - - - - - -
TypeDescription
- TypeError - -
-

If src is not an instance of FileCopyModel.

-
-
- FileTransferError - -
-

If there is an error during file transfer or if the file cannot be verified after transfer.

-
-
- -
- -
- -
- - -

- rollback(rollback_to) - -

- - -
- -

Rollback configuration to file on flash.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- rollback_to - - sEtr - -
-

Name of the file to rollback to.

-
-
- required -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- RollbackError - -
-

Error if unable to rollback to configuration.

-
-
- -
- -
- -
- - -

- save(filename='startup-config') - -

- - -
- -

Save running configuration.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- filename - - str - -
-

Name of file to save running configuration. Defaults to "startup-config".

-
-
- 'startup-config' -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if save is succesfull.

-
-
- -
- -
- -
- - -

- set_boot_options(image_name, **vendor_specifics) - -

- - -
- -

Set specified image as boot image.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- image_name - - str - -
-

Name of image to set as boot variable.

-
-
- required -
- vendor_specifics - - dict - -
-

Vendor specific arguments to pass to the set_boot_options command.

-
-
- {} -
- - -

Raises:

- - - - - - - - - - - - - - - - - -
TypeDescription
- NTCFileNotFoundError - -
-

Error if file is not found on device.

-
-
- CommandError - -
-

Error if setting new image as boot variable fails.

-
-
- -
- -
- -
- - -

- show(command, expect_string=None, **netmiko_args) - -

- - -
- -

Run command on device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- command - - str - -
-

Command to be ran.

-
-
- required -
- expect_string - - str - -
-

Expected string from command output. Defaults to None.

-
-
- None -
- netmiko_args - - dict - -
-

Additional arguments to pass to Netmiko's send_command method.

-
-
- {} -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Output of command.

-
-
- -
- -
- -
- - -

- verify_file(checksum, filename, hashing_algorithm='md5', file_system=None) - -

- - -
- -

Verify a file on the remote device by and validate the checksums.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- checksum - - str - -
-

The checksum of the file.

-
-
- required -
- filename - - str - -
-

The name of the file to check for on the remote device.

-
-
- required -
- hashing_algorithm - - str - -
-

The hashing algorithm to use (default: "md5").

-
-
- 'md5' -
- file_system - - str - -
-

Supported only for IOS and NXOS. The file system for the -remote file. If no file_system is provided, then the get_file_system -method is used to determine the correct file system to use.

-
-
- None -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if the file is verified successfully, False otherwise.

-
-
- -
- -
- - - -
- -
- -
- -
- - - -

- pyntc.devices.ios_device.RebootSignal - - -

- - -
-

- Bases: NTCError

- - -

RebootSignal.

- - - - - - - - - -
- - - - - - - - - - - -
- -
- -
- - - - -
- -
- -
- - - - - - - - - - - - - -
-
- - - - - -
- -
- - - -
-
-
-
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/iosxewlc_device.html b/docs/dev/code-reference/pyntc/devices/iosxewlc_device.html deleted file mode 100644 index bbb4984c..00000000 --- a/docs/dev/code-reference/pyntc/devices/iosxewlc_device.html +++ /dev/null @@ -1,1315 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - Iosxewlc device - Pyntc Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Skip to content - - -
-
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - -

- pyntc.devices.iosxewlc_device - - -

- -
- -

Module for using a Cisco IOSXE WLC device over SSH.

- - - - - - - - -
- - - - - - - - -
- - - -

- pyntc.devices.iosxewlc_device.IOSXEWLCDevice - - -

- - -
-

- Bases: IOSDevice

- - -

Cisco IOSXE WLC Device Implementation.

- - - - - - - - - -
- - - - - - - - - -
- - -

- install_os(image_name, read_timeout=2000, **vendor_specifics) - -

- - -
- -

Installs the prescribed Network OS, which must be present before issuing this command.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- image_name - - str - -
-

Name of the IOS image to boot into

-
-
- required -
- read_timeout - - int - -
-

Timeout for reading the output of the command.

-
-
- 2000 -
- vendor_specifics - - dict - -
-

Vendor specific options.

-
-
- {} -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- OSInstallError - -
-

Unable to install OS Error type

-
-
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

False if no install is needed, true if the install completes successfully

-
-
- -
- -
- -
- - -

- show(command, expect_string=None, **netmiko_args) - -

- - -
- -

Run command on device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- command - - str - -
-

Command to be ran.

-
-
- required -
- expect_string - - str - -
-

Expected string from command output. Defaults to None.

-
-
- None -
- netmiko_args - - dict - -
-

Additional arguments to pass to Netmiko's send_command method.

-
-
- {} -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Output of command.

-
-
- -
- -
- - - -
- -
- -
- - - - -
- -
- -
- - - - - - - - - - - - - -
-
- - - - - -
- -
- - - -
-
-
-
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/jnpr_device.html b/docs/dev/code-reference/pyntc/devices/jnpr_device.html deleted file mode 100644 index d36b5112..00000000 --- a/docs/dev/code-reference/pyntc/devices/jnpr_device.html +++ /dev/null @@ -1,2821 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - Jnpr device - Pyntc Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Skip to content - - -
-
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - -

- pyntc.devices.jnpr_device - - -

- -
- -

Module for using a Juniper junOS device.

- - - - - - - - -
- - - - - - - - -
- - - -

- pyntc.devices.jnpr_device.JunosDevice - - -

- - -
-

- Bases: BaseDevice

- - -

Juniper JunOS Device Implementation.

- - - - - - - - - -
- - - - - - - -
- - - -

- boot_options - - - property - - -

- - -
- -

Get os version on device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

OS version on device.

-
-
-
- -
- -
- - - -

- connected - - - property - - -

- - -
- -

Get connection status of device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if connection is active. Otherwise, false.

-
-
-
- -
- -
- - - -

- fqdn - - - property - - -

- - -
- -

Get fully qualified domain name.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Fully qualified domain name.

-
-
-
- -
- -
- - - -

- hostname - - - property - - -

- - -
- -

Get device hostname.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Device hostname.

-
-
-
- -
- -
- - - -

- interfaces - - - property - - -

- - -
- -

Get list of interfaces.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- list - -
-

List of interfaces.

-
-
-
- -
- -
- - - -

- model - - - property - - -

- - -
- -

Get device model.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Device model.

-
-
-
- -
- -
- - - -

- os_version - - - property - - -

- - -
- -

Get OS version.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

OS version.

-
-
-
- -
- -
- - - -

- running_config - - - property - - -

- - -
- -

Get running configuration.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Running configuration.

-
-
-
- -
- -
- - - -

- serial_number - - - property - - -

- - -
- -

Get serial number.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Serial number.

-
-
-
- -
- -
- - - -

- startup_config - - - property - - -

- - -
- -

Get startup configuration.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Startup configuration.

-
-
-
- -
- -
- - - -

- uptime - - - property - - -

- - -
- -

Get device uptime in seconds.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- int - -
-

Device uptime in seconds.

-
-
-
- -
- -
- - - -

- uptime_string - - - property - - -

- - -
- -

Get device uptime in format dd:hh:mm:ss.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Device uptime.

-
-
-
- -
- - - -
- - -

- __init__(host, username, password, *args, **kwargs) - -

- - -
- -

PyNTC device implementation for Juniper JunOS.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- host - - str - -
-

The address of the network device.

-
-
- required -
- username - - str - -
-

The username to authenticate with the device.

-
-
- required -
- password - - str - -
-

The password to authenticate with the device.

-
-
- required -
- args - - tuple - -
-

Additional positional arguments to pass to the device.

-
-
- () -
- kwargs - - dict - -
-

Additional keyword arguments to pass to the device.

-
-
- {} -
- -
- -
- -
- - -

- backup_running_config(filename) - -

- - -
- -

Backup current running configuration.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- filename - - str - -
-

Name used for backup file.

-
-
- required -
- -
- -
- -
- - -

- checkpoint(filename) - -

- - -
- -

Create checkpoint file.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- filename - - str - -
-

Name of checkpoint file.

-
-
- required -
- -
- -
- -
- - -

- close() - -

- - -
- -

Close connection to device.

- -
- -
- -
- - -

- config(commands, format_type='set') - -

- - -
- -

Send configuration commands to a device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- commands - - (str, list) - -
-

String with single command, or list with multiple commands.

-
-
- required -
- format_type - - str - -
-

Format type for the command. Defaults to "set".

-
-
- 'set' -
- - -

Raises:

- - - - - - - - - - - - - - - - - - - - - -
TypeDescription
- ConfigLoadError - -
-

Issue with loading the command.

-
-
- CommandError - -
-

Issue with the command provided, if its a single command, passed in as a string.

-
-
- CommandListError - -
-

Issue with a command in the list provided.

-
-
- -
- -
- -
- - -

- file_copy(src, dest=None, **kwargs) - -

- - -
- -

Copy file to device via SCP.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- src - - str - -
-

Name of file to be transferred.

-
-
- required -
- dest - - str - -
-

Path on device to save file. Defaults to None.

-
-
- None -
- kwargs - - dict - -
-

Additional keyword arguments to pass to the file_copy command.

-
-
- {} -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- FileTransferError - -
-

Raised when unable to verify file was transferred succesfully.

-
-
- -
- -
- -
- - -

- file_copy_remote_exists(src, dest=None, **kwargs) - -

- - -
- -

Verify device already has existing file.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- src - - str - -
-

Source of local file.

-
-
- required -
- dest - - str - -
-

Path of file on device. Defaults to None.

-
-
- None -
- kwargs - - dict - -
-

Additional keyword arguments to pass to the file_copy command.

-
-
- {} -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if hashes of the file match. Otherwise, false.

-
-
- -
- -
- -
- - -

- install_os(image_name, **vendor_specifics) - -

- - -
- -

Install OS on device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- image_name - - str - -
-

Name of image.

-
-
- required -
- vendor_specifics - - dict - -
-

Vendor specific options.

-
-
- {} -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

Method currently not implemented.

-
-
- -
- -
- -
- - -

- open() - -

- - -
- -

Open connection to device.

- -
- -
- -
- - -

- reboot(wait_for_reload=False, **kwargs) - -

- - -
- -

Reload the controller or controller pair.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- wait_for_reload - - bool - -
-

Whether or not reboot method should also run _wait_for_device_reboot(). Defaults to False.

-
-
- False -
- kwargs - - dict - -
-

Additional keyword arguments to pass to the reboot command.

-
-
- {} -
- - -
- Example -
-
-
-

device = JunosDevice(**connection_args) -device.reboot() -

-
-
-
-
-
- -
- -
- - -

- rollback(filename) - -

- - -
- -

Rollback to a specific configuration file.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- filename - - str - -
-

Filename to rollback device to.

-
-
- required -
- -
- -
- -
- - -

- save(filename=None) - -

- - -
- -

Save current configuration to device.

-

If filename is provided, save current configuration to file.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- filename - - str - -
-

Filename to save current configuration. Defaults to None.

-
-
- None -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if new file created for save file. Otherwise, just returns if save is to default name.

-
-
- -
- -
- -
- - -

- set_boot_options(sys) - -

- - -
- -

Set boot options.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- sys - - str - -
-

Name of image to set boot option to.

-
-
- required -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NotImplementedError - -
-

Method currently not implemented.

-
-
- -
- -
- -
- - -

- show(commands) - -

- - -
- -

Send configuration commands to a device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- commands - - (str, list) - -
-

String with single command, or list with multiple commands.

-
-
- required -
- - -

Raises:

- - - - - - - - - - - - - - - - - -
TypeDescription
- CommandError - -
-

Issue with the command provided.

-
-
- CommandListError - -
-

Issue with a command in the list provided.

-
-
- -
- -
- - - -
- -
- -
- - - - -
- -
- -
- - - - - - - - - - - - - -
-
- - - - - -
- -
- - - -
-
-
-
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/nxos_device.html b/docs/dev/code-reference/pyntc/devices/nxos_device.html deleted file mode 100644 index f625e13e..00000000 --- a/docs/dev/code-reference/pyntc/devices/nxos_device.html +++ /dev/null @@ -1,3045 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - Nxos device - Pyntc Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Skip to content - - -
-
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - -

- pyntc.devices.nxos_device - - -

- -
- -

Module for using an NXOS device over NX-API.

- - - - - - - - -
- - - - - - - - -
- - - -

- pyntc.devices.nxos_device.NXOSDevice - - -

- - -
-

- Bases: BaseDevice

- - -

Cisco NXOS Device Implementation.

- - - - - - - - - -
- - - - - - - -
- - - -

- boot_options - - - property - - -

- - -
- -

Get current boot variables.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- dict - -
-

e.g . {"kick": "router_kick.img", "sys": "router_sys.img"}

-
-
-
- -
- -
- - - -

- fqdn - - - property - - -

- - -
- -

Get fully qualified domain name.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Fully qualified domain name.

-
-
-
- -
- -
- - - -

- hostname - - - property - - -

- - -
- -

Get hostname of the device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Hostname of the device.

-
-
-
- -
- -
- - - -

- interfaces - - - property - - -

- - -
- -

Get list of interfaces.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- list - -
-

List of interfaces.

-
-
-
- -
- -
- - - -

- model - - - property - - -

- - -
- -

Get device model.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Model of device.

-
-
-
- -
- -
- - - -

- os_version - - - property - - -

- - -
- -

Get device version.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Device version.

-
-
-
- -
- -
- - - -

- running_config - - - property - - -

- - -
- -

Get running configuration of device.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Running configuration of device.

-
-
-
- -
- -
- - - -

- serial_number - - - property - - -

- - -
- -

Get device serial number.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Device serial number.

-
-
-
- -
- -
- - - -

- startup_config - - - property - - -

- - -
- -

Get startup configuration.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Startup configuration.

-
-
-
- -
- -
- - - -

- uptime - - - property - - -

- - -
- -

Get uptime of the device in seconds.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- int - -
-

Uptime of the device in seconds.

-
-
-
- -
- -
- - - -

- uptime_string - - - property - - -

- - -
- -

Get uptime in format dd:hh:mm.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Uptime of device.

-
-
-
- -
- -
- - - -

- vlans - - - property - - -

- - -
- -

Get list of vlans.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- list - -
-

List of vlans on the device.

-
-
-
- -
- - - -
- - -

- __init__(host, username, password, transport='http', timeout=30, port=None, verify=True, **kwargs) - -

- - -
- -

PyNTC Device implementation for Cisco IOS.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- host - - str - -
-

The address of the network device.

-
-
- required -
- username - - str - -
-

The username to authenticate with the device.

-
-
- required -
- password - - str - -
-

The password to authenticate with the device.

-
-
- required -
- transport - - str - -
-

Transport protocol to connect to device. Defaults to "http".

-
-
- 'http' -
- timeout - - int - -
-

Timeout in seconds. Defaults to 30.

-
-
- 30 -
- port - - int - -
-

Port used to connect to device. Defaults to None.

-
-
- None -
- verify - - bool - -
-

SSL verification.

-
-
- True -
- kwargs - - dict - -
-

Left for compatibility with other tools, for instance nautobot-inventory may pass additional kwargs.

-
-
- {} -
- -
- -
- -
- - -

- backup_running_config(filename) - -

- - -
- -

Backup running configuration.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- filename - - str - -
-

Name of backup file.

-
-
- required -
- -
- -
- -
- - -

- checkpoint(filename) - -

- - -
- -

Save a checkpoint of the running configuration to the device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- filename - - str - -
-

The filename to save the checkpoint on the remote device.

-
-
- required -
- -
- -
- -
- - -

- close() - -

- - -
- -

Implements pass.

- -
- -
- -
- - -

- config(command) - -

- - -
- -

Send configuration command.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- command - - (str, list) - -
-

command to be sent to the device.

-
-
- required -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- CommandError - -
-

Error if command is not succesfully ran on device.

-
-
- -
- -
- -
- - -

- file_copy(src, dest=None, file_system='bootflash:') - -

- - -
- -

Send a local file to the device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- src - - str - -
-

Path to the local file to send.

-
-
- required -
- dest - - str - -
-

The destination file path. Defaults to basename of source path.

-
-
- None -
- file_system - - str - -
-

[The file system for the remote file. Defaults to "bootflash:".

-
-
- 'bootflash:' -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- FileTransferError - -
-

Error if transfer of file cannot be verified.

-
-
- -
- -
- -
- - -

- file_copy_remote_exists(src, dest=None, file_system='bootflash:') - -

- - -
- -

Check if a remote file exists.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- src - - str - -
-

Path to the local file to send.

-
-
- required -
- dest - - str - -
-

The destination file path to be saved on remote device. Defaults to basename of source path.

-
-
- None -
- file_system - - str - -
-

The file system for the remote file. Defaults to "bootflash:".

-
-
- 'bootflash:' -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if the remote file exists. Otherwise, false.

-
-
- -
- -
- -
- - -

- install_os(image_name, **vendor_specifics) - -

- - -
- -

Upgrade device with provided image.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- image_name - - str - -
-

Name of the image file to upgrade the device to.

-
-
- required -
- vendor_specifics - - dict - -
-

Vendor specific options.

-
-
- {} -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- OSInstallError - -
-

Error if boot option is not set to new image.

-
-
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if new image is boot option on device. Otherwise, false.

-
-
- -
- -
- -
- - -

- open() - -

- - -
- -

Implements pass.

- -
- -
- -
- - -

- reboot(wait_for_reload=False, **kwargs) - -

- - -
- -

Reload the controller or controller pair.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- wait_for_reload - - bool - -
-

Whether or not reboot method should also run _wait_for_device_reboot(). Defaults to False.

-
-
- False -
- kwargs - - dict - -
-

Additional arguments to pass to reboot method.

-
-
- {} -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- RebootTimerError - -
-

When the device is still unreachable after the timeout period.

-
-
- - -
- Example -
-
-
-

device = NXOSDevice(**connection_args) -device.reboot() -

-
-
-
-
-
- -
- -
- - -

- refresh() - -

- - -
- -

Refresh caches on device instance.

- -
- -
- -
- - -

- rollback(filename) - -

- - -
- -

Rollback configuration to specified file.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- filename - - str - -
-

Name of the file to rollback to.

-
-
- required -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- RollbackError - -
-

Error if rollback command is unsuccesfull.

-
-
- -
- -
- -
- - -

- save(filename='startup-config') - -

- - -
- -

Save a device's running configuration.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- filename - - str - -
-

Filename to save running configuration to. Defaults to "startup-config".

-
-
- 'startup-config' -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- bool - -
-

True if configuration is saved.

-
-
- -
- -
- -
- - -

- set_boot_options(image_name, kickstart=None, **vendor_specifics) - -

- - -
- -

Set boot variables.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- image_name - - str - -
-

Main system image file.

-
-
- required -
- kickstart - - str - -
-

Kickstart filename. Defaults to None.

-
-
- None -
- vendor_specifics - - dict - -
-

Vendor specific options.

-
-
- {} -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- NTCFileNotFoundError - -
-

Error if either image_name or kickstart image not found on device.

-
-
- -
- -
- -
- - -

- set_timeout(timeout) - -

- - -
- -

Set timeout value on device connection.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- timeout - - int - -
-

Timeout value.

-
-
- required -
- -
- -
- -
- - -

- show(command, raw_text=False) - -

- - -
- -

Send a non-configuration command.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- command - - str - -
-

The command to send to the device.

-
-
- required -
- raw_text - - bool - -
-

Whether to return raw text or structured data. Defaults to False.

-
-
- False -
- - -

Raises:

- - - - - - - - - - - - - -
TypeDescription
- CommandError - -
-

Error message stating which command failed.

-
-
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Results of the command ran.

-
-
- -
- -
- - - -
- -
- -
- - - - -
- -
- -
- - - - - - - - - - - - - -
-
- - - - - -
- -
- - - -
-
-
-
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/system_features/__init__.html b/docs/dev/code-reference/pyntc/devices/system_features/__init__.html deleted file mode 100644 index fff8ad54..00000000 --- a/docs/dev/code-reference/pyntc/devices/system_features/__init__.html +++ /dev/null @@ -1,1001 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - init - Pyntc Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Skip to content - - -
-
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - -

- pyntc.devices.system_features - - -

- -
- -

Initialize the system features module.

- - - - - - - - -
- - - - - - - - - - - -
- -
- -
- - - - - - - - - - - - - -
-
- - - - - -
- -
- - - -
-
-
-
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/system_features/base_feature.html b/docs/dev/code-reference/pyntc/devices/system_features/base_feature.html deleted file mode 100644 index 5aa2ee83..00000000 --- a/docs/dev/code-reference/pyntc/devices/system_features/base_feature.html +++ /dev/null @@ -1,1170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - Base feature - Pyntc Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Skip to content - - -
-
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - -

- pyntc.devices.system_features.base_feature - - -

- -
- -

Define base feature set.

- - - - - - - - -
- - - - - - - - -
- - - -

- pyntc.devices.system_features.base_feature.BaseFeature - - -

- - -
- - -

Base feature sets.

- - - - - - - - - -
- - - - - - - - - -
- - -

- config(vlan_id, **params) - -

- - -
- -

Base config feature.

- -
- -
- -
- - -

- get(vlan_id) - -

- - -
- -

Base get feature.

- -
- -
- -
- - -

- get_all() - -

- - -
- -

Base get all features.

- -
- -
- -
- - -

- get_list() - -

- - -
- -

Base get_list feature.

- -
- -
- - - -
- -
- -
- - - - -
- -
- -
- - - - - - - - - - - - - -
-
- - - - - -
- -
- - - -
-
-
-
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/system_features/vlans/__init__.html b/docs/dev/code-reference/pyntc/devices/system_features/vlans/__init__.html deleted file mode 100644 index c538f88b..00000000 --- a/docs/dev/code-reference/pyntc/devices/system_features/vlans/__init__.html +++ /dev/null @@ -1,1001 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - init - Pyntc Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Skip to content - - -
-
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - -

- pyntc.devices.system_features.vlans - - -

- -
- -

Initialize the system features vlans module.

- - - - - - - - -
- - - - - - - - - - - -
- -
- -
- - - - - - - - - - - - - -
-
- - - - - -
- -
- - - -
-
-
-
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/system_features/vlans/base_vlans.html b/docs/dev/code-reference/pyntc/devices/system_features/vlans/base_vlans.html deleted file mode 100644 index 48ea6936..00000000 --- a/docs/dev/code-reference/pyntc/devices/system_features/vlans/base_vlans.html +++ /dev/null @@ -1,1220 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - Base vlans - Pyntc Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Skip to content - - -
-
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - -

- pyntc.devices.system_features.vlans.base_vlans - - -

- -
- -

Base Vlan checks.

- - - - - - - - -
- - - - - - - - -
- - - -

- pyntc.devices.system_features.vlans.base_vlans.BaseVlans - - -

- - -
-

- Bases: BaseFeature

- - -

Subclass for base vlan feature.

- - - - - - - - - -
- - - - - - - - - - - -
- -
- -
- -
- - - -

- pyntc.devices.system_features.vlans.base_vlans.VlanNotInRangeError - - -

- - -
-

- Bases: NTCError

- - -

Vlan error.

- - - - - - - - - -
- - - - - - - - - -
- - -

- __init__(lower, upper) - -

- - -
- -

Exception for vlan range validation.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- lower - - int - -
-

lower vlan range.

-
-
- required -
- upper - - int - -
-

upper vlan range.

-
-
- required -
- -
- -
- - - -
- -
- -
- - -
- - -

- pyntc.devices.system_features.vlans.base_vlans.vlan_not_in_range_error(vlan_id, lower=1, upper=4094) - -

- - -
- -

Validate vlan range.

- -
- -
- - - -
- -
- -
- - - - - - - - - - - - - -
-
- - - - - -
- -
- - - -
-
-
-
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/system_features/vlans/eos_vlans.html b/docs/dev/code-reference/pyntc/devices/system_features/vlans/eos_vlans.html deleted file mode 100644 index 6326abc6..00000000 --- a/docs/dev/code-reference/pyntc/devices/system_features/vlans/eos_vlans.html +++ /dev/null @@ -1,1229 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - Eos vlans - Pyntc Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Skip to content - - -
-
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - -

- pyntc.devices.system_features.vlans.eos_vlans - - -

- -
- -

System features EOS Vlans.

- - - - - - - - -
- - - - - - - - -
- - - -

- pyntc.devices.system_features.vlans.eos_vlans.EOSVlans - - -

- - -
-

- Bases: BaseVlans

- - -

EOS Vlan system features.

- - - - - - - - - -
- - - - - - - - - -
- - -

- __init__(device) - -

- - -
- -

EOS Vlan system features.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- device - - str - -
-

Device object.

-
-
- required -
- -
- -
- -
- - -

- get(vlan_id) - -

- - -
- -

Get system vlans for EOS.

- -
- -
- -
- - -

- get_list() - -

- - -
- -

Get a list of vlans for EOS.

- -
- -
- -
- - -

- remove(vlan_id) - -

- - -
- -

Remove a vlan from EOS device.

- -
- -
- - - -
- -
- -
- - -
- - -

- pyntc.devices.system_features.vlans.eos_vlans.instance(device) - -

- - -
- -

Instance of a device.

- -
- -
- - - -
- -
- -
- - - - - - - - - - - - - -
-
- - - - - -
- -
- - - -
-
-
-
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/tables/__init__.html b/docs/dev/code-reference/pyntc/devices/tables/__init__.html deleted file mode 100644 index d69c8bce..00000000 --- a/docs/dev/code-reference/pyntc/devices/tables/__init__.html +++ /dev/null @@ -1,1001 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - init - Pyntc Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Skip to content - - -
-
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - -

- pyntc.devices.tables - - -

- -
- -

Initialization for tables.

- - - - - - - - -
- - - - - - - - - - - -
- -
- -
- - - - - - - - - - - - - -
-
- - - - - -
- -
- - - -
-
-
-
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/tables/jnpr/__init__.html b/docs/dev/code-reference/pyntc/devices/tables/jnpr/__init__.html deleted file mode 100644 index 8dfc1769..00000000 --- a/docs/dev/code-reference/pyntc/devices/tables/jnpr/__init__.html +++ /dev/null @@ -1,1001 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - init - Pyntc Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Skip to content - - -
-
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - -

- pyntc.devices.tables.jnpr - - -

- -
- -

Initialization for Juniper device tables.

- - - - - - - - -
- - - - - - - - - - - -
- -
- -
- - - - - - - - - - - - - -
-
- - - - - -
- -
- - - -
-
-
-
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/devices/tables/jnpr/loopback.html b/docs/dev/code-reference/pyntc/devices/tables/jnpr/loopback.html deleted file mode 100644 index fb71844b..00000000 --- a/docs/dev/code-reference/pyntc/devices/tables/jnpr/loopback.html +++ /dev/null @@ -1,1001 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - Loopback - Pyntc Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Skip to content - - -
-
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - -

- pyntc.devices.tables.jnpr.loopback - - -

- -
- -

Pythonifier for Loopback Table/View.

- - - - - - - - -
- - - - - - - - - - - -
- -
- -
- - - - - - - - - - - - - -
-
- - - - - -
- -
- - - -
-
-
-
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/errors.html b/docs/dev/code-reference/pyntc/errors.html deleted file mode 100644 index bdb37e7f..00000000 --- a/docs/dev/code-reference/pyntc/errors.html +++ /dev/null @@ -1,3561 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - Errors - Pyntc Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Skip to content - - -
-
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - -

- pyntc.errors - - -

- -
- -

pyntc custom exceptions.

- - - - - - - - -
- - - - - - - - -
- - - -

- pyntc.errors.CommandError - - -

- - -
-

- Bases: NTCError

- - -

Error for issuing command on device.

- - - - - - - - - -
- - - - - - - - - -
- - -

- __init__(command, message) - -

- - -
- -

Error for issuing command on device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- command - - str - -
-

The command that failed.

-
-
- required -
- message - - str - -
-

The error message returned from the device.

-
-
- required -
- -
- -
- - - -
- -
- -
- -
- - - -

- pyntc.errors.CommandListError - - -

- - -
-

- Bases: NTCError

- - -

Error for issuing a command from a list of commands on device..

- - - - - - - - - -
- - - - - - - - - -
- - -

- __init__(commands, command, message) - -

- - -
- -

Error for issuing a command from a list of commands on device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- commands - - list - -
-

The list of commands that were to be sent to the device.

-
-
- required -
- command - - str - -
-

The command that reported an error on the device.

-
-
- required -
- message - - str - -
-

The error emssage returned from the device.

-
-
- required -
- -
- -
- - - -
- -
- -
- -
- - - -

- pyntc.errors.ConfFileNotFoundError - - -

- - -
-

- Bases: NTCError

- - -

Error for issues finding the config filename.

- - - - - - - - - -
- - - - - - - - - -
- - -

- __init__(filename) - -

- - -
- -

Error for issues finding the config filename.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- filename - - str - -
-

The name of the file used for config settings.

-
-
- required -
- -
- -
- - - -
- -
- -
- -
- - - -

- pyntc.errors.DeviceNameNotFoundError - - -

- - -
-

- Bases: NTCError

- - -

Error for issues finding name in inventory file, filename.

- - - - - - - - - -
- - - - - - - - - -
- - -

- __init__(name, filename) - -

- - -
- -

Error for issues finding name in inventory file, filename.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- name - - str - -
-

The hostname that failed the lookup.

-
-
- required -
- filename - - str - -
-

The name of the file used for inventory.

-
-
- required -
- -
- -
- - - -
- -
- -
- -
- - - -

- pyntc.errors.DeviceNotActiveError - - -

- - -
-

- Bases: NTCError

- - -

Error for when the device is part of an HA cluster, and the device is not the active device.

- - - - - - - - - -
- - - - - - - - - -
- - -

- __init__(hostname, redundancy_state, peer_redundancy_state) - -

- - -
- -

Error for when the device is part of an HA cluster, and the device is not the active device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- hostname - - str - -
-

The hostname of the device being validated.

-
-
- required -
- redundancy_state - - str - -
-

Current redundancy state.

-
-
- required -
- peer_redundancy_state - - str - -
-

Peer State.

-
-
- required -
- -
- -
- - - -
- -
- -
- -
- - - -

- pyntc.errors.FeatureNotFoundError - - -

- - -
-

- Bases: NTCError

- - -

Error for trying to use a PyNTC feature for an unsupported device_type.

- - - - - - - - - -
- - - - - - - - - -
- - -

- __init__(feature, device_type) - -

- - -
- -

Error for trying to use a PyNTC feature for an unsupported device_type.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- feature - - str - -
-

The PyNTC feature name.

-
-
- required -
- device_type - - str - -
-

The PyNTC device_type name.

-
-
- required -
-

TODO: Remove this Exception when VLAN feature is removed.

- -
- -
- - - -
- -
- -
- -
- - - -

- pyntc.errors.FileSystemNotFoundError - - -

- - -
-

- Bases: NTCError

- - -

Error for inability to identify the default file system on network device.

- - - - - - - - - -
- - - - - - - - - -
- - -

- __init__(hostname, command) - -

- - -
- -

Error for inability to identify the default file system on network device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- hostname - - str - -
-

The hostname of the device that failed.

-
-
- required -
- command - - str - -
-

The command used to detect the default file system.

-
-
- required -
- -
- -
- - - -
- -
- -
- -
- - - -

- pyntc.errors.FileTransferError - - -

- - -
-

- Bases: NTCError

- - -

File Transfer Error.

- - - - - - - - - -
- - - - - - - - - -
- - -

- __init__(message=None) - -

- - -
- -

File Transfer Error.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- message - - str - -
-

Error message to pass. Defaults to None.

-
-
- None -
- -
- -
- - - -
- -
- -
- -
- - - -

- pyntc.errors.NTCError - - -

- - -
-

- Bases: Exception

- - -

Generic Error class for PyNTC.

- - - - - - - - - -
- - - - - - - - - -
- - -

- __init__(message) - -

- - -
- -

Generic Error class for PyNTC.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- message - - str - -
-

The error message associated with the Exception.

-
-
- required -
- -
- -
- -
- - -

- __repr__() - -

- - -
- -

Representation of NTC error object.

- -
- -
- - - -
- -
- -
- -
- - - -

- pyntc.errors.NTCFileNotFoundError - - -

- - -
-

- Bases: NTCError

- - -

Error for not being able to find a file on a device.

- - - - - - - - - -
- - - - - - - - - -
- - -

- __init__(hostname, file, directory) - -

- - -
- -

Error for not being able to find a file on a device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- hostname - - str - -
-

The hostname of the device that did not have the file.

-
-
- required -
- file - - str - -
-

The name of the file that could not be found.

-
-
- required -
- directory - - str - -
-

The directory on the network device where the file was searched for.

-
-
- required -
-

TODO: Rename dir arg as that is a reserved name in python.

- -
- -
- - - -
- -
- -
- -
- - - -

- pyntc.errors.NotEnoughFreeSpaceError - - -

- - -
-

- Bases: NTCError

- - -

Error for not having enough free space to transfer a file.

- - - - - - - - - -
- - - - - - - - - -
- - -

- __init__(hostname, min_space) - -

- - -
- -

Error for not having enough free space to transfer a file.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- hostname - - str - -
-

The hostname of the device that did not boot back up.

-
-
- required -
- min_space - - str - -
-

The minimum amount of space required to transfer the file.

-
-
- required -
- -
- -
- - - -
- -
- -
- -
- - - -

- pyntc.errors.OSInstallError - - -

- - -
-

- Bases: NTCError

- - -

Error for failing to install an OS on a device.

- - - - - - - - - -
- - - - - - - - - -
- - -

- __init__(hostname, desired_boot) - -

- - -
- -

Error for failing to install an OS on a device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- hostname - - str - -
-

The hostname of the device that failed to install OS.

-
-
- required -
- desired_boot - - str - -
-

The OS that was attempted to be installed.

-
-
- required -
- -
- -
- - - -
- -
- -
- -
- - - -

- pyntc.errors.PeerFailedToFormError - - -

- - -
-

- Bases: NTCError

- - -

Error for failing to have High Availability Peer form after state change.

- - - - - - - - - -
- - - - - - - - - -
- - -

- __init__(hostname, desired_state, current_state) - -

- - -
- -

Error for failing to have High Availability Peer form after state change.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- hostname - - str - -
-

The hostname of the device that did not peer properly.

-
-
- required -
- desired_state - - str - -
-

The peer redundancy state that was expected.

-
-
- required -
- current_state - - str - -
-

The current peer redundancy state of the device.

-
-
- required -
- -
- -
- - - -
- -
- -
- -
- - - -

- pyntc.errors.RebootTimeoutError - - -

- - -
-

- Bases: NTCError

- - -

Error for inability to log into device after waiting for max time for reboot to complete.

- - - - - - - - - -
- - - - - - - - - -
- - -

- __init__(hostname, wait_time) - -

- - -
- -

Error for inability to log into device after waiting for max time for reboot to complete.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- hostname - - str - -
-

The hostname of the device that did not boot back up.

-
-
- required -
- wait_time - - int - -
-

The amount of time waiting before considering the reboot failed.

-
-
- required -
- -
- -
- - - -
- -
- -
- -
- - - -

- pyntc.errors.SocketClosedError - - -

- - -
-

- Bases: NTCError

- - -

Error for network device closing the socket connection during operation.

- - - - - - - - - -
- - - - - - - - - -
- - -

- __init__(message=None) - -

- - -
- -

Error for network device closing the socket connection during operation.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- message - - str - -
-

A custom error message to use instead of the default.

-
-
- None -
- -
- -
- - - -
- -
- -
- -
- - - -

- pyntc.errors.UnsupportedDeviceError - - -

- - -
-

- Bases: NTCError

- - -

Error class for Unsupported Devices.

- - - - - - - - - -
- - - - - - - - - -
- - -

- __init__(vendor) - -

- - -
- -

Error class for Unsupported Devices.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- vendor - - str - -
-

The name of the deice's vendor to present in the error.

-
-
- required -
- -
- -
- - - -
- -
- -
- -
- - - -

- pyntc.errors.WLANDisableError - - -

- - -
-

- Bases: NTCError

- - -

Error for not being able to disable WLAN.

- - - - - - - - - -
- - - - - - - - - -
- - -

- __init__(hostname, desired_wlans, actual_wlans) - -

- - -
- -

Error for not being able to disable WLAN.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- hostname - - str - -
-

The hostname of the device that failed to disable all desired_wlans.

-
-
- required -
- desired_wlans - - list - -
-

The WLAN IDs that should have been disabled.

-
-
- required -
- actual_wlans - - list - -
-

The WLAN IDs that are disabled on the device.

-
-
- required -
- -
- -
- - - -
- -
- -
- -
- - - -

- pyntc.errors.WLANEnableError - - -

- - -
-

- Bases: NTCError

- - -

Error for not being able to enable WLAN.

- - - - - - - - - -
- - - - - - - - - -
- - -

- __init__(hostname, desired_wlans, actual_wlans) - -

- - -
- -

Error for not being able to enable WLAN.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- hostname - - str - -
-

The hostname of the device that failed to enable all desired_wlans.

-
-
- required -
- desired_wlans - - list - -
-

The WLAN IDs that should have been enabled.

-
-
- required -
- actual_wlans - - list - -
-

The WLAN IDs that are enabled on the device.

-
-
- required -
- -
- -
- - - -
- -
- -
- -
- - - -

- pyntc.errors.WaitingRebootTimeoutError - - -

- - -
-

- Bases: NTCError

- - -

Error for device not rebooting after sending install mode upgrade command.

- - - - - - - - - -
- - - - - - - - - -
- - -

- __init__(hostname, wait_time) - -

- - -
- -

Error for device not rebooting after sending install mode upgrade command.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- hostname - - str - -
-

The hostname of the device that did not boot back up.

-
-
- required -
- wait_time - - int - -
-

The amount of time waiting before considering the reboot failed.

-
-
- required -
- -
- -
- - - -
- -
- -
- - - - -
- -
- -
- - - - - - - - - - - - - -
-
- - - - - -
- -
- - - -
-
-
-
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/log.html b/docs/dev/code-reference/pyntc/log.html deleted file mode 100644 index 40b700d7..00000000 --- a/docs/dev/code-reference/pyntc/log.html +++ /dev/null @@ -1,1318 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - Log - Pyntc Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Skip to content - - -
-
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - -

- pyntc.log - - -

- -
- -

Logging utilities for Pyntc.

- - - - - - - - -
- - - - - - - -
- - - -

- pyntc.log.APP = 'pyntc' - - - module-attribute - - -

- - -
- -

Application name, used as the logging root.

-
- -
- -
- - - -

- pyntc.log.DEBUG_FORMAT = '%(asctime)s [%(levelname)s] [%(module)s] [%(funcName)s] %(name)s: %(message)s' - - - module-attribute - - -

- - -
- -

Logging format used when debug output is enabled.

-
- -
- -
- - - -

- pyntc.log.FORMAT = '%(asctime)s [%(levelname)s] %(name)s: %(message)s' - - - module-attribute - - -

- - -
- -

Logging format to use.

-
- -
- - - -
- - -

- pyntc.log.get_log(name=None) - -

- - -
- -

Get log namespace and creates logger and rotating file handler.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- name - - str - -
-

Sublogger name. Defaults to None.

-
-
- None -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- logger - -
-

Return a logger instance in the :data:APP namespace.

-
-
- -
- -
- -
- - -

- pyntc.log.init(**kwargs) - -

- - -
- -

Initialize logging using sensible defaults.

-

If keyword arguments are passed to this function, they will be passed -directly to the :func:logging.basicConfig call in turn.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- **kwargs - - dict - -
-

Arguments to pass for logging configuration

-
-
- {} -
- -
- -
- -
- - -

- pyntc.log.logger(level) - -

- - -
- -

Wrap around logger methods.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- level - - str - -
-

defines the log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)

-
-
- required -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Returns logger. type of string.

-
-
- -
- -
- - - -
- -
- -
- - - - - - - - - - - - - -
-
- - - - - -
- -
- - - -
-
-
-
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/utils/__init__.html b/docs/dev/code-reference/pyntc/utils/__init__.html deleted file mode 100644 index 73863be3..00000000 --- a/docs/dev/code-reference/pyntc/utils/__init__.html +++ /dev/null @@ -1,1486 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - init - Pyntc Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Skip to content - - -
-
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - -

- pyntc.utils - - -

- -
- -

PyNTC Utilities.

- - - - - - - - -
- - - - - - - - - -
- - -

- pyntc.utils.convert_dict_by_key(original, key_map, fill_in=False, whitelist=[], blacklist=[]) - -

- - -
- -

Use a key map to convert a dictionary to desired keys.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- original - - dict - -
-

Original dictionary to be converted.

-
-
- required -
- key_map - - dict - -
-

Key map to use to convert dictionary.

-
-
- required -
- fill_in - - dict - -
-

Whether the returned dictionary should contain -keys and values from the original dictionary if not specified in the key map.

-
-
- False -
- whitelist - - list - -
-

If fill_in is True, and whitelist isn't empty, only fill in the keys -in the whitelist in the returned dictionary.

-
-
- [] -
- blacklist - - list - -
-

If fill_in is True, and blacklist isn't empty, fill in with all keys from -the original dictionary besides those in the blacklist.

-
-
- [] -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- dict - -
-

A converted dictionary through the key map.

-
-
- -
- -
- -
- - -

- pyntc.utils.convert_list_by_key(original_list, key_map, fill_in=False, whitelist=[], blacklist=[]) - -

- - -
- -

Apply a list conversion for all items in original_list.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- original_list - - list - -
-

Original list to be converted.

-
-
- required -
- key_map - - dict - -
-

Key map to use to convert list.

-
-
- required -
- fill_in - - dict - -
-

Whether the returned list should contain -keys and values from the original dictionary if not specified in the key map.

-
-
- False -
- whitelist - - list - -
-

If fill_in is True, and whitelist isn't empty, only fill in the keys -in the whitelist in the returned dictionary.

-
-
- [] -
- blacklist - - list - -
-

If fill_in is True, and blacklist isn't empty, fill in with all keys from -the original dictionary besides those in the blacklist.

-
-
- [] -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- list - -
-

A converted list.

-
-
- -
- -
- -
- - -

- pyntc.utils.get_structured_data(template_name, rawtxt) - -

- - -
- -

Return structured data given raw text using TextFSM templates.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- template_name - - str - -
-

Name of template to use.

-
-
- required -
- rawtxt - - str - -
-

Raw output from device.

-
-
- required -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- list - -
-

A dict per entry returned by TextFSM.

-
-
- -
- -
- -
- - -

- pyntc.utils.recursive_key_lookup(keys, obj) - -

- - -
- -

Lookup nested object by indexing through a dictionary sequentally through keys.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- keys - - list - -
-

The dictionary keys to use to lookup an object.

-
-
- required -
- obj - - dict - -
-

The dictionary to traverse.

-
-
- required -
- - -
- Example -
-
-
-

keys = ["a", "b", "c"] -data = {"a": {"b": {"c": 1}}} -recursive_key_lookup(keys, data) -1

-
-
-
-
-
- -
- - - -
- -
- -
- - - - - - - - - - - - - -
-
- - - - - -
- -
- - - -
-
-
-
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/utils/converters.html b/docs/dev/code-reference/pyntc/utils/converters.html deleted file mode 100644 index 3f1ed151..00000000 --- a/docs/dev/code-reference/pyntc/utils/converters.html +++ /dev/null @@ -1,1390 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - Converters - Pyntc Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Skip to content - - -
-
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - -

- pyntc.utils.converters - - -

- -
- -

Provides methods for manipulating and converting data.

- - - - - - - - -
- - - - - - - - - -
- - -

- pyntc.utils.converters.convert_dict_by_key(original, key_map, fill_in=False, whitelist=[], blacklist=[]) - -

- - -
- -

Use a key map to convert a dictionary to desired keys.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- original - - dict - -
-

Original dictionary to be converted.

-
-
- required -
- key_map - - dict - -
-

Key map to use to convert dictionary.

-
-
- required -
- fill_in - - dict - -
-

Whether the returned dictionary should contain -keys and values from the original dictionary if not specified in the key map.

-
-
- False -
- whitelist - - list - -
-

If fill_in is True, and whitelist isn't empty, only fill in the keys -in the whitelist in the returned dictionary.

-
-
- [] -
- blacklist - - list - -
-

If fill_in is True, and blacklist isn't empty, fill in with all keys from -the original dictionary besides those in the blacklist.

-
-
- [] -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- dict - -
-

A converted dictionary through the key map.

-
-
- -
- -
- -
- - -

- pyntc.utils.converters.convert_list_by_key(original_list, key_map, fill_in=False, whitelist=[], blacklist=[]) - -

- - -
- -

Apply a list conversion for all items in original_list.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- original_list - - list - -
-

Original list to be converted.

-
-
- required -
- key_map - - dict - -
-

Key map to use to convert list.

-
-
- required -
- fill_in - - dict - -
-

Whether the returned list should contain -keys and values from the original dictionary if not specified in the key map.

-
-
- False -
- whitelist - - list - -
-

If fill_in is True, and whitelist isn't empty, only fill in the keys -in the whitelist in the returned dictionary.

-
-
- [] -
- blacklist - - list - -
-

If fill_in is True, and blacklist isn't empty, fill in with all keys from -the original dictionary besides those in the blacklist.

-
-
- [] -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- list - -
-

A converted list.

-
-
- -
- -
- -
- - -

- pyntc.utils.converters.recursive_key_lookup(keys, obj) - -

- - -
- -

Lookup nested object by indexing through a dictionary sequentally through keys.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- keys - - list - -
-

The dictionary keys to use to lookup an object.

-
-
- required -
- obj - - dict - -
-

The dictionary to traverse.

-
-
- required -
- - -
- Example -
-
-
-

keys = ["a", "b", "c"] -data = {"a": {"b": {"c": 1}}} -recursive_key_lookup(keys, data) -1

-
-
-
-
-
- -
- - - -
- -
- -
- - - - - - - - - - - - - -
-
- - - - - -
- -
- - - -
-
-
-
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/utils/models.html b/docs/dev/code-reference/pyntc/utils/models.html deleted file mode 100644 index 778f3c06..00000000 --- a/docs/dev/code-reference/pyntc/utils/models.html +++ /dev/null @@ -1,1327 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - Models - Pyntc Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Skip to content - - -
-
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - -

- pyntc.utils.models - - -

- -
- -

Data Models for Pyntc.

- - - - - - - - -
- - - - - - - - -
- - - -

- pyntc.utils.models.FileCopyModel - - - - dataclass - - -

- - -
- - -

Data class to represent the specification for pulling a file from a URL to a network device.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- download_url - - str - -
-

The URL to download the file from. Can include credentials, but it's recommended to use the username and token fields instead for security reasons.

-
-
- required -
- checksum - - str - -
-

The expected checksum of the file.

-
-
- required -
- file_name - - str - -
-

The name of the file to be saved on the device.

-
-
- required -
- hashing_algorithm - - str - -
-

The hashing algorithm to use for checksum verification. Defaults to "md5".

-
-
- 'md5' -
- timeout - - int - -
-

The timeout for the download operation in seconds. Defaults to 900.

-
-
- 900 -
- file_size - - int - -
-

The expected size of the file in bytes. Optional but can be used for an additional layer of verification.

-
-
- None -
- username - - str - -
-

The username for authentication if required by the URL. Optional if credentials are included in the URL.

-
-
- None -
- token - - str - -
-

The password or token for authentication if required by the URL. Optional if credentials are included in the URL.

-
-
- None -
- vrf - - str - -
-

The VRF to use for the download if the device supports VRFs. Optional.

-
-
- None -
- ftp_passive - - bool - -
-

Whether to use passive mode for FTP downloads. Defaults to True.

-
-
- True -
- - - - - - - - - -
- - - - - - - - - -
- - -

- __post_init__() - -

- - -
- -

Validate the input and prepare the clean URL after initialization.

- -
- -
- -
- - -

- from_dict(data) - - - classmethod - - -

- - -
- -

Allows users to just pass a dictionary if they prefer.

- -
- -
- -
- - -

- to_dict() - -

- - -
- -

Useful for logging or passing to other Nornir tasks.

- -
- -
- - - -
- -
- -
- - - - -
- -
- -
- - - - - - - - - - - - - -
-
- - - - - -
- -
- - - -
-
-
-
- - - - - - - - - - - - \ No newline at end of file diff --git a/docs/dev/code-reference/pyntc/utils/templates/__init__.html b/docs/dev/code-reference/pyntc/utils/templates/__init__.html deleted file mode 100644 index 057e1195..00000000 --- a/docs/dev/code-reference/pyntc/utils/templates/__init__.html +++ /dev/null @@ -1,1234 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - init - Pyntc Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Skip to content - - -
-
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - -

- pyntc.utils.templates - - -

- -
- -

Module to use NTC_TEMPLATES.

- - - - - - - - -
- - - - - - - - - -
- - -

- pyntc.utils.templates.get_structured_data(template_name, rawtxt) - -

- - -
- -

Return structured data given raw text using TextFSM templates.

- - -

Parameters:

- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- template_name - - str - -
-

Name of template to use.

-
-
- required -
- rawtxt - - str - -
-

Raw output from device.

-
-
- required -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- list - -
-

A dict per entry returned by TextFSM.

-
-
- -
- -
- -
- - -

- pyntc.utils.templates.get_template(template_name) - -

- - -
- -

Path to the template passed in.

- - -

Parameters:

- - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefault
- template_name - - str - -
-

Name of the template.

-
-
- required -
- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Path to the template.

-
-
- -
- -
- -
- - -

- pyntc.utils.templates.get_template_dir() - -

- - -
- -

Get directory of NTC_TEMPLATE os environment.

- - -

Returns:

- - - - - - - - - - - - - -
TypeDescription
- str - -
-

Path to NTC_TEMPLATES environment variable if set. Otherwise, path to this file.

-
-
- -
- -
- - - -
- -
- -
- - - - - - - - - - - - - -
-
- - - - - -
- -
- - - -
-
-
-
- - - - - - - - - - - - \ No newline at end of file