[j-nsp] Retrieving specific ID's from junoscript

Benny Amorsen benny+usenet at amorsen.dk
Tue Jan 3 08:13:09 EST 2012


In the continuing saga of automatic provisioning of a PE router, I am
still at the stage where I am trying to retrieve information...

More specifically, I would like to retrieve a specific a sub-interface.
For finding a specific interface, this works fine:

<get-configuration changed="changed"><configuration><interfaces><interface><name>ge-1/0/1</name></interface></interfaces></configuration></get-configuration>
<interfaces>
    <interface>
        <name junos:key='key'>ge-1/0/1</name>
        <flexible-vlan-tagging/>
        <mtu>9192</mtu>
        <encapsulation>flexible-ethernet-services</encapsulation>
        <unit>
            <name junos:key='key'>1017</name>
            <encapsulation>vlan-ccc</encapsulation>
            <vlan-id>1017</vlan-id>
        </unit>
        <unit>
            <name junos:key='key'>1018</name>
            <encapsulation>vlan-ccc</encapsulation>
            <vlan-id>1018</vlan-id>
        </unit>
    </interface>
</interfaces>

However, I can't figure out how to retrieve a specific subinterface,
like the unit 1017 above. It is obviously possible to just fetch them
all and search "by hand", but there will eventually be hundreds of
subinterfaces and it seems inefficient.

The obvious solution of replacing ge-1/0/1 with ge-1/0/1.1017 in the
request does not work.


/Benny




More information about the juniper-nsp mailing list