<?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 Add addressobject to specific device group through panorama via python in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/add-addressobject-to-specific-device-group-through-panorama-via/m-p/275949#M1970</link>
    <description>&lt;P&gt;Ok, i will first start by saying ive never attempted anything like this before. Im an old school network engineer but times are a changing and im trying to learn how to automate simple tasks. All I need to do is promt the user to enter and IP address and then add that IP Address to a specific device group with 1 tag on it.&amp;nbsp; for example i want to add 7.7.7.7 to my firewall with the tag SFTP. So once the object hits the firewall the name would be H-7.7.7.7 and description would simply be the ticket number of the request and the ip would be learned via input and then I would automatically include the tag. ive been reading forums and other items and came up with a little script below.&amp;nbsp; This is what I have so far, but im kinda stuck now. Ive only been messing around with this for a couple of days...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#This defines the panorama device interface to connect to and the DeviceGroup&lt;BR /&gt;device = ["x.x.x.x"]&lt;BR /&gt;devicegroup = ["mydevice"]&lt;BR /&gt;auth_key = "&amp;lt;my-key&amp;gt;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#This intitaties the panorama connection&amp;nbsp;&lt;BR /&gt;pano = panorama.Panorama(device, api_key=auth_key)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#This defines the device group we wil be connecting to&lt;BR /&gt;panogrp = panorama.DeviceGroup(devicegroup)&lt;BR /&gt;pano.add(panogrp)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#This will set the IP address of the SFTP source to add to the Firewall&amp;nbsp;&lt;BR /&gt;ip_address = input('Please enter the ip address you wish to add to the SFTP whitelist, (example x.x.x.x): ')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#This will set the description of the node to the Release Ticket number&lt;BR /&gt;description = input("Please enter the release ticket number: ")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#This formats the name to match the existing standards in the firewall&lt;BR /&gt;name = ("H-"+ip_address)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#declares an object to create&lt;/P&gt;&lt;P&gt;sftp_server = pandevice.objects.AddressObject()&lt;BR /&gt;panogrp.add(sftp_server)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any suggestions to make it better and or complete the adding of the node..im not sure im even on the right path so far... thanks for any insight ... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Jul 2019 11:19:51 GMT</pubDate>
    <dc:creator>JohnCrubaugh</dc:creator>
    <dc:date>2019-07-11T11:19:51Z</dc:date>
    <item>
      <title>Add addressobject to specific device group through panorama via python</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/add-addressobject-to-specific-device-group-through-panorama-via/m-p/275949#M1970</link>
      <description>&lt;P&gt;Ok, i will first start by saying ive never attempted anything like this before. Im an old school network engineer but times are a changing and im trying to learn how to automate simple tasks. All I need to do is promt the user to enter and IP address and then add that IP Address to a specific device group with 1 tag on it.&amp;nbsp; for example i want to add 7.7.7.7 to my firewall with the tag SFTP. So once the object hits the firewall the name would be H-7.7.7.7 and description would simply be the ticket number of the request and the ip would be learned via input and then I would automatically include the tag. ive been reading forums and other items and came up with a little script below.&amp;nbsp; This is what I have so far, but im kinda stuck now. Ive only been messing around with this for a couple of days...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#This defines the panorama device interface to connect to and the DeviceGroup&lt;BR /&gt;device = ["x.x.x.x"]&lt;BR /&gt;devicegroup = ["mydevice"]&lt;BR /&gt;auth_key = "&amp;lt;my-key&amp;gt;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#This intitaties the panorama connection&amp;nbsp;&lt;BR /&gt;pano = panorama.Panorama(device, api_key=auth_key)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#This defines the device group we wil be connecting to&lt;BR /&gt;panogrp = panorama.DeviceGroup(devicegroup)&lt;BR /&gt;pano.add(panogrp)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#This will set the IP address of the SFTP source to add to the Firewall&amp;nbsp;&lt;BR /&gt;ip_address = input('Please enter the ip address you wish to add to the SFTP whitelist, (example x.x.x.x): ')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#This will set the description of the node to the Release Ticket number&lt;BR /&gt;description = input("Please enter the release ticket number: ")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#This formats the name to match the existing standards in the firewall&lt;BR /&gt;name = ("H-"+ip_address)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#declares an object to create&lt;/P&gt;&lt;P&gt;sftp_server = pandevice.objects.AddressObject()&lt;BR /&gt;panogrp.add(sftp_server)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any suggestions to make it better and or complete the adding of the node..im not sure im even on the right path so far... thanks for any insight ... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 11:19:51 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/add-addressobject-to-specific-device-group-through-panorama-via/m-p/275949#M1970</guid>
      <dc:creator>JohnCrubaugh</dc:creator>
      <dc:date>2019-07-11T11:19:51Z</dc:date>
    </item>
  </channel>
</rss>

