mirror of
https://github.com/GAM-team/GAM.git
synced 2025-07-09 14:13:35 +00:00
Directory API Mobiledevices update no longer supported (#519)
This commit is contained in:
@ -472,9 +472,8 @@ Item attributes
|
||||
(whocanviewgroup ANYONE_CAN_VIEW|ALL_IN_DOMAIN_CAN_VIEW|ALL_MEMBERS_CAN_VIEW|ALL_MANAGERS_CAN_VIEW)|
|
||||
(whocanviewmembership ALL_IN_DOMAIN_CAN_VIEW|ALL_MEMBERS_CAN_VIEW|ALL_MANAGERS_CAN_VIEW)
|
||||
|
||||
<MobileAttributes> ::=
|
||||
(model <String>)|(os <String>)|(useragent <String>)|
|
||||
(action admin_remote_wipe|wipe|admin_account_wipe|accountwipe|wipeaccount|approve|block|cancel_remote_wipe_then_activate|cancel_remote_wipe_then_block)
|
||||
<MobileAction> ::=
|
||||
admin_remote_wipe|wipe|admin_account_wipe|accountwipe|wipeaccount|approve|block|cancel_remote_wipe_then_activate|cancel_remote_wipe_then_block
|
||||
|
||||
<PrinterAttributes> ::= (currentquota <Number>)|(dailyquota <Number>)|
|
||||
(defaultdisplayname <String>)|(description <String>)|(displayname <String>)|(firmware <String>)|(gcpversion <String>)|
|
||||
@ -655,7 +654,7 @@ The listlimit <Number> argument limits the number of recent users and time range
|
||||
The start <Date> and end <Date> arguments filter the time ranges.
|
||||
Delimiter defaults to comma.
|
||||
|
||||
gam update mobile <MobileItem> <MobileAttributes>+
|
||||
gam update mobile <MobileItem> action <MobileAction>
|
||||
gam delete mobile <MobileItem>
|
||||
gam info mobile <MobileItem>
|
||||
gam print mobile [todrive] [query <QueryMobile>] [basic|full] [orderby <MobileOrderByFieldName> [ascending|descending]]
|
||||
|
37
src/gam.py
37
src/gam.py
@ -7520,40 +7520,23 @@ def doUpdateMobile():
|
||||
cd = buildGAPIObject(u'directory')
|
||||
resourceId = sys.argv[3]
|
||||
i = 4
|
||||
action_body = {}
|
||||
patch_body = {}
|
||||
doPatch = doAction = False
|
||||
body = {}
|
||||
while i < len(sys.argv):
|
||||
if sys.argv[i].lower() == u'action':
|
||||
action_body[u'action'] = sys.argv[i+1].lower()
|
||||
if action_body[u'action'] == u'wipe':
|
||||
action_body[u'action'] = u'admin_remote_wipe'
|
||||
elif action_body[u'action'].replace(u'_', u'') in [u'accountwipe', u'wipeaccount']:
|
||||
action_body[u'action'] = u'admin_account_wipe'
|
||||
if action_body[u'action'] not in [u'admin_remote_wipe', u'admin_account_wipe', u'approve', u'block', u'cancel_remote_wipe_then_activate', u'cancel_remote_wipe_then_block']:
|
||||
print u'ERROR: action must be one of wipe, wipeaccount, approve, block, cancel_remote_wipe_then_activate, cancel_remote_wipe_then_block; got %s' % action_body[u'action']
|
||||
body[u'action'] = sys.argv[i+1].lower()
|
||||
if body[u'action'] == u'wipe':
|
||||
body[u'action'] = u'admin_remote_wipe'
|
||||
elif body[u'action'].replace(u'_', u'') in [u'accountwipe', u'wipeaccount']:
|
||||
body[u'action'] = u'admin_account_wipe'
|
||||
if body[u'action'] not in [u'admin_remote_wipe', u'admin_account_wipe', u'approve', u'block', u'cancel_remote_wipe_then_activate', u'cancel_remote_wipe_then_block']:
|
||||
print u'ERROR: action must be one of wipe, wipeaccount, approve, block, cancel_remote_wipe_then_activate, cancel_remote_wipe_then_block; got %s' % body[u'action']
|
||||
sys.exit(2)
|
||||
doAction = True
|
||||
i += 2
|
||||
elif sys.argv[i].lower() == u'model':
|
||||
patch_body[u'model'] = sys.argv[i+1]
|
||||
i += 2
|
||||
doPatch = True
|
||||
elif sys.argv[i].lower() == u'os':
|
||||
patch_body[u'os'] = sys.argv[i+1]
|
||||
i += 2
|
||||
doPatch = True
|
||||
elif sys.argv[i].lower() == u'useragent':
|
||||
patch_body[u'userAgent'] = sys.argv[i+1]
|
||||
i += 2
|
||||
doPatch = True
|
||||
else:
|
||||
print u'ERROR: %s is not a valid argument for "gam update mobile"' % sys.argv[i]
|
||||
sys.exit(2)
|
||||
if doPatch:
|
||||
callGAPI(cd.mobiledevices(), u'update', resourceId=resourceId, body=patch_body, customerId=GC_Values[GC_CUSTOMER_ID])
|
||||
if doAction:
|
||||
callGAPI(cd.mobiledevices(), u'action', resourceId=resourceId, body=action_body, customerId=GC_Values[GC_CUSTOMER_ID])
|
||||
if body:
|
||||
callGAPI(cd.mobiledevices(), u'action', resourceId=resourceId, body=body, customerId=GC_Values[GC_CUSTOMER_ID])
|
||||
|
||||
def doDeleteMobile():
|
||||
cd = buildGAPIObject(u'directory')
|
||||
|
Reference in New Issue
Block a user