pyangbind icon indicating copy to clipboard operation
pyangbind copied to clipboard

Getting specific state data from within a container

Open muffizone opened this issue 6 years ago • 0 comments

I am currently trying to fetch a specific state container from the network-instance model.

I would like to fetch only certain state leafs from the container. Is there any way I can request this in pyangbind ?

xml snippet

<network-instances xmlns="http://openconfig.net/yang/network-instance">
      <network-instance>
        <protocols>
          <protocol>
            <bgp>
              <neighbors>
                <neighbor>
                  <afi-safis>
                    <afi-safi>
                      <state/>
                      <afi-safi-name xmlns:idx="http://openconfig.net/yang/bgp-types">idx:L2VPN_EVPN</afi-safi-name>
                      <active/> 
                      <enabled/>
                    </afi-safi>
                  </afi-safis>
                   <neighbor-address>192.0.2.0</neighbor-address>
                </neighbor>
              </neighbors>
            </bgp>
            <identifier xmlns:idx="http://openconfig.net/yang/policy-types">idx:BGP</identifier>
            <name>default</name>
          </protocol>
        </protocols>
        <name>default</name>
      </network-instance>
    </network-instances>

For e.g. , If I only need the active and enabled leaf for the specified neighbor. Is there any empty value or a method we can set for such leafs in pyangbind so that it can be serialized into json/xml

muffizone avatar Sep 13 '19 01:09 muffizone