mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-03 20:31:35 +00:00
update deviceuserstate cleanup/documentation (#1289)
* update deviceuserstate cleanup * Update GamCommands.txt
This commit is contained in:
@@ -141,6 +141,7 @@ If an item contains spaces, it should be surrounded by ".
|
|||||||
<ACLScope> ::= [user:]<EmailAddress>|group:<EmailAddress>|domain[:<DomainName>]|default
|
<ACLScope> ::= [user:]<EmailAddress>|group:<EmailAddress>|domain[:<DomainName>]|default
|
||||||
<APIScopeURL> ::= <String>
|
<APIScopeURL> ::= <String>
|
||||||
<ASPID> ::= <String>
|
<ASPID> ::= <String>
|
||||||
|
<AssetTag> ::= <String>
|
||||||
<BuildingID> ::= <String>|id:<String>
|
<BuildingID> ::= <String>|id:<String>
|
||||||
<CalendarACLRole> ::= editor|freebusy|freebusyreader|owner|reader|writer
|
<CalendarACLRole> ::= editor|freebusy|freebusyreader|owner|reader|writer
|
||||||
<CalendarACLRuleID> ::= user:<EmailAddress>|group:<EmailAddress>|domain:<DomainName>|default
|
<CalendarACLRuleID> ::= user:<EmailAddress>|group:<EmailAddress>|domain:<DomainName>|default
|
||||||
@@ -554,6 +555,7 @@ Items, separated by spaces, with spaces, commas or single quotes in the items th
|
|||||||
<ACLList> ::= "<ACLScope>(,<ACLScope>)*"
|
<ACLList> ::= "<ACLScope>(,<ACLScope>)*"
|
||||||
<APIScopeURLList> ::= "<APIScopeURL>(,<APIScopeURL>)*"
|
<APIScopeURLList> ::= "<APIScopeURL>(,<APIScopeURL>)*"
|
||||||
<ASPIDList> ::= "<ASPID>(,<ASPID>)*"
|
<ASPIDList> ::= "<ASPID>(,<ASPID>)*"
|
||||||
|
<AssetTagList> ::= "<AssetTag>(,<AssetTa>g)*"
|
||||||
<CalendarList> ::= "<CalendarItem>(,<CalendarItem>)*"
|
<CalendarList> ::= "<CalendarItem>(,<CalendarItem>)*"
|
||||||
<ChatRoomList> ::= "<ChatRoom>(,<ChatRoom>)*"
|
<ChatRoomList> ::= "<ChatRoom>(,<ChatRoom>)*"
|
||||||
<CollaboratorItemList> ::= "<CollaboratorItem>(,<CollaboratorItem>)*"
|
<CollaboratorItemList> ::= "<CollaboratorItem>(,<CollaboratorItem>)*"
|
||||||
@@ -1152,11 +1154,18 @@ 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 approve deviceuser [id] <DeviceUserID>
|
||||||
gam block deviceuser [id] <DeviceUserID>
|
gam block deviceuser [id] <DeviceUserID>
|
||||||
gam delete deviceuser [id] <DeviceUserID>
|
gam delete deviceuser [id] <DeviceUserID>
|
||||||
gam cancelwipe deviceuser [id] <DeviceUserID>
|
gam cancelwipe deviceuser [id] <DeviceUserID>
|
||||||
gam wipe 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]
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ def update_state():
|
|||||||
client_id = f'{customer}-{sys.argv[i+1]}'
|
client_id = f'{customer}-{sys.argv[i+1]}'
|
||||||
i += 2
|
i += 2
|
||||||
elif myarg in ['assettag', 'assettags']:
|
elif myarg in ['assettag', 'assettags']:
|
||||||
body['assetTags'] = sys.argv[i+1].split(',')
|
body['assetTags'] = gam.shlexSplitList(sys.argv[i+1])
|
||||||
if body['assetTags'] == ['clear']:
|
if body['assetTags'] == ['clear']:
|
||||||
# TODO: this doesn't work to clear
|
# TODO: this doesn't work to clear
|
||||||
# existing values. Figure out why.
|
# existing values. Figure out why.
|
||||||
@@ -176,21 +176,20 @@ def update_state():
|
|||||||
sys.argv[i+1])
|
sys.argv[i+1])
|
||||||
i += 2
|
i += 2
|
||||||
elif myarg == 'customvalue':
|
elif myarg == 'customvalue':
|
||||||
allowed_types = ['boolValue', 'numberValue', 'stringValue']
|
allowed_types = ['bool', 'number', 'string']
|
||||||
value_type = f'{sys.argv[i+1].lower()}Value'
|
value_type = sys.argv[i+1].lower()
|
||||||
if value_type not in allowed_types:
|
if value_type not in allowed_types:
|
||||||
controlflow.expected_argument_exit('custom_value',
|
controlflow.expected_argument_exit('custom_value',
|
||||||
', '.join(allowed_types),
|
', '.join(allowed_types),
|
||||||
sys.argv[i+1])
|
sys.argv[i+1])
|
||||||
key = sys.argv[i+2]
|
key = sys.argv[i+2]
|
||||||
value = sys.argv[i+3]
|
value = sys.argv[i+3]
|
||||||
if value_type == 'boolValue':
|
if value_type == 'bool':
|
||||||
value = gam.getBoolean(value, key)
|
value = gam.getBoolean(value, key)
|
||||||
elif value_type == 'numberValue':
|
elif value_type == 'number':
|
||||||
value = int(value)
|
value = int(value)
|
||||||
if 'keyValuePairs' not in body:
|
body.setdefault('keyValuePairs', {})
|
||||||
body['keyValuePairs'] = {}
|
body['keyValuePairs'][key] = {f'{value_type}Value': value}
|
||||||
body['keyValuePairs'][key] = {value_type: value}
|
|
||||||
i += 4
|
i += 4
|
||||||
elif myarg in ['managedstate']:
|
elif myarg in ['managedstate']:
|
||||||
managed_states = gapi.get_enum_values_minus_unspecified(
|
managed_states = gapi.get_enum_values_minus_unspecified(
|
||||||
|
|||||||
Reference in New Issue
Block a user