<?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: PAN-OS SDK Device Group Hierarchy in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/pan-os-sdk-device-group-hierarchy/m-p/538759#M3351</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You might already have found the answer but for any future searches.&lt;/P&gt;&lt;P&gt;Instead of using opcommands you can use the following code&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;        newsite = DeviceGroup(site.SiteName)
        pano.add(newsite)
        newsite.create()
        newsite.opstate.dg_hierarchy.__setattr__('parent', site.Region)
        newsite.opstate.dg_hierarchy.update()&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 14 Apr 2023 09:55:04 GMT</pubDate>
    <dc:creator>YVerlindenEffem</dc:creator>
    <dc:date>2023-04-14T09:55:04Z</dc:date>
    <item>
      <title>PAN-OS SDK Device Group Hierarchy</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/pan-os-sdk-device-group-hierarchy/m-p/514432#M3112</link>
      <description>&lt;P&gt;Is there a way to create device under a parent or move a device group using the sdk.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Similar to Operational command:&lt;/P&gt;&lt;P&gt;&amp;gt; request move-dg dg1 new-parent-dg dg1_parent create-dg yes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am aware of the&amp;nbsp;dg_hierarchy opstate, which helps finding the device group, but how can I set the parent when creating a new group?&amp;nbsp;&lt;/P&gt;&lt;P&gt;DeviceGroup.create() method just places the new group under shared and this fails in cases of having depended objects on the parent device group.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the fist case I need to create a new group as member of parent device group.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the second case I want to "clone" device group with a new name under new parent. Any help how to do that?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 15:49:57 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/pan-os-sdk-device-group-hierarchy/m-p/514432#M3112</guid>
      <dc:creator>batd2</dc:creator>
      <dc:date>2022-09-09T15:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: PAN-OS SDK Device Group Hierarchy</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/pan-os-sdk-device-group-hierarchy/m-p/516623#M3189</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/130874"&gt;@batd2&lt;/a&gt;, you can perform lots of operational tasks like this with op(), for example:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;resp = panorama.op('&amp;lt;request&amp;gt;&amp;lt;move-dg&amp;gt;&amp;lt;entry name="new-dg"&amp;gt;&amp;lt;new-parent-dg&amp;gt;home-dg&amp;lt;/new-parent-dg&amp;gt;&amp;lt;/entry&amp;gt;&amp;lt;/move-dg&amp;gt;&amp;lt;/request&amp;gt;', xml=True, cmd_xml=False)
print(resp)&lt;/LI-CODE&gt;
&lt;P&gt;Ref:&amp;nbsp;&lt;A href="https://pan-os-python.readthedocs.io/en/latest/getting-started.html#operational-commands" target="_blank"&gt;https://pan-os-python.readthedocs.io/en/latest/getting-started.html#operational-commands&lt;/A&gt;&amp;nbsp;and&amp;nbsp;&lt;A href="https://pan-os-python.readthedocs.io/en/latest/module-base.html#panos.base.PanDevice.op" target="_blank"&gt;https://pan-os-python.readthedocs.io/en/latest/module-base.html#panos.base.PanDevice.op&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helps!&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 13:44:49 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/pan-os-sdk-device-group-hierarchy/m-p/516623#M3189</guid>
      <dc:creator>JimmyHolland</dc:creator>
      <dc:date>2022-10-03T13:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: PAN-OS SDK Device Group Hierarchy</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/pan-os-sdk-device-group-hierarchy/m-p/517712#M3204</link>
      <description>&lt;P&gt;The GUI hides that creating a device group then moving it under the specified device group instead of "Shared" is a two-step process, but it is in fact a two step process.&amp;nbsp; There is device group hierarchy opstate stuff in place, just use the &lt;CODE&gt;opstate&lt;/CODE&gt; namespace hanging off of your instance of the &lt;CODE&gt;panos.panorama.DeviceGroup&lt;/CODE&gt; object along with the docs:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://pan-os-python.readthedocs.io/en/latest/getting-started.html#the-opstate-namespace" target="_blank"&gt;https://pan-os-python.readthedocs.io/en/latest/getting-started.html#the-opstate-namespace&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://pan-os-python.readthedocs.io/en/latest/module-panorama.html#panos.panorama.DeviceGroupHierarchy" target="_blank"&gt;https://pan-os-python.readthedocs.io/en/latest/module-panorama.html#panos.panorama.DeviceGroupHierarchy&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 22:36:41 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/pan-os-sdk-device-group-hierarchy/m-p/517712#M3204</guid>
      <dc:creator>gfreeman</dc:creator>
      <dc:date>2022-10-12T22:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: PAN-OS SDK Device Group Hierarchy</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/pan-os-sdk-device-group-hierarchy/m-p/538759#M3351</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You might already have found the answer but for any future searches.&lt;/P&gt;&lt;P&gt;Instead of using opcommands you can use the following code&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;        newsite = DeviceGroup(site.SiteName)
        pano.add(newsite)
        newsite.create()
        newsite.opstate.dg_hierarchy.__setattr__('parent', site.Region)
        newsite.opstate.dg_hierarchy.update()&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 14 Apr 2023 09:55:04 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/pan-os-sdk-device-group-hierarchy/m-p/538759#M3351</guid>
      <dc:creator>YVerlindenEffem</dc:creator>
      <dc:date>2023-04-14T09:55:04Z</dc:date>
    </item>
  </channel>
</rss>

