Focus
Focus
Table of Contents

Edit Configuration

Useaction=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 ofaction=show).
  1. Replace the application(s) currently used in a rule rule1 with a new application:
    curl -X POST 'https://firewall/api?type=config&action=edit&xpath=xpath-value&element=element-value"
    where
    xpath=/config/devices/entry/vsys/entry/rulebase/security/rules/entry[@name='rule1']/application&element=<application><member>app-name</member></application>
  2. Use the response from the config show API request to create the XML body for the element.
    curl -X POST 'https://firewall/api?type=config&action=show"
  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 namedabc and xyz, use:
    curl -X POST 'https://firewall/api?type=config&action=edit&xpath=/config/devices/entry/vsys/entry[@name='vsys1']/address-group/entry[@name='test']&element=<entry name='test'><static><member>abc</member><member>xyz</member></static></entry>"