<?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 API + (new) zones in General Topics</title>
    <link>https://live.paloaltonetworks.com/t5/general-topics/api-new-zones/m-p/245189#M69902</link>
    <description>&lt;P&gt;Hey all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have started to work with the API and Postman lately in order help with making the setup process of new boxes a little easier &amp;amp; faster. While I have been able to get most of the basics done (Management IP, DNS, NTP, etc.) I am now struggling with creating new objects in the configuration through the API, starting with the zones that I want to use.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run some tests and use "get" in order to check for some existing objects everything seems to work fine, but as soon as I switch to "set" and try to define new objects I always get a "Malformed Request" feedback through Postman.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is one example I have used for testing today:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;https://{{HOST}}/api/?type=config&amp;amp;key={{key}}&amp;amp;action=set&amp;amp;xpath=/config/devices/entry/vsys/entry/zone/entry[@name='{{zone-intern}}']&amp;amp;element=&amp;lt;network&amp;gt;&amp;lt;layer3&amp;gt;&amp;lt;member&amp;gt;ethernet1/3&amp;lt;/member&amp;gt;&amp;lt;/layer3&amp;gt;&amp;lt;/network&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any clues on how to approach those issues (not for zone settings only)? Are there any elementy that MUST be included (like the network type) when creating certain objects that are documented somewhere?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Torsten&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;edit: corrected a mistake in the code part&lt;/P&gt;</description>
    <pubDate>Tue, 08 Jan 2019 11:52:50 GMT</pubDate>
    <dc:creator>Torsten_Greulich</dc:creator>
    <dc:date>2019-01-08T11:52:50Z</dc:date>
    <item>
      <title>API + (new) zones</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/api-new-zones/m-p/245189#M69902</link>
      <description>&lt;P&gt;Hey all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have started to work with the API and Postman lately in order help with making the setup process of new boxes a little easier &amp;amp; faster. While I have been able to get most of the basics done (Management IP, DNS, NTP, etc.) I am now struggling with creating new objects in the configuration through the API, starting with the zones that I want to use.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run some tests and use "get" in order to check for some existing objects everything seems to work fine, but as soon as I switch to "set" and try to define new objects I always get a "Malformed Request" feedback through Postman.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is one example I have used for testing today:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;https://{{HOST}}/api/?type=config&amp;amp;key={{key}}&amp;amp;action=set&amp;amp;xpath=/config/devices/entry/vsys/entry/zone/entry[@name='{{zone-intern}}']&amp;amp;element=&amp;lt;network&amp;gt;&amp;lt;layer3&amp;gt;&amp;lt;member&amp;gt;ethernet1/3&amp;lt;/member&amp;gt;&amp;lt;/layer3&amp;gt;&amp;lt;/network&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any clues on how to approach those issues (not for zone settings only)? Are there any elementy that MUST be included (like the network type) when creating certain objects that are documented somewhere?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Torsten&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;edit: corrected a mistake in the code part&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 11:52:50 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/api-new-zones/m-p/245189#M69902</guid>
      <dc:creator>Torsten_Greulich</dc:creator>
      <dc:date>2019-01-08T11:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: API + (new) zones</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/api-new-zones/m-p/245199#M69904</link>
      <description>&lt;P&gt;Update: made a little progress, been testing around with using the "complete" action for a bit and seeing what next commands I could use or try out. Am now able to at least create the zone using this command:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;https://{{HOST}}/api/?type=config&amp;amp;key={{key}}&amp;amp;action=set&amp;amp;xpath=/config/devices/entry/vsys/entry/zone&amp;amp;element=&amp;lt;entry name='{{zone-dmz}}'/&amp;gt;&lt;/PRE&gt;&lt;P&gt;Now to find a way to add additional configuration elements (layer, interface, etc.).&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 12:09:07 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/api-new-zones/m-p/245199#M69904</guid>
      <dc:creator>Torsten_Greulich</dc:creator>
      <dc:date>2019-01-08T12:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: API + (new) zones</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/api-new-zones/m-p/245200#M69905</link>
      <description>&lt;P&gt;Ok, found it. Only had to swap some details around.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;https://{{HOST}}/api/?type=config&amp;amp;key={{key}}&amp;amp;action=set&amp;amp;xpath=/config/devices/entry/vsys/entry/zone/entry[@name='{{zone-dmz}}']&amp;amp;element=&amp;lt;network&amp;gt;&amp;lt;layer3&amp;gt;&amp;lt;member&amp;gt;ethernet1/3&amp;lt;/member&amp;gt;&amp;lt;/layer3&amp;gt;&amp;lt;/network&amp;gt;&lt;/PRE&gt;&lt;P&gt;Now to optimize this whole setup...&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 12:21:02 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/api-new-zones/m-p/245200#M69905</guid>
      <dc:creator>Torsten_Greulich</dc:creator>
      <dc:date>2019-01-08T12:21:02Z</dc:date>
    </item>
  </channel>
</rss>

