mirror of
https://github.com/GAM-team/GAM.git
synced 2025-07-10 14:43:34 +00:00
Merge branch 'master' of https://github.com/jay0lee/GAM
This commit is contained in:
@ -1154,18 +1154,6 @@ gam info device [id] <DeviceID>
|
|||||||
gam delete device [id] <DeviceID>
|
gam delete device [id] <DeviceID>
|
||||||
gam cancelwipe device [id] <DeviceID>
|
gam cancelwipe device [id] <DeviceID>
|
||||||
gam wipe device [id] <DeviceID>
|
gam wipe device [id] <DeviceID>
|
||||||
|
|
||||||
gam approve deviceuser [id] <DeviceUserID>
|
|
||||||
gam block deviceuser [id] <DeviceUserID>
|
|
||||||
gam delete deviceuser [id] <DeviceUserID>
|
|
||||||
gam cancelwipe deviceuser [id] <DeviceUserID>
|
|
||||||
gam wipe deviceuser [id] <DeviceUserID>
|
|
||||||
gam update deviceuserstate [id] <DeviceUserID>
|
|
||||||
[clientid <String>] [customid <String>] [assettags clear|<AssetTagList>]
|
|
||||||
[compliantstate|compliancestate compliant|noncompliant] [managedstate clear|managed|unmanaged]
|
|
||||||
[healthscore verypoor|poor|neutral|good|verygood] [scorereason clear|<String>]
|
|
||||||
(customvalue (bool <Boolean>)|(number <Integer>)|(string <String>))*
|
|
||||||
|
|
||||||
gam print devices [todrive] [filter|query <QueryDevice>]
|
gam print devices [todrive] [filter|query <QueryDevice>]
|
||||||
[orderby <DeviceOrderByFieldName> [ascending|descending]]
|
[orderby <DeviceOrderByFieldName> [ascending|descending]]
|
||||||
[company|personal|nocompanydevices|nopersonaldevices]
|
[company|personal|nocompanydevices|nopersonaldevices]
|
||||||
@ -1178,6 +1166,19 @@ gam sync devices [filter|query <QueryDevice>]
|
|||||||
[unassigned_missing_action delete|wipe|donothing]
|
[unassigned_missing_action delete|wipe|donothing]
|
||||||
[assigned_missing_action delete|wipe|donothing]
|
[assigned_missing_action delete|wipe|donothing]
|
||||||
|
|
||||||
|
gam approve deviceuser [id] <DeviceUserID>
|
||||||
|
gam block deviceuser [id] <DeviceUserID>
|
||||||
|
gam delete deviceuser [id] <DeviceUserID>
|
||||||
|
gam cancelwipe deviceuser [id] <DeviceUserID>
|
||||||
|
gam wipe deviceuser [id] <DeviceUserID>
|
||||||
|
|
||||||
|
gam info deviceuserstate [id] <DeviceUserID> [clientid <String>]
|
||||||
|
gam update deviceuserstate [id] <DeviceUserID> [clientid <String>]
|
||||||
|
[customid <String>] [assettags clear|<AssetTagList>]
|
||||||
|
[compliantstate|compliancestate compliant|noncompliant] [managedstate clear|managed|unmanaged]
|
||||||
|
[healthscore very_poor|poor|neutral|good|very_good] [scorereason clear|<String>]
|
||||||
|
(customvalue (bool <Boolean>)|(number <Integer>)|(string <String>))*
|
||||||
|
|
||||||
gam update mobile <MobileID>|query:<QueryMobile> action <MobileAction> [doit] [if_users|match_users <UserTypeEntity>]
|
gam update mobile <MobileID>|query:<QueryMobile> action <MobileAction> [doit] [if_users|match_users <UserTypeEntity>]
|
||||||
gam delete mobile <MobileID>
|
gam delete mobile <MobileID>
|
||||||
gam info mobile <MobileID>
|
gam info mobile <MobileID>
|
||||||
|
@ -11225,6 +11225,8 @@ def ProcessGAMCommand(args):
|
|||||||
gapi_directory_resource.getBuildingInfo()
|
gapi_directory_resource.getBuildingInfo()
|
||||||
elif argument in ['device']:
|
elif argument in ['device']:
|
||||||
gapi_cloudidentity_devices.info()
|
gapi_cloudidentity_devices.info()
|
||||||
|
elif argument == 'deviceuserstate':
|
||||||
|
gapi_cloudidentity_devices.info_state()
|
||||||
elif argument in ['browser', 'browsers']:
|
elif argument in ['browser', 'browsers']:
|
||||||
gapi_cbcm.info()
|
gapi_cbcm.info()
|
||||||
else:
|
else:
|
||||||
|
@ -128,22 +128,48 @@ def wipe_user():
|
|||||||
_generic_action('wipe', True)
|
_generic_action('wipe', True)
|
||||||
|
|
||||||
|
|
||||||
def update_state():
|
def _get_deviceuser_name():
|
||||||
|
i = 3
|
||||||
|
name = sys.argv[i]
|
||||||
|
if name == 'id':
|
||||||
|
i += 1
|
||||||
|
name = sys.argv[i]
|
||||||
|
if not name.startswith('devices/'):
|
||||||
|
name = f'devices/{name}'
|
||||||
|
return (i+1, name)
|
||||||
|
|
||||||
|
def info_state():
|
||||||
ci = gapi_cloudidentity.build_dwd()
|
ci = gapi_cloudidentity.build_dwd()
|
||||||
gapi_directory_customer.setTrueCustomerId()
|
gapi_directory_customer.setTrueCustomerId()
|
||||||
customer = _get_device_customerid()[10:]
|
customer = _get_device_customerid()
|
||||||
client_id = f'{customer}-gam'
|
customer_id = customer[10:]
|
||||||
body = {}
|
client_id = f'{customer_id}-gam'
|
||||||
i = 3
|
i, deviceuser = _get_deviceuser_name()
|
||||||
deviceuser = sys.argv[i]
|
|
||||||
if deviceuser == 'id':
|
|
||||||
i += 1
|
|
||||||
deviceuser = sys.argv[i]
|
|
||||||
i += 1
|
|
||||||
while i < len(sys.argv):
|
while i < len(sys.argv):
|
||||||
myarg = sys.argv[i].lower().replace('_', '')
|
myarg = sys.argv[i].lower().replace('_', '')
|
||||||
if myarg == 'clientid':
|
if myarg == 'clientid':
|
||||||
client_id = f'{customer}-{sys.argv[i+1]}'
|
client_id = f'{customer_id}-{sys.argv[i+1]}'
|
||||||
|
i += 2
|
||||||
|
else:
|
||||||
|
controlflow.invalid_argument_exit(sys.argv[i], 'gam info deviceuserstate')
|
||||||
|
name = f'{deviceuser}/clientStates/{client_id}'
|
||||||
|
result = gapi.call(ci.devices().deviceUsers().clientStates(), 'get',
|
||||||
|
name=name, customer=customer)
|
||||||
|
display.print_json(result)
|
||||||
|
|
||||||
|
|
||||||
|
def update_state():
|
||||||
|
ci = gapi_cloudidentity.build_dwd()
|
||||||
|
gapi_directory_customer.setTrueCustomerId()
|
||||||
|
customer = _get_device_customerid()
|
||||||
|
customer_id = customer[10:]
|
||||||
|
client_id = f'{customer_id}-gam'
|
||||||
|
body = {}
|
||||||
|
i, deviceuser = _get_deviceuser_name()
|
||||||
|
while i < len(sys.argv):
|
||||||
|
myarg = sys.argv[i].lower().replace('_', '')
|
||||||
|
if myarg == 'clientid':
|
||||||
|
client_id = f'{customer_id}-{sys.argv[i+1]}'
|
||||||
i += 2
|
i += 2
|
||||||
elif myarg in ['assettag', 'assettags']:
|
elif myarg in ['assettag', 'assettags']:
|
||||||
body['assetTags'] = gam.shlexSplitList(sys.argv[i+1])
|
body['assetTags'] = gam.shlexSplitList(sys.argv[i+1])
|
||||||
@ -212,7 +238,7 @@ def update_state():
|
|||||||
name = f'{deviceuser}/clientStates/{client_id}'
|
name = f'{deviceuser}/clientStates/{client_id}'
|
||||||
updateMask = ','.join(body.keys())
|
updateMask = ','.join(body.keys())
|
||||||
result = gapi.call(ci.devices().deviceUsers().clientStates(), 'patch',
|
result = gapi.call(ci.devices().deviceUsers().clientStates(), 'patch',
|
||||||
name=name, customer=f'customers/{customer}', updateMask=updateMask, body=body)
|
name=name, customer=customer, updateMask=updateMask, body=body)
|
||||||
display.print_json(result)
|
display.print_json(result)
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user