mirror of
https://github.com/GAM-team/GAM.git
synced 2026-06-28 09:51:36 +00:00
Add info printer command/ChromePolicy cleanup (#1337)
* Add info printer command * ChromePolicy cleanup Make update chromepolicy orgunit default to / like delete and print Add `filter <String>` to print chromeschema Make update_policy code to set additionalTargetKeys consistent with delete_policy I left verb at print for chromepolicy/chromeschema * When printing schemasa, use ":" instead of " - " * Fix print policy indentation * Chrome policy cleanup orgunit must be specified Use verb show, add verb print later * Recognize all ou forms to exit from schema mode * Don't assign multiple variables on same line
This commit is contained in:
@@ -82,6 +82,19 @@ def delete():
|
||||
for printer_id in result.get('failedPrinters', []):
|
||||
print(f'ERROR: failed to delete {printer_id.get("printerIds")}')
|
||||
|
||||
|
||||
def info():
|
||||
'''gam info printer'''
|
||||
cdapi = gapi_directory.build()
|
||||
customer = _get_customerid()
|
||||
printer_id = sys.argv[3]
|
||||
name = f'{customer}/chrome/printers/{printer_id}'
|
||||
result = gapi.call(cdapi.customers().chrome().printers(),
|
||||
'get',
|
||||
name=name)
|
||||
display.print_json(result)
|
||||
|
||||
|
||||
def print_():
|
||||
'''gam print printers'''
|
||||
cdapi = gapi_directory.build()
|
||||
@@ -161,8 +174,8 @@ def update():
|
||||
update_mask = ','.join(body)
|
||||
# note clearMask seems unnecessary. Updating field to '' clears it.
|
||||
result = gapi.call(cdapi.customers().chrome().printers(),
|
||||
'patch',
|
||||
name=name,
|
||||
updateMask=update_mask,
|
||||
body=body)
|
||||
'patch',
|
||||
name=name,
|
||||
updateMask=update_mask,
|
||||
body=body)
|
||||
display.print_json(result)
|
||||
|
||||
Reference in New Issue
Block a user