Skip to content

Commit

Permalink
feat(panos.panorama.Panorama): Add refresh_shared_objects() (#436)
Browse files Browse the repository at this point in the history
Fixes #428
  • Loading branch information
shinmog committed Mar 25, 2022
1 parent cfee6e3 commit 11327a4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions panos/panorama.py
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,26 @@ def get_vm_auth_keys(self):

return ans

def refresh_shared_objects(self, running_config=False, exceptions=True):
"""Refresh all objects present in the shared scope.
NOTE: This will remove any instance of any class that shows up
in the :class:`panos.panorama.Panorama` `CHILDTYPES` constant from
this Panorama's `children`.
Args:
running_config (bool): Set to True to refresh from the running
configuration (Default: False)
exceptions (bool): Set to False to prevent exceptions on failure
(Default: True)
"""
xml = self.xapi.get("/config/shared")
if xml is not None:
xml = xml.find("./result/shared")

self.refresh(xml=xml, running_config=running_config, exceptions=exceptions)


class PanoramaCommit(object):
"""Normalization of a Panorama commit.
Expand Down

0 comments on commit 11327a4

Please sign in to comment.