panos_util/panorama.py
def create_from_element(e: Element) -> DeviceGroup:
        """Create DeviceGroup from XML element."""
        name = e.get("name")

        vuln_profiles = {}
        for vuln_profile in e.findall("./profiles/vulnerability/entry"):
            vp = VulnerabilityProfile.create_from_element(vuln_profile)
            vuln_profiles.update({vp.name: vp})

        profile_groups = {}
        for profile_group in e.findall("./profile-group/entry"):
            pg = SecurityProfileGroup.create_from_element(profile_group)
            profile_groups.update({pg.name: pg})

        rules = []
        for rule in e.findall("./pre-rulebase/security/rules/entry"):
            sr = SecurityRule.create_from_element(rule)
            rules.append(sr)

        return DeviceGroup(name, rules, vuln_profiles, profile_groups)
Create DeviceGroup from XML element.
Create DeviceGroup from XML element.
Create DeviceGroup from XML element .
def create_from_element(e: Element) -> DeviceGroup:
        name = e.get("name")
        vuln_profiles = {}
        for vuln_profile in e.findall("./profiles/vulnerability/entry"):
            vp = VulnerabilityProfile.create_from_element(vuln_profile)
            vuln_profiles.update({vp.name: vp})
        profile_groups = {}
        for profile_group in e.findall("./profile-group/entry"):
            pg = SecurityProfileGroup.create_from_element(profile_group)
            profile_groups.update({pg.name: pg})
        rules = []
        for rule in e.findall("./pre-rulebase/security/rules/entry"):
            sr = SecurityRule.create_from_element(rule)
            rules.append(sr)
        return DeviceGroup(name, rules, vuln_profiles, profile_groups)
def create_from_element ( e : Element ) -> DeviceGroup : name = e . get ( "name" ) vuln_profiles = { } for vuln_profile in e . findall ( "./profiles/vulnerability/entry" ) : vp = VulnerabilityProfile . create_from_element ( vuln_profile ) vuln_profiles . update ( { vp . name : vp } ) profile_groups = { } for profile_group in e . findall ( "./profile-group/entry" ) : pg = SecurityProfileGroup . create_from_element ( profile_group ) profile_groups . update ( { pg . name : pg } ) rules = [ ] for rule in e . findall ( "./pre-rulebase/security/rules/entry" ) : sr = SecurityRule . create_from_element ( rule ) rules . append ( sr ) return DeviceGroup ( name , rules , vuln_profiles , profile_groups )
Create DeviceGroup from XML element.
Create DeviceGroup from XML element .
"""Create DeviceGroup from XML element."""
e
Element