Changing Metric of Static Route using API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Changing Metric of Static Route using API

L0 Member

All, trying to send a command via the API to change the metric value of a static route, this is because occassionally my primary connection is extremely slow, but doesnt fail so path monitoring doesnt remove the primary static route. I'd like to be able to integrate this into some other home automation I have.

 

I feel like I'm close, but cant seem to get the correct syntax from debug CLI ouput, I've done it with SET commands easily enough.

 

 

 

The below returns an error:

 

<response status="error" code="13">
<msg>
<line>set failed, may need to override template object first</line>
</msg>
</response>
 

My not working command:

https://FIREWALL/api?key=APIKEY&type=config&action=set&xpath=/config/devices/entry[@name='localhost.localdomain']/network/virtual-router/entry[@name='default']/routing-table/ip/static-route/entry[@name='Backup Default Route']/metric&element=<'entry name='200''/>

 

My Debug CLI output after successful SET command:

<request cmd="set" obj="/config/devices/entry[@name='localhost.localdomain']/network/virtual-router/entry[@name='default']/routing-table/ip/static-route/entry[@name='Backup Default Route']" cookie="7921424603090921"><metric>200</metric></request>

 

As a bonus, the commit command for the API would also be nice 🙂

 

Help would be appreciated.

1 accepted solution

Accepted Solutions

L4 Transporter

Hello @Kris.Pamphilon 

 

Try it with ...[@name='Backup Default Route']&element=<metric>200</metric>

View solution in original post

2 REPLIES 2

L4 Transporter

Hello @Kris.Pamphilon 

 

Try it with ...[@name='Backup Default Route']&element=<metric>200</metric>

Absoluletly perfect!

 

Thankyou very much!

  • 1 accepted solution
  • 4394 Views
  • 2 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!