<?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: API Feature request or how to do this? in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-feature-request-or-how-to-do-this/m-p/68240#M1180</link>
    <description>&lt;P&gt;if you already need the configuration for something else in your script or if this wouldn't be a problem you could get the config with one api call and then get from this file the dependencies where this interface is used and from there create the dependency delete calls for vsys,zone and virtual-router. After deleting them you can issue the command I already posted to reset the interface.&lt;/P&gt;</description>
    <pubDate>Mon, 16 Nov 2015 18:01:43 GMT</pubDate>
    <dc:creator>Remo</dc:creator>
    <dc:date>2015-11-16T18:01:43Z</dc:date>
    <item>
      <title>API Feature request or how to do this?</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-feature-request-or-how-to-do-this/m-p/65423#M1171</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;I am working on an automation solution where-by I need to add interfaces or sub-interfaces for tenants. Now the problem I have run into is in cases where an interface has been used previously and either not reset back to default config properly or at all. In these cases when I try to commit configuration I run into issues with interface being members in VLAN's, VR's or zones etc. To get around this I need to perform a barrage of calls to the API to check all zone, VR, VLAN &amp;nbsp;etc and grep on members and then if the interface in question is a member I need to remove it by delete calls.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the ideal scenario would be an API call to reset an interface to a default state. Sort of like a factory reset. Or if that is not doable a way to get all dependencies (memberships) of interfaces in one call at least reducing the amount of API calls I need to make by 50% (i.e. leaving only the delete calls).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I approaching this wrong or has anyone else run into this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT: Actually best way to do this that I can think of now is simply reading in the whole config into array and then do all queries on the array before sending the delete API calls.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Jorgen&lt;/P&gt;</description>
      <pubDate>Sat, 03 Oct 2015 18:49:03 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-feature-request-or-how-to-do-this/m-p/65423#M1171</guid>
      <dc:creator>jorgen.boberg</dc:creator>
      <dc:date>2015-10-03T18:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: API Feature request or how to do this?</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-feature-request-or-how-to-do-this/m-p/68211#M1178</link>
      <description>&lt;P&gt;Hi Jorgen,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could use this command to delete the interface (actually it sets everything on that interface to default):&lt;/P&gt;
&lt;P&gt;https://FIREWALLNAME/api/?type=config&amp;amp;action=delete&amp;amp;xpath=/config/devices/entry[@name='localhost.localdomain']/network/interface/ethernet/entry[@name='ethernet1/XX']&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On a vsys-enabled firewall you first have to unlink the interface from the vsys, (sorry, but I don't know the command for doing that at the moment)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope it helps,&lt;/P&gt;
&lt;P&gt;Remo&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2015 12:53:08 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-feature-request-or-how-to-do-this/m-p/68211#M1178</guid>
      <dc:creator>Remo</dc:creator>
      <dc:date>2015-11-16T12:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: API Feature request or how to do this?</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-feature-request-or-how-to-do-this/m-p/68226#M1179</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Thanks. However&amp;nbsp;that doesn't work. But at least it gives the error message and notes the references which I can use to plugin to the script and try again instead of searching the whole config for interface references.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See example below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;response status="error" code="10"&amp;gt;&lt;BR /&gt; &amp;lt;msg&amp;gt;&lt;BR /&gt; &amp;lt;line&amp;gt;ethernet1/3 cannot be deleted because of references from:&amp;lt;/line&amp;gt;&lt;BR /&gt; &amp;lt;line&amp;gt;layer3 zone -&amp;gt; muuu -&amp;gt; network -&amp;gt; layer3&amp;lt;/line&amp;gt;&lt;BR /&gt; &amp;lt;line&amp;gt;interface network -&amp;gt; virtual-router -&amp;gt; test-vr -&amp;gt; interface&amp;lt;/line&amp;gt;&lt;BR /&gt; &amp;lt;/msg&amp;gt;&lt;BR /&gt;&amp;lt;/response&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I could do something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Delete interfaceXX&lt;/P&gt;
&lt;P&gt;If success&amp;nbsp;&lt;/P&gt;
&lt;P&gt;then end&lt;/P&gt;
&lt;P&gt;else&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if &amp;nbsp;/reference/&lt;/P&gt;
&lt;P&gt;then&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;if /zone/&lt;/P&gt;
&lt;P&gt;&amp;nbsp; delete &amp;nbsp;int from zone&lt;/P&gt;
&lt;P&gt;&amp;nbsp;fi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;if /virtual-router/&lt;/P&gt;
&lt;P&gt;&amp;nbsp; delete int from vr&lt;/P&gt;
&lt;P&gt;&amp;nbsp;fi&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="line-height: 20px;"&gt;fi&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="line-height: 20px;"&gt;else&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;fail&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;// jpb&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2015 14:33:16 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-feature-request-or-how-to-do-this/m-p/68226#M1179</guid>
      <dc:creator>jorgen.boberg</dc:creator>
      <dc:date>2015-11-16T14:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: API Feature request or how to do this?</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-feature-request-or-how-to-do-this/m-p/68240#M1180</link>
      <description>&lt;P&gt;if you already need the configuration for something else in your script or if this wouldn't be a problem you could get the config with one api call and then get from this file the dependencies where this interface is used and from there create the dependency delete calls for vsys,zone and virtual-router. After deleting them you can issue the command I already posted to reset the interface.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2015 18:01:43 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-feature-request-or-how-to-do-this/m-p/68240#M1180</guid>
      <dc:creator>Remo</dc:creator>
      <dc:date>2015-11-16T18:01:43Z</dc:date>
    </item>
  </channel>
</rss>

