04-24-2022 01:36 AM
Hello,
What is the proper way to add network to OSPF on router via Feature on Pyats?
from genie.libs.conf.ospf import Ospf
I cannot find method "add_network" but it is specified in Ospf feature model.
04-25-2022 04:40 AM
@aidariys5 Get the pyATS Library functionality that you need to create each feature, for example
from genie.conf.base import Interface from genie.libs.conf.ospf import Ospf from genie.libs.conf.isis import Isis from genie.libs.conf.rip import Rip
https://pubhub.devnetcloud.com/media/pyats-getting-started/docs/quickstart/configuredevices.html
Hope this helps.
04-25-2022 01:22 PM
HI, thanks for reply. Let me bring more context. I'm trying to add network to ospf (like: network 1.1.1.0 0.0.0.255 area 0)
For example, I can specify instance and area_id:
from genie.libs.conf.ospf import Ospf r1_ospf.instance = '1' r1_ospf.area_id = '0'
But I cannot add network, such options is simply not available but probably I'm missing something.
If check https://pubhub.devnetcloud.com/media/genie-feature-browser/docs/_models/ospf.pdf, then you will find these two options:
area_network
area_network_wildcard
02-16-2023 01:23 PM - edited 02-16-2023 01:28 PM
Late answer: If your device type is NXOS the model does not support that
It is supported for IOSXE as you can see here
https://github.com/CiscoTestAutomation/genielibs/blob/master/pkgs/conf-pkg/src/genie/libs/conf/ospf/iosxe/tests/test_ospf.py#:~:text=an1%20%3D%20AreaNetwork,(an2)
Try these
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide