<?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 Re: Trouble deleting custom url category using API in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/trouble-deleting-custom-url-category-using-api/m-p/17771#M458</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To delete multiple you can use an XPath with 'or':&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[text()='foo' or text()='bar']&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete does not use an element argument, only xpath.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set is 'merge at XPath node', edit is 'replace at XPath node'.&lt;/P&gt;&lt;P&gt;for edit your example will need the member elements in &amp;lt;list&amp;gt;&amp;lt;/list&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also see this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A __default_attr="16433" __jive_macro_name="message" class="jive_macro jive_macro_message" href="https://live.paloaltonetworks.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Feb 2013 18:50:24 GMT</pubDate>
    <dc:creator>ksteves</dc:creator>
    <dc:date>2013-02-27T18:50:24Z</dc:date>
    <item>
      <title>Trouble deleting custom url category using API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/trouble-deleting-custom-url-category-using-api/m-p/17768#M455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to delete a specific custom-url-category list member using the XML API.&amp;nbsp; The system either responds with an object not found error or it deletes all members in the list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I get when i show lists:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;response status="success" code="19"&amp;gt;&amp;lt;result total-count="1" count="1"&amp;gt;&amp;lt;list admin="admin" time="2012/05/25 21:59:11"&amp;gt;&amp;lt;member admin="admin" time="2012/05/25 21:59:04"&amp;gt;www.somesite.com&amp;lt;/member&amp;gt;&amp;lt;member admin="admin" time="2012/05/25 21:59:11"&amp;gt;chris.com&amp;lt;/member&amp;gt;&amp;lt;/list&amp;gt;&amp;lt;/result&amp;gt;&amp;lt;/response&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the command that I am using that deletes all records:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;wget "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://x.x.x.x/api/?type=config&amp;amp;action=delete&amp;amp;key=key&amp;amp;xpath=/config/devices/entry/vsys/entry"&gt;https://x.x.x.x/api/?type=config&amp;amp;action=delete&amp;amp;key=key&amp;amp;xpath=/config/devices/entry/vsys/entry&lt;/A&gt;&lt;SPAN&gt;[@name='vsys1']/profiles/custom-url-category/entry[@name='CIRT_Blocks']/list&amp;amp;element=&amp;lt;member&amp;gt;chris.com&amp;lt;/member&amp;gt;" --no-check-certificate -O response.txt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This command returns not found:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;wget "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://x.x.x.x/api/?type=config&amp;amp;action=delete&amp;amp;key=key&amp;amp;xpath=/config/devices/entry/vsys/entry"&gt;https://x.x.x.x/api/?type=config&amp;amp;action=delete&amp;amp;key=key&amp;amp;xpath=/config/devices/entry/vsys/entry&lt;/A&gt;&lt;SPAN&gt;[@name='vsys1']/profiles/custom-url-category/entry[@name='CIRT_Blocks']/list/member['chris.com']" --no-check-certificate -O response.txt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;wget "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://x.x.x.x/api/?type=config&amp;amp;action=delete&amp;amp;key=key&amp;amp;xpath=/config/devices/entry/vsys/entry"&gt;https://x.x.x.x/api/?type=config&amp;amp;action=delete&amp;amp;key=key&amp;amp;xpath=/config/devices/entry/vsys/entry&lt;/A&gt;&lt;SPAN&gt;[@name='vsys1']/profiles/custom-url-category/entry[@name='CIRT_Blocks']/list[@member='chris.com']" --no-check-certificate -O response.txt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I delete a single member from the list?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2012 22:22:48 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/trouble-deleting-custom-url-category-using-api/m-p/17768#M455</guid>
      <dc:creator>myrick3</dc:creator>
      <dc:date>2012-05-25T22:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble deleting custom url category using API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/trouble-deleting-custom-url-category-using-api/m-p/17769#M456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;[didn't like my reply with mutt; try again, this time with webui]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you want to use the XPath text() function, for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$ panxapi -t pa-200 -d "/config/devices/entry/vsys/entry/profiles/custom-url-category/entry[@name='t1']/list/member[text()='chris.com']"&lt;BR /&gt;delete: success: command succeeded&lt;BR /&gt;﻿&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: ksteves&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2012 23:53:14 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/trouble-deleting-custom-url-category-using-api/m-p/17769#M456</guid>
      <dc:creator>ksteves1</dc:creator>
      <dc:date>2012-05-25T23:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble deleting custom url category using API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/trouble-deleting-custom-url-category-using-api/m-p/17770#M457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how about deleting multiple URL's at the same time?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to do something where I dynamically update a custom url category.&amp;nbsp; I'm currently thinking on 2 calls to the API - one to add URL's that need to be added, the other to delete the ones that need to be deleted.&amp;nbsp; I can currently populate a list with the following options:&lt;/P&gt;&lt;P&gt;{'action': 'set',&lt;/P&gt;&lt;P&gt;'xpath': "/config/shared/profiles/custom-url-category/entry[@name='test']/list",&lt;/P&gt;&lt;P&gt;'type': 'config',&lt;/P&gt;&lt;P&gt;'key': 'RANDOM-LETTERS', &lt;/P&gt;&lt;P&gt;'element': '&amp;lt;member&amp;gt;www.apitest1.com&amp;lt;/member&amp;gt;&amp;lt;member&amp;gt;www.apitest2.com&amp;lt;/member&amp;gt;&amp;lt;member&amp;gt;www.apitest3.com&amp;lt;/member&amp;gt;'}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if I change the action from 'set' to 'delete', and element to 'element': '&amp;lt;member&amp;gt;www.apitest3.com&amp;lt;/member&amp;gt;' it whacks the whole custom category&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I change the action from 'set' to 'edit' (and use the same element as above - only www.apitest3.com) I get the following error:&lt;/P&gt;&lt;P&gt;&amp;lt;response status="error" code="12"&amp;gt;&amp;lt;msg&amp;gt;&amp;lt;line&amp;gt;Edit breaks config validity&amp;lt;/line&amp;gt;&amp;lt;/msg&amp;gt;&amp;lt;/response&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Feb 2013 23:08:47 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/trouble-deleting-custom-url-category-using-api/m-p/17770#M457</guid>
      <dc:creator>cully_bennefield</dc:creator>
      <dc:date>2013-02-26T23:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble deleting custom url category using API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/trouble-deleting-custom-url-category-using-api/m-p/17771#M458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To delete multiple you can use an XPath with 'or':&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[text()='foo' or text()='bar']&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete does not use an element argument, only xpath.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set is 'merge at XPath node', edit is 'replace at XPath node'.&lt;/P&gt;&lt;P&gt;for edit your example will need the member elements in &amp;lt;list&amp;gt;&amp;lt;/list&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also see this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A __default_attr="16433" __jive_macro_name="message" class="jive_macro jive_macro_message" href="https://live.paloaltonetworks.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Feb 2013 18:50:24 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/trouble-deleting-custom-url-category-using-api/m-p/17771#M458</guid>
      <dc:creator>ksteves</dc:creator>
      <dc:date>2013-02-27T18:50:24Z</dc:date>
    </item>
  </channel>
</rss>

