[j-nsp] JunOScript question

Joe Lin jlin at doradosoftware.com
Fri Jun 13 17:45:53 EDT 2003


When did it start to default to candidate configuration?


-----Original Message-----
From: juniper-nsp-bounces at puck.nether.net
[mailto:juniper-nsp-bounces at puck.nether.net] On Behalf Of Phil Shafer
Sent: Friday, June 13, 2003 8:36 AM
To: Harshit Kumar
Cc: juniper-nsp at puck.nether.net; Neil Stirling
Subject: Re: [j-nsp] JunOScript question 

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
_______________________________________________
juniper-nsp mailing list juniper-nsp at puck.nether.net
http://puck.nether.net/mailman/listinfo/juniper-nsp



More information about the juniper-nsp mailing list