pan-os-python icon indicating copy to clipboard operation
pan-os-python copied to clipboard

Can't seem to be able to select a vsys as a rule target

Open DeepSpace2 opened this issue 5 years ago • 0 comments

Describe the bug

It seems to be impossible to select a vsys as a rule target when creating a new rule, maybe related to #199

Steps to reproduce

from panos import panorama, policies

p = panorama.Panorama(IP, USER, PASSWORD)
devices_groups = p.refresh_devices()
device_group = next(d for d in devices_groups if d.name == REQUIRED_DEVICE_GROUP)
pre_rulebase = policies.PreRulebase()
device_group.add(pre_rulebase)
new_rule = panorama.policies.SecurityRule(target=['001801005535/vsys2'],
                                          source=['1.1.1.1'],
                                          destination=['2.2.2.2'],
                                          service=['http'],
                                          action='allow',
                                          name='new rule 1')
pre_rulebase.add(new_rule)
new_rule.create()
p.commit(sync=True)

Results in

panos.errors.PanDeviceXapiError:  new rule 1 -> target -> devices -> 001801005535/vsys2 '001801005535/vsys2' is invalid
new rule 1 -> target -> devices is invalid

Environment

panos 1.0.0

DeepSpace2 avatar Oct 04 '20 13:10 DeepSpace2