<?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 How to deactivate  virtual PA firewall with API in General Topics</title>
    <link>https://live.paloaltonetworks.com/t5/general-topics/how-to-deactivate-virtual-pa-firewall-with-api/m-p/223612#M64284</link>
    <description>&lt;P&gt;Trying to deactivate a PA-VM firewall with the API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First I add the Licencing API key to the PA with the firewall API:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In order to hide my real values, let's use:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;myfirewall.corp as my firewall&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;cxvzvxvcxvczc as my firewall's API key&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;dgshgdjsgdjsgj as my licensing portal API key.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So for the deactivation process, I'm gonna add the&amp;nbsp;&lt;SPAN&gt;licensing portal API key to my firewall, and then deactivate.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I can add this API key via the cli or via the firewall API. I want to do everything with the API.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Add deactivation key&lt;BR /&gt;&lt;A href="https://live.paloaltonetworks.com/" target="_blank"&gt;https://myfirewall.corp//api/?key=cxvzvxvcxvczc&amp;amp;type=op&amp;amp;cmd=&amp;lt;request&amp;gt;&amp;lt;license&amp;gt;&amp;lt;api-key&amp;gt;&amp;lt;set&amp;gt;&amp;lt;key&amp;gt;dgshgdjsgdjsgj&amp;lt;/key&amp;gt;&amp;lt;/set&amp;gt;&amp;lt;/api-key&amp;gt;&amp;lt;/license&amp;gt;&amp;lt;/request&lt;/A&gt;&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this works. I can successfully use the CLI on the firewall to check that the key was added.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;request license api-key show&lt;/P&gt;&lt;P&gt;API key: &lt;SPAN&gt;dgshgdjsgdjsgj&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Next, I want to deactivate. I try the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Deactivate&lt;BR /&gt;&lt;A href="https://live.paloaltonetworks.com/" target="_blank"&gt;https://myfirewall.corp//api/?key=cxvzvxvcxvczc&amp;amp;type=op&amp;amp;cmd=&amp;lt;request&amp;gt;&amp;lt;license&amp;gt;&amp;lt;deactivate&amp;gt;&amp;lt;VM-Capacity&amp;gt;&amp;lt;mode&lt;/A&gt;&amp;gt;&lt;FONT color="#FF6600"&gt;auto&lt;/FONT&gt;&amp;lt;/mode&amp;gt;&amp;lt;/VM-Capacity&amp;gt;&amp;lt;/deactivate&amp;gt;&amp;lt;/license&amp;gt;&amp;lt;/request&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The response I get is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This XML file does not appear to have any style information associated with it. The document tree is shown below.&lt;BR /&gt;&amp;lt;response status="error"&amp;gt;&lt;BR /&gt;&amp;lt;msg&amp;gt;&lt;BR /&gt;&amp;lt;line&amp;gt;&lt;BR /&gt;(null) Error:Invalid or missing deactivation token Device doesn't belong to this support account.&lt;BR /&gt;&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;I do not want to log into the firewall GUI to deactivate, I'm trying to script this. How do I deactivate using the API. I followed the API browser on my firewall in order to get the above command, and it gave me :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rest API Url&lt;BR /&gt;/api/?type=op&amp;amp;cmd=&amp;lt;request&amp;gt;&amp;lt;license&amp;gt;&amp;lt;deactivate&amp;gt;&amp;lt;VM-Capacity&amp;gt;&amp;lt;mode&amp;gt;&amp;lt;/mode&amp;gt;&amp;lt;/VM-Capacity&amp;gt;&amp;lt;/deactivate&amp;gt;&amp;lt;/license&amp;gt;&amp;lt;/request&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The mode choices it gave me are auto or manual. So I added "auto" between the&amp;nbsp;&lt;SPAN&gt;&amp;lt;mode&amp;gt;&amp;lt;/mode&amp;gt; tags.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas what I'm doing wrong?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Google searches show me how to delete one key feature at a time, on the CLI, but I'm trying to deactivate the whole Palo Alto VM with an API call.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Roger&lt;/P&gt;</description>
    <pubDate>Thu, 26 Jul 2018 00:25:50 GMT</pubDate>
    <dc:creator>RogerMccarrick</dc:creator>
    <dc:date>2018-07-26T00:25:50Z</dc:date>
    <item>
      <title>How to deactivate  virtual PA firewall with API</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/how-to-deactivate-virtual-pa-firewall-with-api/m-p/223612#M64284</link>
      <description>&lt;P&gt;Trying to deactivate a PA-VM firewall with the API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First I add the Licencing API key to the PA with the firewall API:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In order to hide my real values, let's use:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;myfirewall.corp as my firewall&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;cxvzvxvcxvczc as my firewall's API key&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;dgshgdjsgdjsgj as my licensing portal API key.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So for the deactivation process, I'm gonna add the&amp;nbsp;&lt;SPAN&gt;licensing portal API key to my firewall, and then deactivate.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I can add this API key via the cli or via the firewall API. I want to do everything with the API.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Add deactivation key&lt;BR /&gt;&lt;A href="https://live.paloaltonetworks.com/" target="_blank"&gt;https://myfirewall.corp//api/?key=cxvzvxvcxvczc&amp;amp;type=op&amp;amp;cmd=&amp;lt;request&amp;gt;&amp;lt;license&amp;gt;&amp;lt;api-key&amp;gt;&amp;lt;set&amp;gt;&amp;lt;key&amp;gt;dgshgdjsgdjsgj&amp;lt;/key&amp;gt;&amp;lt;/set&amp;gt;&amp;lt;/api-key&amp;gt;&amp;lt;/license&amp;gt;&amp;lt;/request&lt;/A&gt;&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this works. I can successfully use the CLI on the firewall to check that the key was added.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;request license api-key show&lt;/P&gt;&lt;P&gt;API key: &lt;SPAN&gt;dgshgdjsgdjsgj&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Next, I want to deactivate. I try the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Deactivate&lt;BR /&gt;&lt;A href="https://live.paloaltonetworks.com/" target="_blank"&gt;https://myfirewall.corp//api/?key=cxvzvxvcxvczc&amp;amp;type=op&amp;amp;cmd=&amp;lt;request&amp;gt;&amp;lt;license&amp;gt;&amp;lt;deactivate&amp;gt;&amp;lt;VM-Capacity&amp;gt;&amp;lt;mode&lt;/A&gt;&amp;gt;&lt;FONT color="#FF6600"&gt;auto&lt;/FONT&gt;&amp;lt;/mode&amp;gt;&amp;lt;/VM-Capacity&amp;gt;&amp;lt;/deactivate&amp;gt;&amp;lt;/license&amp;gt;&amp;lt;/request&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The response I get is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This XML file does not appear to have any style information associated with it. The document tree is shown below.&lt;BR /&gt;&amp;lt;response status="error"&amp;gt;&lt;BR /&gt;&amp;lt;msg&amp;gt;&lt;BR /&gt;&amp;lt;line&amp;gt;&lt;BR /&gt;(null) Error:Invalid or missing deactivation token Device doesn't belong to this support account.&lt;BR /&gt;&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;I do not want to log into the firewall GUI to deactivate, I'm trying to script this. How do I deactivate using the API. I followed the API browser on my firewall in order to get the above command, and it gave me :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rest API Url&lt;BR /&gt;/api/?type=op&amp;amp;cmd=&amp;lt;request&amp;gt;&amp;lt;license&amp;gt;&amp;lt;deactivate&amp;gt;&amp;lt;VM-Capacity&amp;gt;&amp;lt;mode&amp;gt;&amp;lt;/mode&amp;gt;&amp;lt;/VM-Capacity&amp;gt;&amp;lt;/deactivate&amp;gt;&amp;lt;/license&amp;gt;&amp;lt;/request&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The mode choices it gave me are auto or manual. So I added "auto" between the&amp;nbsp;&lt;SPAN&gt;&amp;lt;mode&amp;gt;&amp;lt;/mode&amp;gt; tags.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas what I'm doing wrong?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Google searches show me how to delete one key feature at a time, on the CLI, but I'm trying to deactivate the whole Palo Alto VM with an API call.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Roger&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jul 2018 00:25:50 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/how-to-deactivate-virtual-pa-firewall-with-api/m-p/223612#M64284</guid>
      <dc:creator>RogerMccarrick</dc:creator>
      <dc:date>2018-07-26T00:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to deactivate  virtual PA firewall with API</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/how-to-deactivate-virtual-pa-firewall-with-api/m-p/223698#M64310</link>
      <description>&lt;P&gt;Solved it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the API browser on the PA firewall itself, dug down to the correct path, then in the submit field, I typed "auto" between the mode tags, and clicked submit. It worked, it deactivated the firewall, and on the PA licensing portal, I could see one less license in use for the auth-code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The final URL the API browser gave me was:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;https://myfirewall/api/?REST_API_TOKEN=1867054624&amp;amp;type=op&amp;amp;cmd=%3Crequest%3E%3Clicense%3E%3Cdeactivate%3E%3CVM-Capacity%3E%3Cmode%3Eauto%3C%2Fmode%3E%3C%2FVM-Capacity%3E%3C%2Fdeactivate%3E%3C%2Flicense%3E%3C%2Frequest%3E&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it gives hex&amp;nbsp;codes for &amp;lt;, \ and &amp;gt; . So I did the same in my API call, and it worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;https://myfirewall//api/?key=cxvzvxvcxvczc&amp;amp;type=op&amp;amp;cmd=&amp;lt;request&amp;gt;&amp;lt;license&amp;gt;&amp;lt;deactivate&amp;gt;&amp;lt;VM-Capacity&amp;gt;&amp;lt;mode&amp;gt;auto&amp;lt;%2Fmode&amp;gt;&amp;lt;%2FVM-Capacity&amp;gt;&amp;lt;%2Fdeactivate&amp;gt;&amp;lt;%2Flicense&amp;gt;&amp;lt;%2Frequest&amp;gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jul 2018 16:41:08 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/how-to-deactivate-virtual-pa-firewall-with-api/m-p/223698#M64310</guid>
      <dc:creator>RogerMccarrick</dc:creator>
      <dc:date>2018-07-26T16:41:08Z</dc:date>
    </item>
  </channel>
</rss>

