API call for nat-policy-addresses

Reply
Highlighted
L3 Networker

API call for nat-policy-addresses

Hello Community,

we would use an API to see the output of show running nat-policy-addresses command for each vsys.

The following API work properly when on the firewall there is only one vsys.

 

https://<firewall-IP>/api/?type=op&cmd=%3Cshow%3E%3Crunning%3E%3Cnat-policy-addresses%3E%3C%2Fnat-policy-addresses%3E%3C%2Frunning%3E%3C%2Fshow%3E&key=<APIKEY>

 

We have multiple virtual system and we need to have the output for each vsys.

From CLI we get it with two different command:

 

>set system setting target-vsys <value>

and 

>show running nat-policy-addresses

 

It seems there is no way to specify the vsys into this specific API call.

Do you know if is it possible to have this information?

 

Thanks in advance.

Jacopo

Tags (2)
L4 Transporter

Re: API call for nat-policy-addresses

Hope this helps.

Change the vsys to specific vsys number. 

 

CLI:

show config running xpath devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/rulebase/nat/rules

API:

"<show><config><running><xpath>devices/entry[@name=&apos;localhost.localdomain&apos;]/vsys/entry[@name=&apos;vsys1&apos;]/rulebase/nat/rules</xpath></running></config></show>"

 

 

L3 Networker

Re: API call for nat-policy-addresses

Hi @Sly_Cooper,

Thanks for your help. The API that you suggested retrive the NAT rulebase and not nat-policy-addresses.

We need to retrive the IP addresses and not the name of objects used into the NAT rules.

 

Thanks in advance.

Jacopo

L4 Transporter

Re: API call for nat-policy-addresses

You should be able to append  "&vsys={vsys_name}" to your request to target a specific vsys

 

This should work for any op command in a multi-vsys system

L4 Transporter

Re: API call for nat-policy-addresses

@Jacopo_ViganoI have similar requirements and I am trying to solve the problem via python script (work in progress). I dont think there is any direct way to map address to ip.

L3 Networker

Re: API call for nat-policy-addresses

@Sly_Cooper, I'm quite sure that with a script should work fine.

 

Thanks!

Jacopo

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 Live Community as a whole!

The Live Community thanks you for your participation!