How to execute operational commands via XML API for selected virtual system

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

How to execute operational commands via XML API for selected virtual system

L0 Member

Hi,

 

Is it possible to execute operational commands via XML API for selected virtual system. E.g ?

https://<IP_address>/api/?type=op&cmd=<SOME_COMMAND_HERE>&key=<API_KEY> 

 Can I specify somehow in context of which VSYS this should be executed ? Is there any property which can be used ?

 

Regards,

Piotr

3 REPLIES 3

L1 Bithead

Hello @miduchp,

 

You can use operational commands in API the same way of the CLI:

- if you cannot use a command in the CLI, you cannot used in the API

For example with the CLI you can execute: show object static ip <ip/netmask> vsys <value>

So with the API you can use this request: /api/?type=op&cmd=<show><object><static><vsys>fwaws</vsys><ip>10.120.1.1</ip></static></object></sho...

 

You can navigate all XML URL using this link: https://<Firewall IP>/api

 

Kind Regards.

L4 Transporter

Append  "&vsys={vsys_name}" to your request to target a specific vsys

 

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

 

in your example:

https://<IP_address>/api/?type=op&cmd=<SOME_COMMAND_HERE>&key=<API_KEY>&vsys=vsys1

this is what im trying to accomplish but i keep getting errors. object_string will dynamically be learned in another part of my script. 

 

'https://johns.panorama.com/api/?type=op&cmd=<show><object><dynamic-address-group>'+object_string+'</dynamic-address-group></object></show>&key=' + api_key +'&vsys=Private'
 
Any suggestions
  • 4725 Views
  • 3 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!