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

Reply
L0 Member

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

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

L1 Bithead

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

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

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

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

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!