"missing =.id=" on `poe set` on RouterOS 7.11.2
Opened this issue · 2 comments
banderlog commented
Hi
When I am running this on RouterOS 7.11.2:
connection = routeros_api.RouterOsApiPool(IP, username=USER, password=PWD, plaintext_login=True)
api = connection.get_api()
api.get_resource('/interface/ethernet/poe').call('set', {'name': port_name, 'poe-out': 'off'})
I get next error:
RouterOsApiCommunicationError: ('Error "missing =.id=" executing command b\'/interface/ethernet/poe/set =name=ether5 =poe-out=off .tag=3\'', b'missing =.id=')
With RouterOS 7.9.2 everything is fine. Please help
banderlog commented
Had to add ".id"
key
api.get_resource('/interface/ethernet/poe').call('set', {'name': port_name, 'poe-out': 'forced-on', ".id": "*2"})
".id" COuld be obtained from api.get_resource('/interface/ethernet').call('print')
:
{'id': '*1',
'name': 'ether1',
'default-name': 'ether1',
'mtu': '1500',
...
banderlog commented
For RouterOs 6.49.15 (2024-Apr-24 16:04) one must use .id
only. With 'name' command will just not work without any error
api.get_resource('/interface/ethernet/poe').call('set', {'poe-out': 'forced-on', ".id": "*2"})