community.general/lib/ansible/module_utils/network
Chris Van Heuveln 7aa0d26fda nxos_bfd_global / NxosCmdRef initial commit (#56317)
* nxos_bfd_global: initial commit

This is an initial POC with just a few commands included.  The code has been written somewhat generically so that it can act as a best practices template for re-use in future modules. The implementation follows the yaml cmd_ref style to define each command's getter/setter/type/default. It supports platform-specific defaults.

The basic logic is to collect all relevant data in a `cmd_ref` dict and pass that around to various methods.

In the BFD case the devices don't provide JSON output so we have to screen-scrape with show runs.

BFD does not support present/absent states so there is no state param.

BFD has three different property types to handle. We can add add'l types as needed:

- int
- int_list (list of ints)
- str (needs support for 'no' keyword)

* Use get_capabilities to find platform type

* PR comment fixes, round 1

* Minor cleanups

* nxos_bfd_global: create NxosCmdRef in module_utils

This commit just takes the latest bfd global code and moves the bulk
of the code into new `class NxosCmdRef` in `module_utils/nxos/nxos.py`.

The only remaining code in `nxos_bfd_global.py` are the calls from `main()`.

* Add remaining command properties and documentation

* update argument_spec

* Add check for _exclude; add sanity test

* Add targets files for bfd

* Context and state absent updates

* Add dict support to cmd_ref

* Changed remaining list commands to dict usage

* Add idempotence check for dict

* Fix existing overwrite bug

* Move pattern matching logic into its own method

* add support for 'command: absent'

* Add `get_platform_shortname`; update BFD platform-specific settings

* /absent/deleted/

* /sh/show/ in prepare_nxos_tests

* add dict check to get_platform_shortname

* Add normalize_defaults()

* UTs for bfd_global

* support yaml for both py2/py3

* update cmd_ref doc header

* Fix python2.6 incompatibility with dict comprehensions

* Fix bfd_global doc header (yaml syntax fail)

* more shippable fixes

* yet more shippable fixes

* shippable: remove r' ' wrappers

* docfix - remove ':'

* escape regex ctl chars in yaml table

* remove extra blank lines

* Fix str(None) issue

* Command context updates

* import PY2,PY3 instead of import sys

* fix ordereddict import & parent_context

* try/except for yaml import

* fix import issue for ordereddict

* remove epdb

* nxosCmdRef_import_check() workaround for shippable

* fix PEP ws errors
2019-06-06 15:52:55 +05:30
..
a10 Update bare exceptions to specify Exception. 2018-12-16 15:03:19 -08:00
aci construct_deep_url() (#53475) 2019-05-23 00:46:43 +02:00
aireos Move _handle_no_log_values() out of basic.py (#48628) 2019-03-04 17:02:44 -05:00
aos Update bare exceptions to specify Exception. 2018-12-16 15:03:19 -08:00
aruba Move _handle_no_log_values() out of basic.py (#48628) 2019-03-04 17:02:44 -05:00
asa asa: Not all modules will have 'passwords' and 'context' keys (#54783) 2019-04-03 21:42:34 +05:30
avi Updated utils to remove Avi SDK dependency and Avi 18.2.2 version update (#54894) 2019-05-17 13:12:06 -04:00
bigswitch Refactor common network shared and platform utils code into package (#33452) 2017-12-03 21:42:30 +05:30
checkpoint Add autopublish and autoinstallpolicy behaviour to Checkpoint devices (#50862) 2019-01-15 11:03:48 +01:00
cloudengine fix bugs for ce (#54750) 2019-04-17 12:51:58 +05:30
cnos Lenovo cnos user module (#53763) 2019-03-27 19:22:05 +05:30
common Fix exception with load_provider function (#56959) 2019-05-28 12:19:34 -04:00
dellos6 Fix_dellos6_minor_issues (#52981) 2019-03-15 13:53:30 +05:30
dellos9 Move _handle_no_log_values() out of basic.py (#48628) 2019-03-04 17:02:44 -05:00
dellos10 Move _handle_no_log_values() out of basic.py (#48628) 2019-03-04 17:02:44 -05:00
edgeos Add missing ConnectionError imports (#45879) 2018-09-20 12:01:01 +10:00
edgeswitch new network module: edgeswitch_vlan (#48041) 2018-12-17 11:30:17 +05:30
enos Move _handle_no_log_values() out of basic.py (#48628) 2019-03-04 17:02:44 -05:00
eos eos_l2_interface handle "Interface does not exist" (#56787) 2019-05-23 17:02:46 +05:30
exos Exos httpapi (#54405) 2019-03-27 14:44:04 +01:00
f5 removes redundant functions (#53989) 2019-03-20 14:44:41 +00:00
fortimanager Fortinet FortiManager Module_Utils MINOR Update (#52756) 2019-03-04 10:56:06 +05:30
fortios Update bare exceptions to specify Exception. 2018-12-16 15:03:19 -08:00
frr frr: New module for BGP configuration management (#51281) 2019-03-04 15:02:56 +05:30
ftd Remove redundant defined variable (#55122) 2019-04-20 11:34:11 +05:30
ingate standardize TLS connection properties (#54315) 2019-03-28 00:19:28 -05:00
ios Revert nxos, ios, iosxr return_timestamps (#56206) 2019-05-08 20:49:29 +05:30
iosxr Added the 'show commit config diff' output available from the IOSXR device (#54875) 2019-05-27 17:30:14 +05:30
ironware Move _handle_no_log_values() out of basic.py (#48628) 2019-03-04 17:02:44 -05:00
junos Move _handle_no_log_values() out of basic.py (#48628) 2019-03-04 17:02:44 -05:00
meraki meraki_network - Restructure execution logic (#56818) 2019-06-05 10:33:55 -04:00
netconf Fixes Netconf_config single parameter bug (#56138) 2019-05-06 17:30:49 -04:00
netscaler Refactor common network shared and platform utils code into package (#33452) 2017-12-03 21:42:30 +05:30
netvisor Pluribus Networks network cli terminal and cliconf plugins (#53735) 2019-03-15 13:51:50 +05:30
nos new nos_command module (#43056) 2018-08-10 13:50:02 -07:00
nso NSO modules now work as expected with NSO 5.X (#54766) 2019-04-03 20:56:35 +01:00
nxos nxos_bfd_global / NxosCmdRef initial commit (#56317) 2019-06-06 15:52:55 +05:30
onyx Get Capabilities Support (#49880) 2018-12-14 09:45:31 +05:30
ordnance Refactor common network shared and platform utils code into package (#33452) 2017-12-03 21:42:30 +05:30
panos Add fw via panorama connectivity to panos connection (#52954) 2019-03-25 19:48:45 +05:30
restconf Restconf HTTPAPI plugin and modules (#49476) 2019-02-04 09:28:26 -05:00
routeros Move _handle_no_log_values() out of basic.py (#48628) 2019-03-04 17:02:44 -05:00
skydive PR to include support for Skydive Node and Edge modules with Ansible (#53112) 2019-03-13 16:22:31 +05:30
slxos Extreme Networks SLXOS Config Module (#38607) 2018-04-20 08:52:20 +01:00
sros Move _handle_no_log_values() out of basic.py (#48628) 2019-03-04 17:02:44 -05:00
voss New voss_config module (#47533) 2018-11-01 14:07:41 +05:30
vyos Move _handle_no_log_values() out of basic.py (#48628) 2019-03-04 17:02:44 -05:00
__init__.py Refactor common network shared and platform utils code into package (#33452) 2017-12-03 21:42:30 +05:30