mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-24 21:14:00 -07:00
Exos httpapi (#54405)
* Modify EXOS module utils to utilize 'httpapi' or 'network-cli' connection * Changes to cliconf plugin to support 'json' or 'text' output for compatibility between network-cli and httpapi * Add HTTPAPI plugin supportng JSONRPC and RESTCONF for EXOS * exos_facts modify commands with run script cli2json.py to command dictionary specifying 'json' output Load appropriate fixtures * Update exos_config module to utilize the get_diff and get_default_flag functionality. JSONRPC doesn't work well with pipes, regex MULTILINE * Support for NOS agnostic 'cli_config' module by implementing 'get_default_flag' and 'get_diff' functionality * Update Ansible Documentation regarding the connections available for EXOS
This commit is contained in:
parent
b002f3e416
commit
9384773e1e
14 changed files with 735 additions and 200 deletions
|
|
@ -240,10 +240,10 @@ class Interfaces(FactsBase):
|
|||
|
||||
COMMANDS = [
|
||||
'show switch',
|
||||
'run script cli2json.py show port config',
|
||||
'run script cli2json.py show port description',
|
||||
'run script cli2json.py show vlan detail',
|
||||
'run script cli2json.py show lldp neighbors'
|
||||
{'command': 'show port config', 'output': 'json'},
|
||||
{'command': 'show port description', 'output': 'json'},
|
||||
{'command': 'show vlan detail', 'output': 'json'},
|
||||
{'command': 'show lldp neighbors', 'output': 'json'}
|
||||
]
|
||||
|
||||
def populate(self):
|
||||
|
|
@ -256,19 +256,19 @@ class Interfaces(FactsBase):
|
|||
if data:
|
||||
sysmac = self.parse_sysmac(data)
|
||||
|
||||
data = json.loads(self.responses[1])
|
||||
data = self.responses[1]
|
||||
if data:
|
||||
self.facts['interfaces'] = self.populate_interfaces(data, sysmac)
|
||||
|
||||
data = json.loads(self.responses[2])
|
||||
data = self.responses[2]
|
||||
if data:
|
||||
self.populate_interface_descriptions(data)
|
||||
|
||||
data = json.loads(self.responses[3])
|
||||
data = self.responses[3]
|
||||
if data:
|
||||
self.populate_vlan_interfaces(data, sysmac)
|
||||
|
||||
data = json.loads(self.responses[4])
|
||||
data = self.responses[4]
|
||||
if data:
|
||||
self.facts['neighbors'] = self.parse_neighbors(data)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue