Skip to content

Commit

Permalink
doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
ksator committed Jul 2, 2022
1 parent 6336313 commit 5fb881a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,6 @@ Have a quick look to the package documentation:

Here's how we can import and use the functions of the [anta](anta) package:

```python
>>> from anta.tests import *
>>> dir()
>>> help(verify_eos_version)
>>> help(verify_bgp_evpn_state)
>>> help(verify_interface_discards)
```

```python
>>> import ssl
>>> from jsonrpclib import Server
Expand All @@ -82,6 +74,17 @@ Here's how we can import and use the functions of the [anta](anta) package:
>>> IP = "192.168.0.12"
>>> URL=f'https://{USERNAME}:{PASSWORD}@{IP}/command-api'
>>> switch = Server(URL)
```

```python
>>> from anta.tests import *
>>> dir()
>>> help(verify_eos_version)
>>> help(verify_bgp_evpn_state)
>>> help(verify_interface_discards)
```

```python
>>> verify_eos_version(switch, ENABLE_PASSWORD, ["4.22.1F"])
>>> verify_bgp_ipv4_unicast_state(switch, ENABLE_PASSWORD)
>>> exit()
Expand Down
18 changes: 10 additions & 8 deletions documentation/requirements-and-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,18 +176,20 @@ from jsonrpclib import Server
ssl._create_default_https_context = ssl._create_unverified_context
USERNAME = "arista"
PASSWORD = "aristatwfn"
ENABLE_PASSWORD = "aristatwfn"
IP = "192.168.0.12"
URL=f'https://{USERNAME}:{PASSWORD}@{IP}/command-api'
switch = Server(url)
result=switch.runCmds(1,['show version'], 'text')
print(result[0]['output'])
switch = Server(URL)
result=switch.runCmds(1,['show version'], 'json')
print(result[0]['uptime'])
```

Run these python commands to validate you can import the [anta](anta) package
Run these python commands to validate you can import and use the [anta](anta) package

```python
>>> from anta.tests import *
>>> dir()
>>> help(verify_eos_version)
>>> exit()
from anta.tests import *
dir()
help(verify_bgp_ipv4_unicast_state)
verify_bgp_ipv4_unicast_state(switch, ENABLE_PASSWORD)
exit()
```

0 comments on commit 5fb881a

Please sign in to comment.