-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Partial admin commit #36
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,6 +171,8 @@ def main(): | |
kwargs['extra_qs'] = options['ad_hoc'] | ||
if len(options['vsys']): | ||
kwargs['vsys'] = options['vsys'][0] | ||
if len(options['admin']): | ||
kwargs['admin'] = options['admin'][0] | ||
xapi.user_id(**kwargs) | ||
print_status(xapi, action) | ||
print_response(xapi, options) | ||
|
@@ -276,6 +278,8 @@ def main(): | |
kwargs['extra_qs'] = options['ad_hoc'] | ||
if len(options['vsys']): | ||
kwargs['vsys'] = options['vsys'][0] | ||
if len(options['admin']): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. diff not for type=op |
||
kwargs['admin'] = options['admin'][0] | ||
xapi.op(**kwargs) | ||
print_status(xapi, action) | ||
print_response(xapi, options) | ||
|
@@ -303,6 +307,8 @@ def main(): | |
c.no_vsys() | ||
elif part == 'vsys': | ||
c.vsys(options['vsys']) | ||
elif part == 'admin': | ||
c.admin(options['admin']) | ||
|
||
if options['serial'] is not None: | ||
c.device(options['serial']) | ||
|
@@ -374,6 +380,7 @@ def parse_opts(): | |
'partial': [], | ||
'sync': False, | ||
'vsys': [], | ||
'admin':[], | ||
'commit_all': False, | ||
'ad_hoc': None, | ||
'modify': False, | ||
|
@@ -428,7 +435,7 @@ def parse_opts(): | |
short_options = 'de:gksS:U:C:A:o:l:h:P:K:xpjrXHGDt:T:' | ||
long_options = ['version', 'help', | ||
'ad-hoc=', 'modify', 'validate', 'force', 'partial=', | ||
'sync', 'vsys=', 'src=', 'dst=', 'move=', 'rename', | ||
'sync', 'vsys=', 'admin=', 'src=', 'dst=', 'move=', 'rename', | ||
'clone', 'override=', 'export=', 'log=', 'recursive', | ||
'cafile=', 'capath=', 'ls', 'serial=', | ||
'group=', 'merge', 'nlogs=', 'skip=', 'filter=', | ||
|
@@ -480,6 +487,10 @@ def parse_opts(): | |
if arg: | ||
l = get_vsys(arg) | ||
[options['vsys'].append(s) for s in l] | ||
elif opt == '--admin': | ||
if arg: | ||
l = get_admin(arg) | ||
[options['admin'].append(s) for s in l] | ||
elif opt == '-A': | ||
options['commit_all'] = True | ||
options['cmd'] = get_element(arg) | ||
|
@@ -644,6 +655,17 @@ def get_vsys(s): | |
else: | ||
list.append(v) | ||
return list | ||
|
||
|
||
def get_admin(s): | ||
list = [] | ||
admin = s.split(',') | ||
for admin in admin: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this works but prefer something like |
||
if admin: | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. extra blank line |
||
list.append(admin) | ||
|
||
return list | ||
|
||
|
||
def get_parts(s): | ||
|
@@ -880,6 +902,7 @@ def usage(): | |
--override element override template object at xpath | ||
--vsys vsys VSYS for dynamic update/partial commit/ | ||
operational command/report | ||
--admin admin admin for specific update/partial commit | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe better is "admins for partial commit" |
||
-l api_username[:api_password] | ||
-h hostname | ||
-P port URL port number | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -188,6 +188,7 @@ DESCRIPTION | |
- shared-object-excluded | ||
- no-vsys | ||
- vsys | ||
- admin | ||
|
||
**device-and-network-excluded** applies when the device is in | ||
single-vsys mode and **shared-object-excluded** applies when the device | ||
|
@@ -197,6 +198,14 @@ DESCRIPTION | |
options or separating each part with comma (,). Virtual systems for | ||
the **vsys** part can be specified with **--vsys**. | ||
|
||
``--admin`` *admin* | ||
Specify optional **admin** for partial commit (**--partial** admin). Commits | ||
only the changes made only by specified administrator accounts. Requires | ||
PanOS 8.0+. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggest "PAN-OS 8.0 or greater" or "PAN-OS >= 8.0" |
||
|
||
Multiple admin users can be specified by using multiple | ||
**--admin** options or separating each *admin* with comma (,). | ||
|
||
``--sync`` | ||
Perform a synchronous commit. | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this diff is for type=commit only, not user-id