Junos Automation (Scripting)
Junos Automation (Scripting)

load override via NETCONF

‎02-14-2017 07:56 AM

Hello together,

 

have anyone a idea how I can realize a load override via NETCONF?

 

Thanks for your help.

3 REPLIES 3
Junos Automation (Scripting)

Re: load override via NETCONF

[ Edited ]
‎02-14-2017 10:27 AM

Hi,

 

Here is an example that should work (if I've got it right at least).

 

<rpc><lock><target><candidate/></target></lock></rpc>

<rpc><edit-config><target><candidate/></target><default-operation>replace</default-operation><error-option>stop-on-error</error-option><config-text><configuration-text>system {root-authentication plain-text-password-value juniper123;}</configuration-text></config-text></edit-config></rpc>

<rpc><commit-configuration><log>Some test</log></commit-configuration></rpc>

<rpc><unlock><target><candidate/></target></unlock></rpc>

<rpc><close-session/></rpc>

Further information can be found here:  http://www.juniper.net/documentation/en_US/junos/topics/task/configuration/netconf-configuration-set...

 

Regards,

Andy

Junos Automation (Scripting)

Re: load override via NETCONF

‎02-15-2017 03:02 AM

Thank you for your answer.

 

Now I have a rpc, looking like this:

<rpc>
<edit-config>
<target>
<candidate/>
</target>
<default-operation>replace</default-operation>
<url>/var/tmp/$configFileName</url>
</edit-config>
</rpc>

 

Now i got the error message: syntax error, expecting <configuration> or <configuration-text>

 

Do you have any idea, how I can fix this?

Junos Automation (Scripting)
Solution
Accepted by topic author LKlb
‎02-15-2017 05:19 AM

Re: load override via NETCONF

‎02-15-2017 03:29 AM

I did not realise you wanted to load the configuration via a file.  To load override configuration from a file or URL then you will have to use a different RPC.

 

Try the RPC <load-configuration> instead, documentation can be found at the following link:

 

http://www.juniper.net/documentation/en_US/junos/topics/reference/tag-summary/junos-xml-protocol-loa...

 

Regards,

Andy