Skip to content

Commit

Permalink
Merge pull request #1984 from ktbyers/develop
Browse files Browse the repository at this point in the history
Update docs
  • Loading branch information
ktbyers authored Oct 1, 2020
2 parents 3da5eda + fef644e commit 20034ce
Show file tree
Hide file tree
Showing 33 changed files with 3,698 additions and 239 deletions.
104 changes: 79 additions & 25 deletions docs/netmiko/arista/arista.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,24 @@ <h1 class="title">Module <code>netmiko.arista.arista</code></h1>
<section id="section-intro">
<details class="source">
<summary>Source code</summary>
<pre><code class="python">import time
<pre><code class="python">import re
from netmiko.cisco_base_connection import CiscoSSHConnection
from netmiko.cisco_base_connection import CiscoFileTransfer


class AristaBase(CiscoSSHConnection):
def __init__(self, *args, **kwargs):
kwargs.setdefault(&#34;fast_cli&#34;, True)
kwargs.setdefault(&#34;_legacy_mode&#34;, False)
return super().__init__(*args, **kwargs)

def session_preparation(self):
&#34;&#34;&#34;Prepare the session after the connection has been established.&#34;&#34;&#34;
self._test_channel_read(pattern=r&#34;[&gt;#]&#34;)
cmd = &#34;terminal width 511&#34;
# Arista will echo immediately and then when the device really responds (like NX-OS)
self.set_terminal_width(command=cmd, pattern=r&#34;Width set to&#34;)
self.disable_paging(cmd_verify=False, pattern=r&#34;Pagination disabled&#34;)
self.set_base_prompt()
self.set_terminal_width(command=&#34;terminal width 511&#34;, pattern=&#34;terminal&#34;)
self.disable_paging()
# Clear the read buffer
time.sleep(0.3 * self.global_delay_factor)
self.clear_buffer()

def check_config_mode(self, check_string=&#34;)#&#34;, pattern=&#34;&#34;):
&#34;&#34;&#34;
Expand All @@ -57,6 +60,20 @@ <h1 class="title">Module <code>netmiko.arista.arista</code></h1>
output = output.replace(&#34;(s2)&#34;, &#34;&#34;)
return check_string in output

def config_mode(self, config_command=&#34;configure terminal&#34;, pattern=&#34;&#34;, re_flags=0):
&#34;&#34;&#34;Force arista to read pattern all the way to prompt on the next line.&#34;&#34;&#34;

if not re_flags:
re_flags = re.DOTALL
check_string = re.escape(&#34;)#&#34;)

if not pattern:
pattern = re.escape(self.base_prompt[:16])
pattern = f&#34;{pattern}.*{check_string}&#34;
return super().config_mode(
config_command=config_command, pattern=pattern, re_flags=re_flags
)

def _enter_shell(self):
&#34;&#34;&#34;Enter the Bourne Shell.&#34;&#34;&#34;
return self.send_command(&#34;bash&#34;, expect_string=r&#34;[\$#]&#34;)
Expand Down Expand Up @@ -143,7 +160,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
<dl>
<dt id="netmiko.arista.arista.AristaBase"><code class="flex name class">
<span>class <span class="ident">AristaBase</span></span>
<span>(</span><span>ip='', host='', username='', password=None, secret='', port=None, device_type='', verbose=False, global_delay_factor=1, global_cmd_verify=None, use_keys=False, key_file=None, pkey=None, passphrase=None, allow_agent=False, ssh_strict=False, system_host_keys=False, alt_host_keys=False, alt_key_file='', ssh_config_file=None, conn_timeout=5, auth_timeout=None, banner_timeout=15, blocking_timeout=20, timeout=100, session_timeout=60, keepalive=0, default_enter=None, response_return=None, serial_settings=None, fast_cli=False, session_log=None, session_log_record_writes=False, session_log_file_mode='write', allow_auto_change=False, encoding='ascii', sock=None, auto_connect=True)</span>
<span>(</span><span>*args, **kwargs)</span>
</code></dt>
<dd>
<section class="desc"><p>Base Class for cisco-like behavior.</p>
Expand Down Expand Up @@ -280,15 +297,18 @@ <h2 class="section-title" id="header-classes">Classes</h2>
<details class="source">
<summary>Source code</summary>
<pre><code class="python">class AristaBase(CiscoSSHConnection):
def __init__(self, *args, **kwargs):
kwargs.setdefault(&#34;fast_cli&#34;, True)
kwargs.setdefault(&#34;_legacy_mode&#34;, False)
return super().__init__(*args, **kwargs)

def session_preparation(self):
&#34;&#34;&#34;Prepare the session after the connection has been established.&#34;&#34;&#34;
self._test_channel_read(pattern=r&#34;[&gt;#]&#34;)
cmd = &#34;terminal width 511&#34;
# Arista will echo immediately and then when the device really responds (like NX-OS)
self.set_terminal_width(command=cmd, pattern=r&#34;Width set to&#34;)
self.disable_paging(cmd_verify=False, pattern=r&#34;Pagination disabled&#34;)
self.set_base_prompt()
self.set_terminal_width(command=&#34;terminal width 511&#34;, pattern=&#34;terminal&#34;)
self.disable_paging()
# Clear the read buffer
time.sleep(0.3 * self.global_delay_factor)
self.clear_buffer()

def check_config_mode(self, check_string=&#34;)#&#34;, pattern=&#34;&#34;):
&#34;&#34;&#34;
Expand All @@ -309,6 +329,20 @@ <h2 class="section-title" id="header-classes">Classes</h2>
output = output.replace(&#34;(s2)&#34;, &#34;&#34;)
return check_string in output

def config_mode(self, config_command=&#34;configure terminal&#34;, pattern=&#34;&#34;, re_flags=0):
&#34;&#34;&#34;Force arista to read pattern all the way to prompt on the next line.&#34;&#34;&#34;

if not re_flags:
re_flags = re.DOTALL
check_string = re.escape(&#34;)#&#34;)

if not pattern:
pattern = re.escape(self.base_prompt[:16])
pattern = f&#34;{pattern}.*{check_string}&#34;
return super().config_mode(
config_command=config_command, pattern=pattern, re_flags=re_flags
)

def _enter_shell(self):
&#34;&#34;&#34;Enter the Bourne Shell.&#34;&#34;&#34;
return self.send_command(&#34;bash&#34;, expect_string=r&#34;[\$#]&#34;)
Expand Down Expand Up @@ -360,6 +394,28 @@ <h3>Methods</h3>
return check_string in output</code></pre>
</details>
</dd>
<dt id="netmiko.arista.arista.AristaBase.config_mode"><code class="name flex">
<span>def <span class="ident">config_mode</span></span>(<span>self, config_command='configure terminal', pattern='', re_flags=0)</span>
</code></dt>
<dd>
<section class="desc"><p>Force arista to read pattern all the way to prompt on the next line.</p></section>
<details class="source">
<summary>Source code</summary>
<pre><code class="python">def config_mode(self, config_command=&#34;configure terminal&#34;, pattern=&#34;&#34;, re_flags=0):
&#34;&#34;&#34;Force arista to read pattern all the way to prompt on the next line.&#34;&#34;&#34;

if not re_flags:
re_flags = re.DOTALL
check_string = re.escape(&#34;)#&#34;)

if not pattern:
pattern = re.escape(self.base_prompt[:16])
pattern = f&#34;{pattern}.*{check_string}&#34;
return super().config_mode(
config_command=config_command, pattern=pattern, re_flags=re_flags
)</code></pre>
</details>
</dd>
<dt id="netmiko.arista.arista.AristaBase.session_preparation"><code class="name flex">
<span>def <span class="ident">session_preparation</span></span>(<span>self)</span>
</code></dt>
Expand All @@ -369,13 +425,11 @@ <h3>Methods</h3>
<summary>Source code</summary>
<pre><code class="python">def session_preparation(self):
&#34;&#34;&#34;Prepare the session after the connection has been established.&#34;&#34;&#34;
self._test_channel_read(pattern=r&#34;[&gt;#]&#34;)
self.set_base_prompt()
self.set_terminal_width(command=&#34;terminal width 511&#34;, pattern=&#34;terminal&#34;)
self.disable_paging()
# Clear the read buffer
time.sleep(0.3 * self.global_delay_factor)
self.clear_buffer()</code></pre>
cmd = &#34;terminal width 511&#34;
# Arista will echo immediately and then when the device really responds (like NX-OS)
self.set_terminal_width(command=cmd, pattern=r&#34;Width set to&#34;)
self.disable_paging(cmd_verify=False, pattern=r&#34;Pagination disabled&#34;)
self.set_base_prompt()</code></pre>
</details>
</dd>
</dl>
Expand All @@ -388,7 +442,6 @@ <h3>Inherited members</h3>
<li><code><a title="netmiko.cisco_base_connection.CiscoSSHConnection.clear_buffer" href="../base_connection.html#netmiko.base_connection.BaseConnection.clear_buffer">clear_buffer</a></code></li>
<li><code><a title="netmiko.cisco_base_connection.CiscoSSHConnection.close_session_log" href="../base_connection.html#netmiko.base_connection.BaseConnection.close_session_log">close_session_log</a></code></li>
<li><code><a title="netmiko.cisco_base_connection.CiscoSSHConnection.commit" href="../base_connection.html#netmiko.base_connection.BaseConnection.commit">commit</a></code></li>
<li><code><a title="netmiko.cisco_base_connection.CiscoSSHConnection.config_mode" href="../cisco_base_connection.html#netmiko.cisco_base_connection.CiscoBaseConnection.config_mode">config_mode</a></code></li>
<li><code><a title="netmiko.cisco_base_connection.CiscoSSHConnection.disable_paging" href="../base_connection.html#netmiko.base_connection.BaseConnection.disable_paging">disable_paging</a></code></li>
<li><code><a title="netmiko.cisco_base_connection.CiscoSSHConnection.disconnect" href="../base_connection.html#netmiko.base_connection.BaseConnection.disconnect">disconnect</a></code></li>
<li><code><a title="netmiko.cisco_base_connection.CiscoSSHConnection.enable" href="../cisco_base_connection.html#netmiko.cisco_base_connection.CiscoBaseConnection.enable">enable</a></code></li>
Expand Down Expand Up @@ -519,7 +572,7 @@ <h3>Inherited members</h3>
</dd>
<dt id="netmiko.arista.arista.AristaSSH"><code class="flex name class">
<span>class <span class="ident">AristaSSH</span></span>
<span>(</span><span>ip='', host='', username='', password=None, secret='', port=None, device_type='', verbose=False, global_delay_factor=1, global_cmd_verify=None, use_keys=False, key_file=None, pkey=None, passphrase=None, allow_agent=False, ssh_strict=False, system_host_keys=False, alt_host_keys=False, alt_key_file='', ssh_config_file=None, conn_timeout=5, auth_timeout=None, banner_timeout=15, blocking_timeout=20, timeout=100, session_timeout=60, keepalive=0, default_enter=None, response_return=None, serial_settings=None, fast_cli=False, session_log=None, session_log_record_writes=False, session_log_file_mode='write', allow_auto_change=False, encoding='ascii', sock=None, auto_connect=True)</span>
<span>(</span><span>*args, **kwargs)</span>
</code></dt>
<dd>
<section class="desc"><p>Base Class for cisco-like behavior.</p>
Expand Down Expand Up @@ -675,7 +728,7 @@ <h3>Inherited members</h3>
<li><code><a title="netmiko.arista.arista.AristaBase.clear_buffer" href="../base_connection.html#netmiko.base_connection.BaseConnection.clear_buffer">clear_buffer</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.close_session_log" href="../base_connection.html#netmiko.base_connection.BaseConnection.close_session_log">close_session_log</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.commit" href="../base_connection.html#netmiko.base_connection.BaseConnection.commit">commit</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.config_mode" href="../cisco_base_connection.html#netmiko.cisco_base_connection.CiscoBaseConnection.config_mode">config_mode</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.config_mode" href="#netmiko.arista.arista.AristaBase.config_mode">config_mode</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.disable_paging" href="../base_connection.html#netmiko.base_connection.BaseConnection.disable_paging">disable_paging</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.disconnect" href="../base_connection.html#netmiko.base_connection.BaseConnection.disconnect">disconnect</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.enable" href="../cisco_base_connection.html#netmiko.cisco_base_connection.CiscoBaseConnection.enable">enable</a></code></li>
Expand Down Expand Up @@ -874,7 +927,7 @@ <h3>Inherited members</h3>
<li><code><a title="netmiko.arista.arista.AristaBase.clear_buffer" href="../base_connection.html#netmiko.base_connection.BaseConnection.clear_buffer">clear_buffer</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.close_session_log" href="../base_connection.html#netmiko.base_connection.BaseConnection.close_session_log">close_session_log</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.commit" href="../base_connection.html#netmiko.base_connection.BaseConnection.commit">commit</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.config_mode" href="../cisco_base_connection.html#netmiko.cisco_base_connection.CiscoBaseConnection.config_mode">config_mode</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.config_mode" href="#netmiko.arista.arista.AristaBase.config_mode">config_mode</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.disable_paging" href="../base_connection.html#netmiko.base_connection.BaseConnection.disable_paging">disable_paging</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.disconnect" href="../base_connection.html#netmiko.base_connection.BaseConnection.disconnect">disconnect</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.enable" href="../cisco_base_connection.html#netmiko.cisco_base_connection.CiscoBaseConnection.enable">enable</a></code></li>
Expand Down Expand Up @@ -932,6 +985,7 @@ <h1>Index</h1>
<h4><code><a title="netmiko.arista.arista.AristaBase" href="#netmiko.arista.arista.AristaBase">AristaBase</a></code></h4>
<ul class="">
<li><code><a title="netmiko.arista.arista.AristaBase.check_config_mode" href="#netmiko.arista.arista.AristaBase.check_config_mode">check_config_mode</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.config_mode" href="#netmiko.arista.arista.AristaBase.config_mode">config_mode</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.session_preparation" href="#netmiko.arista.arista.AristaBase.session_preparation">session_preparation</a></code></li>
</ul>
</li>
Expand Down
6 changes: 3 additions & 3 deletions docs/netmiko/arista/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ <h3>Inherited members</h3>
</dd>
<dt id="netmiko.arista.AristaSSH"><code class="flex name class">
<span>class <span class="ident">AristaSSH</span></span>
<span>(</span><span>ip='', host='', username='', password=None, secret='', port=None, device_type='', verbose=False, global_delay_factor=1, global_cmd_verify=None, use_keys=False, key_file=None, pkey=None, passphrase=None, allow_agent=False, ssh_strict=False, system_host_keys=False, alt_host_keys=False, alt_key_file='', ssh_config_file=None, conn_timeout=5, auth_timeout=None, banner_timeout=15, blocking_timeout=20, timeout=100, session_timeout=60, keepalive=0, default_enter=None, response_return=None, serial_settings=None, fast_cli=False, session_log=None, session_log_record_writes=False, session_log_file_mode='write', allow_auto_change=False, encoding='ascii', sock=None, auto_connect=True)</span>
<span>(</span><span>*args, **kwargs)</span>
</code></dt>
<dd>
<section class="desc"><p>Base Class for cisco-like behavior.</p>
Expand Down Expand Up @@ -293,7 +293,7 @@ <h3>Inherited members</h3>
<li><code><a title="netmiko.arista.arista.AristaBase.clear_buffer" href="../base_connection.html#netmiko.base_connection.BaseConnection.clear_buffer">clear_buffer</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.close_session_log" href="../base_connection.html#netmiko.base_connection.BaseConnection.close_session_log">close_session_log</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.commit" href="../base_connection.html#netmiko.base_connection.BaseConnection.commit">commit</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.config_mode" href="../cisco_base_connection.html#netmiko.cisco_base_connection.CiscoBaseConnection.config_mode">config_mode</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.config_mode" href="arista.html#netmiko.arista.arista.AristaBase.config_mode">config_mode</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.disable_paging" href="../base_connection.html#netmiko.base_connection.BaseConnection.disable_paging">disable_paging</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.disconnect" href="../base_connection.html#netmiko.base_connection.BaseConnection.disconnect">disconnect</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.enable" href="../cisco_base_connection.html#netmiko.cisco_base_connection.CiscoBaseConnection.enable">enable</a></code></li>
Expand Down Expand Up @@ -492,7 +492,7 @@ <h3>Inherited members</h3>
<li><code><a title="netmiko.arista.arista.AristaBase.clear_buffer" href="../base_connection.html#netmiko.base_connection.BaseConnection.clear_buffer">clear_buffer</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.close_session_log" href="../base_connection.html#netmiko.base_connection.BaseConnection.close_session_log">close_session_log</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.commit" href="../base_connection.html#netmiko.base_connection.BaseConnection.commit">commit</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.config_mode" href="../cisco_base_connection.html#netmiko.cisco_base_connection.CiscoBaseConnection.config_mode">config_mode</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.config_mode" href="arista.html#netmiko.arista.arista.AristaBase.config_mode">config_mode</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.disable_paging" href="../base_connection.html#netmiko.base_connection.BaseConnection.disable_paging">disable_paging</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.disconnect" href="../base_connection.html#netmiko.base_connection.BaseConnection.disconnect">disconnect</a></code></li>
<li><code><a title="netmiko.arista.arista.AristaBase.enable" href="../cisco_base_connection.html#netmiko.cisco_base_connection.CiscoBaseConnection.enable">enable</a></code></li>
Expand Down
12 changes: 9 additions & 3 deletions docs/netmiko/aruba/aruba_ssh.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
<meta name="generator" content="pdoc 0.6.3" />
<title>netmiko.aruba.aruba_ssh API documentation</title>
<meta name="description" content="Aruba OS support" />
<meta name="description" content="Aruba OS support" />
<link href='https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.0/normalize.min.css' rel='stylesheet'>
<link href='https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/8.0.0/sanitize.min.css' rel='stylesheet'>
<link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css" rel="stylesheet">
Expand All @@ -20,10 +20,16 @@
<h1 class="title">Module <code>netmiko.aruba.aruba_ssh</code></h1>
</header>
<section id="section-intro">
<p>Aruba OS support</p>
<p>Aruba OS support.</p>
<p>For use with Aruba OS Controllers.</p>
<details class="source">
<summary>Source code</summary>
<pre><code class="python">&#34;&#34;&#34;Aruba OS support&#34;&#34;&#34;
<pre><code class="python">&#34;&#34;&#34;
Aruba OS support.

For use with Aruba OS Controllers.

&#34;&#34;&#34;
import time
import re
from netmiko.cisco_base_connection import CiscoSSHConnection
Expand Down
2 changes: 1 addition & 1 deletion docs/netmiko/aruba/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h2 class="section-title" id="header-submodules">Sub-modules</h2>
<dl>
<dt><code class="name"><a title="netmiko.aruba.aruba_ssh" href="aruba_ssh.html">netmiko.aruba.aruba_ssh</a></code></dt>
<dd>
<section class="desc"><p>Aruba OS support</p></section>
<section class="desc"><p>Aruba OS support</p></section>
</dd>
</dl>
</section>
Expand Down
Loading

0 comments on commit 20034ce

Please sign in to comment.