Edit Configuration

Use
action=edit
to replace an existing object hierarchy at a specified location in the configuration with a new value. Use the xpath parameter to specify the location of the object, including the node to be replaced. Use the element parameter to specify a new value for the object using its XML object hierarchy (as seen in the output of
action=show
).
  1. Replace the application(s) currently used in a rule rule1 with a new application:
    curl -X GET "https://<firewall>/api/?type=config&action=edit&key=apikey&xpath=xpath-value&element=element-value"
    Code copied to clipboard
    Unable to copy due to lack of browser support.
    where
    xpath=/config/devices/entry/vsys/entry/rulebase/security/rules/entry[@name='rule1']/application&element=<application><member>app-name</member></application>
    Code copied to clipboard
    Unable to copy due to lack of browser support.
  2. Use the response from the config show API request to create the XML body for the element.
    curl -X GET "https://<firewall>/api/?key=apikey&type=config&action=show"
    Code copied to clipboard
    Unable to copy due to lack of browser support.
  3. Optionally replace all members in a node with a new set of members using the entry tag in both the xpath and element parameters. For example, to replace all the address objects in the address group named test with two new static members named
    abc
    and
    xyz
    , use:
    curl -X GET "https://<firewall>/api/?key=apikey&type=config&action=edit&xpath=/config/devices/entry/vsys/entry[@name='vsys1']/address-group/entry[@name='test']&element=<static><entry name='test'><member>abc</member><member>xyz</member></entry></static>"
    Code copied to clipboard
    Unable to copy due to lack of browser support.

Recommended For You