Posted on December 16, 2021 3:39 pm
 |  Asked by prabin maharjan
 |  44 views
1
0
Print Friendly, PDF & Email

can i use pyeapi to connect to 7130 metamako?

Software image version: 0.23.1
Internal build ID: mos-0.23+38
Applications: metamux-2.1.7, metawatch-0.10.7, netconf-0.9

node= pyeapi.config_for(‘veos01’)
{‘host’: ‘192.168.1.1’, ‘username’: ‘admin’, ‘password’: ‘admin’, ‘enablepwd’: ‘1admin!!!’, ‘port’: ‘443’, ‘transport’: ‘https’}
node = pyeapi.connect_to(‘veos01’)
>>> node.
node.abort( node.config( node.enable( node.refresh( node.settings
node.api( node.configure_session( node.enable_authentication( node.run_commands( node.startup_config
node.autorefresh node.connection node.get_config( node.running_config node.version
node.commit( node.diff( node.model node.section( node.version_number

>>> node.running_config
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
File “/usr/local/lib/python3.6/site-packages/pyeapi/client.py”, line 496, in running_config
as_string=True)
File “/usr/local/lib/python3.6/site-packages/pyeapi/client.py”, line 837, in get_config
result = self.run_commands(command, ‘text’)
File “/usr/local/lib/python3.6/site-packages/pyeapi/client.py”, line 771, in run_commands
response = self._connection.execute(commands, encoding, **kwargs)
File “/usr/local/lib/python3.6/site-packages/pyeapi/eapilib.py”, line 554, in execute
response = self.send(request)
File “/usr/local/lib/python3.6/site-packages/pyeapi/eapilib.py”, line 473, in send
raise CommandError(code, msg, command_error=err, output=out)
pyeapi.eapilib.CommandError: Error [1002]: Command 1 out of 2 failed: {u’input’: u’1admin!!!’, u’cmd’: u’enable’} [‘dict’ object has no attribute ‘strip’]

0
Posted by John Gill
Answered on December 22, 2021 3:02 pm

You would need the EOS image instead of MOS, which hasn't always been available, but is now:
https://mako.arista.com/dyn/softwareportal/releases/#eos

1
Posted by prabin maharjan
Answered on December 23, 2021 7:05 pm

thank you for the response. I will check with local SE to upgrade EOS for 7130.

i tried JSON RPC API but when i send the command 2-3 times, there was slow response from metamako and after few min i couldn't ssh to device. so i have to disable API.

Post your Answer

You must be logged in to post an answer.