03-17-2021 09:42 PM
I'm using pandevice to create address object, and am able to create address object for specific device group but not a "Shared" object.
pano = panorama.Panorama(device_name, login_id, pwd)
panogrp = panorama.DeviceGroup('Group1')
# Read input file
addrObj_df = pd.read_csv(file)
for index, row in addrObj_df.iterrows():
passed_obj_name = row['name']
passed_obj_value = row['value']
passed_obj_type = row['type']
passed_obj_description = row['description']
address_object = objects.AddressObject(name=passed_obj_name, value=passed_obj_value, type=passed_obj_type, description=passed_obj_description)
When I change 'Group1' in panogrp = panorama.DeviceGroup('Shared') to 'Shared', the following error message received :
PanDeviceXapiError: Shared 'Shared' is invalid. Reserved keyword (Shared) used for device group name
Any help is appreciated. Thank you.
03-18-2021 10:43 AM
Adding the address object as a child of the Panorama object itself is how you add things to "shared".
from panos.panorama import Panorama from panos.objects import AddressObject pano = Panorama(host, user, passwd) obj = AddressObject("dmz network", "10.50.75.0/24") pano.add(obj) obj.create()
03-18-2021 10:48 PM
Thank you for helping to resolve, very much appreciated.
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!