From 5fb881a920a2548fc048eea5ed4eebad2b6cc4b1 Mon Sep 17 00:00:00 2001 From: khelil sator Date: Sat, 2 Jul 2022 19:01:31 +0200 Subject: [PATCH] doc update --- README.md | 19 +++++++++++-------- .../requirements-and-installation.md | 18 ++++++++++-------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 26dfdd6aa..2cac2f4e8 100755 --- a/README.md +++ b/README.md @@ -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 @@ -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() diff --git a/documentation/requirements-and-installation.md b/documentation/requirements-and-installation.md index 6366f0920..94e2a9541 100644 --- a/documentation/requirements-and-installation.md +++ b/documentation/requirements-and-installation.md @@ -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() ```