[j-nsp] JunOScript question

Phil Shafer phil at juniper.net
Fri Jun 13 12:36:08 EDT 2003


Harshit Kumar writes:
>Try this ...
>
> <get-configuration> <configuration> <policy-options/> </configuration>
></get-configuration>
>
>To get "show config interfaces" do this 
>
> <get-configuration> <configuration> <interfaces/> </configuration>
></get-configuration>

You'll need to add database="commited" to get same output
as "show configuration ...". It defaults to the candidate
configuration database.

<rpc>
  <get-configuration database="commited">
    <configuration>
      <policy-options/>
    </configuration>
  </get-configuration>
</rpc>
  

>I missed one point. How do I get a portion of the configuration in XML
>"WITH PERL" ?

I'm a bit rusty on the perl stuff, but it looks like you just need:

 $jnx->get_configuration(database => "commited", configuration = $dom);

where $dom is a dom tree containing "<configuration> <policy-options/> </configuration>".

(Which is a bit tacky. We should be able to make it just:

 $jnx->get_configuration(database => "commited", configuration = "<policy-options/>");

I'll confirm this and PR it if need be.)

Thanks,
 Phil


More information about the juniper-nsp mailing list