<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic XML API config options - edit ordelete to remove user from config rules ???? in General Topics</title>
    <link>https://live.paloaltonetworks.com/t5/general-topics/xml-api-config-options-edit-ordelete-to-remove-user-from-config/m-p/66724#M39303</link>
    <description>&lt;P&gt;I have a&amp;nbsp; question about the XML API config REST requests.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, do I need to explicitly request the commit lock in the API before making&lt;/P&gt;
&lt;P&gt;calls to edit or delete elements in a request (or is this done automatically by the API ?)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second, I am trying to delete a user from a rule set. Can I use the edit config to&lt;/P&gt;
&lt;P&gt;a blank member (like &amp;lt;member&amp;gt;&amp;lt;/member&amp;gt;) using XPath ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Third, if I use the delete action on the config call, do I need to first get the element ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for any help on actually using the XPath - I figured out how to position to the&lt;/P&gt;
&lt;P&gt;element using [@name='some name ...']. I am looking for a real world example on&lt;/P&gt;
&lt;P&gt;how the API works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for any help!&lt;/P&gt;</description>
    <pubDate>Fri, 16 Oct 2015 17:47:58 GMT</pubDate>
    <dc:creator>Robert-Wilmes</dc:creator>
    <dc:date>2015-10-16T17:47:58Z</dc:date>
    <item>
      <title>XML API config options - edit ordelete to remove user from config rules ????</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/xml-api-config-options-edit-ordelete-to-remove-user-from-config/m-p/66724#M39303</link>
      <description>&lt;P&gt;I have a&amp;nbsp; question about the XML API config REST requests.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, do I need to explicitly request the commit lock in the API before making&lt;/P&gt;
&lt;P&gt;calls to edit or delete elements in a request (or is this done automatically by the API ?)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second, I am trying to delete a user from a rule set. Can I use the edit config to&lt;/P&gt;
&lt;P&gt;a blank member (like &amp;lt;member&amp;gt;&amp;lt;/member&amp;gt;) using XPath ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Third, if I use the delete action on the config call, do I need to first get the element ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for any help on actually using the XPath - I figured out how to position to the&lt;/P&gt;
&lt;P&gt;element using [@name='some name ...']. I am looking for a real world example on&lt;/P&gt;
&lt;P&gt;how the API works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for any help!&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2015 17:47:58 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/xml-api-config-options-edit-ordelete-to-remove-user-from-config/m-p/66724#M39303</guid>
      <dc:creator>Robert-Wilmes</dc:creator>
      <dc:date>2015-10-16T17:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: XML API config options - edit ordelete to remove user from config rules ????</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/xml-api-config-options-edit-ordelete-to-remove-user-from-config/m-p/67023#M39403</link>
      <description>&lt;P&gt;To delete a single member object in a configuration use type=config&amp;amp;action=delete. I don't think you can edit a member to blank.&lt;BR /&gt;&lt;BR /&gt;Then use the object name in the xpath as member[text()=’name’]. For example, to delete a source-user object named 'acme\bob' in a group of source users, use the below xpath: &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;xpath=/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='&amp;lt;vsysname&amp;gt;']/rulebase/security/rules/entry[@name='&amp;lt;rulename&amp;gt;']/source-user/member[text()='acme\bob']&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;An example using curl.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;curl -k "https://&amp;lt;source_ip&amp;gt;/api/?type=config&amp;amp;action=delete&amp;amp;xpath=/config/devices/entry\[@name='localhost.localdomain'\]/vsys/entry\[@name='&amp;lt;vsys name&amp;gt;'\]/rulebase/security/rules/entry\[@name='&amp;lt;rule name&amp;gt;'\]/source-user/member\[text()='acme\bob'\]&amp;amp;key=&amp;lt;API-KEY&amp;gt;"&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;If you want to use a scripting language like python, use pan-python. &lt;A href="https://github.com/kevinsteves/pan-python" target="_blank"&gt;https://github.com/kevinsteves/pan-python&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2015 18:42:45 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/xml-api-config-options-edit-ordelete-to-remove-user-from-config/m-p/67023#M39403</guid>
      <dc:creator>fcasido</dc:creator>
      <dc:date>2015-10-21T18:42:45Z</dc:date>
    </item>
  </channel>
</rss>

