- Unable to print the entire XML using the variables. Want to confirm is the original xml is what included in the 'interface_configuration' variable below. Since not able to discover it in the dictionary. If going about dumping the interface wrong, how to do it using this or similar modules. Have figured out how to print individual values from the interface_configuration, like interface-name.
- What is meant is mentioned below....
from ydk.services import CRUDService
from ydk.providers import NetconfServiceProvider
from ydk.models.cisco_ios_xr import Cisco_IOS_XR_ifmgr_cfg as xr_ifmgr_cfg
provider = NetconfServiceProvider(address="abc.123.com",
port=830,
username="me",
password="password",
protocol="ssh")
crud = CRUDService()
interface_configurations = xr_ifmgr_cfg.InterfaceConfigurations()
interface_configuration = crud.read(provider, interface_configurations)
## Now how to print the XML
print what???
provider.close() | |
exit() |
The print should be the massive <interface-configurations> xml tree.
Similar to: (not all shown)
<interface-configurations xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg"> | |
<interface-configuration> | |
<active>pre</active> | |
<interface-name>POS0/4/0/0</interface-name> | |
<description>CORE OC48 to po0/1/0/0-abc.123</description> | |
<cdp xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-cdp-cfg"> | |
<enable/> | |
</cdp> | |
<mtus> | |
<mtu> | |
<owner>pos</owner> | |
<mtu>4567</mtu> | |
</mtu> | |
</mtus> | |
<ipv4-network xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ipv4-io-cfg"> | |
<addresses> | |
<primary> | |
<address>123.456.789.000</address> | |
<netmask>255.255.255.252</netmask> |
... and all the rest of the interfaces...
Use the codec service as explained in this thread:
Comments
0 comments
Please sign in to leave a comment.