diff --git a/docs/Chrome-Browser-Cloud-Management.md b/docs/Chrome-Browser-Cloud-Management.md index f9dabb11..77c5de10 100644 --- a/docs/Chrome-Browser-Cloud-Management.md +++ b/docs/Chrome-Browser-Cloud-Management.md @@ -193,7 +193,8 @@ Select the fields to be displayed: * `annotated` - Display these fields: deviceId,annotatedAssetId,annotatedLocation,annotatedNotes,annotatedUser * `basic` - Display all fields except: browsers, lastDeviceUsers, lastStatusReportTime, machinePloicies; this is the default * `allfields/full` - Display all fields -* `* [fields ]` - Displaya selected list of fields +* `* [fields ]` - Display a selected list of fields + * Note that `ou, org and orgunit` are both command line options and field names; use `fields` to include them in the selected list of fields By default, Gam displays the information as an indented list of keys and values: - `formatjson` - Display the fields in JSON format. @@ -232,7 +233,8 @@ Select the fields to be displayed: * `annotated` - Display these fields: deviceId,annotatedAssetId,annotatedLocation,annotatedNotes,annotatedUser * `basic` - Display all fields except: browsers, lastDeviceUsers, lastStatusReportTime, machinePloicies; this is the default * `allfields/full` - Display all fields -* `* [fields ]` - Displaya selected list of fields +* `* [fields ]` - Display a selected list of fields + * Note that `ou, org and orgunit` are both command line options and field names; use `fields` to include them in the selected list of fields By default, Gam displays the information as columns of fields; the following option causes the output to be in JSON format: * `formatjson` - Display the fields in JSON format. diff --git a/docs/GamUpdates.md b/docs/GamUpdates.md index ee0a5fe2..15657b17 100644 --- a/docs/GamUpdates.md +++ b/docs/GamUpdates.md @@ -10,6 +10,11 @@ Add the `-s` option to the end of the above commands to suppress creating the `g See [Downloads-Installs](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads-Installs) for Windows or other options, including manual installation +### 6.79.06 + +Fixed bug in `gam calendars update event ... removeattendee ` that caused a trap +if the event had no attendees. + ### 6.79.05 Updated `gam empty drivetrash ` to handle this error that diff --git a/docs/How-to-Upgrade-from-Standard-GAM.md b/docs/How-to-Upgrade-from-Standard-GAM.md index 3d9ca687..e4f4bb94 100644 --- a/docs/How-to-Upgrade-from-Standard-GAM.md +++ b/docs/How-to-Upgrade-from-Standard-GAM.md @@ -251,7 +251,7 @@ writes the credentials into the file oauth2.txt. admin@server:/Users/admin$ rm -f /Users/admin/GAMConfig/oauth2.txt admin@server:/Users/admin$ gam version WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found -GAMADV-XTD3 6.79.05 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.79.06 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.4 64-bit final MacOS Sonoma 14.5 x86_64 @@ -923,7 +923,7 @@ writes the credentials into the file oauth2.txt. C:\>del C:\GAMConfig\oauth2.txt C:\>gam version WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found -GAMADV-XTD3 6.79.05 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.79.06 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.4 64-bit final Windows-10-10.0.17134 AMD64 diff --git a/docs/Shared-Drives.md b/docs/Shared-Drives.md index 0c332e97..4e766dea 100644 --- a/docs/Shared-Drives.md +++ b/docs/Shared-Drives.md @@ -72,6 +72,22 @@ ::= /|(/)+ ::= | + ::= + createddate|createdtime| + folder| + lastviewedbyme|lastviewedbymedate|lastviewedbymetime|lastviewedbyuser| + modifiedbyme|modifiedbymedate|modifiedbymetime|modifiedbyuser| + modifieddate|modifiedtime| + name| + name_natural| + quotabytesused|quotaused| + recency| + sharedwithmedate|sharedwithmetime| + starred| + title| + title_natural| + viewedbymedate|viewedbymetime + ::= manager|organizer|owner| contentmanager|fileorganizer| diff --git a/docs/Users-Drive-Ownership.md b/docs/Users-Drive-Ownership.md index 4ae98d23..5431d664 100644 --- a/docs/Users-Drive-Ownership.md +++ b/docs/Users-Drive-Ownership.md @@ -63,6 +63,10 @@ gam transfer ownership (orderby [ascending|descending])* [preview] [filepath] [pathdelimiter ] [buildtree] [todrive *] ``` +`` specifies a file/folder owned by the source user ``. + +The target user is specified by ``. + By default, there is no change of parents for the transferred files/folders, they remain in their current location. * `` - Specify a parent folder in the My Drive of the target user ``. diff --git a/docs/Users-Drive-Permissions.md b/docs/Users-Drive-Permissions.md index 1075d858..e9ca09aa 100644 --- a/docs/Users-Drive-Permissions.md +++ b/docs/Users-Drive-Permissions.md @@ -25,6 +25,22 @@ ::= id: ::= || + ::= + createddate|createdtime| + folder| + lastviewedbyme|lastviewedbymedate|lastviewedbymetime|lastviewedbyuser| + modifiedbyme|modifiedbymedate|modifiedbymetime|modifiedbyuser| + modifieddate|modifiedtime| + name| + name_natural| + quotabytesused|quotaused| + recency| + sharedwithmedate|sharedwithmetime| + starred| + title| + title_natural| + viewedbymedate|viewedbymetime + ::= additionalroles| allowfilediscovery| diff --git a/docs/Users-Drive-Transfer.md b/docs/Users-Drive-Transfer.md index 37943c43..aa74c72e 100644 --- a/docs/Users-Drive-Transfer.md +++ b/docs/Users-Drive-Transfer.md @@ -19,6 +19,22 @@ ::= @ ::= id: ::= || + + ::= + createddate|createdtime| + folder| + lastviewedbyme|lastviewedbymedate|lastviewedbymetime|lastviewedbyuser| + modifiedbyme|modifiedbymedate|modifiedbymetime|modifiedbyuser| + modifieddate|modifiedtime| + name| + name_natural| + quotabytesused|quotaused| + recency| + sharedwithmedate|sharedwithmetime| + starred| + title| + title_natural| + viewedbymedate|viewedbymetime ``` ## GAM Data Transfers ``` diff --git a/docs/Users-Shared-Drives.md b/docs/Users-Shared-Drives.md index c7b0aa57..b99746ac 100644 --- a/docs/Users-Shared-Drives.md +++ b/docs/Users-Shared-Drives.md @@ -73,6 +73,22 @@ ::= /|(/)+ ::= | + ::= + createddate|createdtime| + folder| + lastviewedbyme|lastviewedbymedate|lastviewedbymetime|lastviewedbyuser| + modifiedbyme|modifiedbymedate|modifiedbymetime|modifiedbyuser| + modifieddate|modifiedtime| + name| + name_natural| + quotabytesused|quotaused| + recency| + sharedwithmedate|sharedwithmetime| + starred| + title| + title_natural| + viewedbymedate|viewedbymetime + ::= manager|organizer|owner| contentmanager|fileorganizer| diff --git a/docs/Version-and-Help.md b/docs/Version-and-Help.md index 044ba462..3f0d1f77 100644 --- a/docs/Version-and-Help.md +++ b/docs/Version-and-Help.md @@ -3,7 +3,7 @@ Print the current version of Gam with details ``` gam version -GAMADV-XTD3 6.79.05 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.79.06 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.4 64-bit final MacOS Sonoma 14.5 x86_64 @@ -15,7 +15,7 @@ Time: 2023-06-02T21:10:00-07:00 Print the current version of Gam with details and time offset information ``` gam version timeoffset -GAMADV-XTD3 6.79.05 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.79.06 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.4 64-bit final MacOS Sonoma 14.5 x86_64 @@ -27,7 +27,7 @@ Your system time differs from www.googleapis.com by less than 1 second Print the current version of Gam with extended details and SSL information ``` gam version extended -GAMADV-XTD3 6.79.05 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.79.06 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.4 64-bit final MacOS Sonoma 14.5 x86_64 @@ -64,7 +64,7 @@ MacOS High Sierra 10.13.6 x86_64 Path: /Users/Admin/bin/gamadv-xtd3 Version Check: Current: 5.35.08 - Latest: 6.79.05 + Latest: 6.79.06 echo $? 1 ``` @@ -72,7 +72,7 @@ echo $? Print the current version number without details ``` gam version simple -6.79.05 +6.79.06 ``` In Linux/MacOS you can do: ``` @@ -82,7 +82,7 @@ echo $VER Print the current version of Gam and address of this Wiki ``` gam help -GAM 6.79.05 - https://github.com/taers232c/GAMADV-XTD3 +GAM 6.79.06 - https://github.com/taers232c/GAMADV-XTD3 Ross Scroggs Python 3.12.4 64-bit final MacOS Sonoma 14.5 x86_64 diff --git a/src/GamUpdate.txt b/src/GamUpdate.txt index 802cb92f..84f1195a 100644 --- a/src/GamUpdate.txt +++ b/src/GamUpdate.txt @@ -2,6 +2,11 @@ Merged GAM-Team version +6.79.06 + +Fixed bug in `gam calendars update event ... removeattendee ` that caused a trap +if the event had no attendees. + 6.79.05 Updated `gam empty drivetrash ` to handle this error that diff --git a/src/gam/__init__.py b/src/gam/__init__.py index a747fd2e..1a606f20 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -5183,7 +5183,7 @@ def checkGAPIError(e, softErrors=False, retryOnHttpError=False, mapNotFound=True elif http_status == 409: if status == 'ALREADY_EXISTS' or 'requested entity already exists' in lmessage: error = makeErrorDict(http_status, GAPI.ALREADY_EXISTS, message) - elif status == 'ABORTED': + elif status == 'ABORTED' or 'the operation was aborted' in lmessage: error = makeErrorDict(http_status, GAPI.ABORTED, message) elif http_status == 412: if 'insufficient archived user licenses' in lmessage: @@ -13659,7 +13659,7 @@ def doReport(): elif myarg in {'range', 'thismonth', 'previousmonths'}: startEndTime.Get(myarg) userCustomerRange = True - elif myarg in {'orgunit', 'org', 'ou'}: + elif myarg in {'ou', 'org', 'orgunit'}: if cd is None: cd = buildGAPIObject(API.DIRECTORY) orgUnit, orgUnitId = getOrgUnitId(cd) @@ -24832,7 +24832,7 @@ def doInfoPrintShowCrOSTelemetry(): myarg = getArgument() if csvPF and myarg == 'todrive': csvPF.GetTodriveParameters() - elif myarg in ['ou', 'org', 'orgunit', 'limittoou', 'ouandchildren', 'crossn', 'filter']: + elif myarg in {'ou', 'org', 'orgunit', 'limittoou', 'ouandchildren', 'crossn', 'filter'}: if pfilters: Cmd.Backup() usageErrorExit(Msg.ONLY_ONE_DEVICE_SELECTION_ALLOWED.format(pfilters[0][1])) @@ -25038,7 +25038,7 @@ def doMoveBrowsers(): queryTimes = {} while Cmd.ArgumentsRemaining(): myarg = getArgument() - if myarg in ['ou', 'org', 'orgunit']: + if myarg in {'ou', 'org', 'orgunit'}: orgUnitPath = getOrgUnitItem() elif myarg == 'ids': deviceIds.extend(convertEntityToList(getString(Cmd.OB_DEVICE_ID_LIST, minLen=0))) @@ -25203,7 +25203,7 @@ def doPrintShowBrowsers(): queries = getQueries(myarg) elif myarg.startswith('querytime'): queryTimes[myarg] = getTimeOrDeltaFromNow()[0:19] - elif myarg in ['ou', 'org', 'orgunit', 'browserou']: + elif myarg in {'ou', 'org', 'orgunit', 'browserou'}: orgUnitPath = getOrgUnitItem(pathOnly=True, absolutePath=True) elif myarg == 'select': _, entityList = getEntityToModify(defaultEntityType=Cmd.ENTITY_BROWSER, browserAllowed=True, crosAllowed=False, userAllowed=False) @@ -25312,7 +25312,7 @@ def doCreateBrowserToken(): body = {'token_type': 'CHROME_BROWSER'} while Cmd.ArgumentsRemaining(): myarg = getArgument() - if myarg in ['ou', 'org', 'orgunit', 'browserou']: + if myarg in {'ou', 'org', 'orgunit', 'browserou'}: body['org_unit_path'] = getOrgUnitItem(pathOnly=True, absolutePath=True) elif myarg in ['expire', 'expires']: body['expire_time'] = getTimeOrDeltaFromNow() @@ -25356,6 +25356,7 @@ BROWSER_TOKEN_FIELDS_CHOICE_MAP = { 'org': 'orgUnitPath', 'orgunit': 'orgUnitPath', 'orgunitpath': 'orgUnitPath', + 'ou': 'orgUnitPath', 'revoketime': 'revokeTime', 'revokerid': 'revokerId', 'state': 'state', @@ -25404,7 +25405,7 @@ def doPrintShowBrowserTokens(): queries = getQueries(myarg) elif myarg.startswith('querytime'): queryTimes[myarg] = getTimeOrDeltaFromNow()[0:19] - elif myarg in ['ou', 'org', 'orgunit', 'browserou']: + elif myarg in {'ou', 'org', 'orgunit', 'browserou'}: orgUnitPath = getOrgUnitItem(pathOnly=True, absolutePath=True) elif myarg == 'orderby': orderBy, sortOrder = getOrderBySortOrder(BROWSER_TOKEN_FIELDS_CHOICE_MAP, 'DESCENDING', True) @@ -28848,7 +28849,7 @@ def _getPrinterAttributes(cd, jsonDeleteFields): body['displayName'] = getString(Cmd.OB_STRING) elif myarg == 'makeandmodel': body['makeAndModel'] = getString(Cmd.OB_STRING) - elif myarg in ['ou', 'org', 'orgunit', 'orgunitid']: + elif myarg in {'ou', 'org', 'orgunit', 'orgunitid'}: _, body['orgUnitId'] = getOrgUnitId(cd) body['orgUnitId'] = body['orgUnitId'][3:] elif myarg == 'uri': @@ -37606,6 +37607,8 @@ def _updateCalendarEvents(origUser, user, origCal, calIds, count, calendarEventE body['attendees'].append(addAttendee) elif parameters['attendees']: body['attendees'] = parameters['attendees'] + else: + body['attendees'] = [] elif parameters['attendees']: body['attendees'] = parameters['attendees'] else: @@ -39862,7 +39865,7 @@ def doCreateVaultHold(): elif myarg in {'accounts', 'users', 'groups'}: accountsLocation = Cmd.Location() accounts = getEntityList(Cmd.OB_EMAIL_ADDRESS_ENTITY) - elif myarg in {'orgunit', 'org', 'ou'}: + elif myarg in {'ou', 'org', 'orgunit'}: body['orgUnit'] = {'orgUnitId': getOrgUnitId()[1]} elif _getHoldQueryParameters(myarg, queryParameters): pass @@ -39930,7 +39933,7 @@ def doUpdateVaultHold(): elif myarg in {'removeusers', 'removeaccounts', 'removegroups'}: removeAccountsLocation = Cmd.Location() removeAccounts = getEntityList(Cmd.OB_EMAIL_ADDRESS_ENTITY) - elif myarg in {'orgunit', 'org', 'ou'}: + elif myarg in {'ou', 'org', 'orgunit'}: body['orgUnit'] = {'orgUnitId': getOrgUnitId()[1]} elif _getHoldQueryParameters(myarg, queryParameters): pass @@ -43136,6 +43139,7 @@ USER_FIELDS_CHOICE_MAP = { 'organizations': 'organizations', 'organisation': 'organizations', 'organisations': 'organizations', + 'orgunit': 'orgUnitPath', 'orgunitpath': 'orgUnitPath', 'otheremail': 'emails', 'otheremails': 'emails', @@ -44941,7 +44945,7 @@ def _getInboundSSOAssignmentArguments(ci, cd, body): body['signInBehavior'] = {'redirectCondition': 'NEVER'} elif myarg == 'group': _, body['targetGroup'], _ = convertGroupEmailToCloudID(ci, getString(Cmd.OB_STRING)) - elif myarg in ['ou', 'org', 'orgunit']: + elif myarg in {'ou', 'org', 'orgunit'}: body['targetOrgUnit'] = getCIOrgunitID(cd, getString(Cmd.OB_ORGUNIT_ITEM)) else: unknownArgumentExit() @@ -64064,7 +64068,7 @@ def doPrintShowOrgunitSharedDrives(): myarg = getArgument() if csvPF and myarg == 'todrive': csvPF.GetTodriveParameters() - elif myarg in ['ou', 'org', 'orgunit']: + elif myarg in {'ou', 'org', 'orgunit'}: orgUnitPath = getString(Cmd.OB_ORGUNIT_ITEM) else: FJQC.GetFormatJSONQuoteChar(myarg, True) @@ -74452,6 +74456,8 @@ MAIN_COMMANDS_OBJ_ALIASES = { Cmd.ARG_MOBILES: Cmd.ARG_MOBILE, Cmd.ARG_NICKNAME: Cmd.ARG_ALIAS, Cmd.ARG_NICKNAMES: Cmd.ARG_ALIAS, + Cmd.ARG_ORGUNIT: Cmd.ARG_ORG, + Cmd.ARG_ORGUNITS: Cmd.ARG_ORGS, Cmd.ARG_ORGUNITSHAREDDRIVES: Cmd.ARG_ORGUNITSHAREDDRIVE, Cmd.ARG_OU: Cmd.ARG_ORG, Cmd.ARG_OUS: Cmd.ARG_ORGS, diff --git a/src/gam/gamlib/glclargs.py b/src/gam/gamlib/glclargs.py index e246c673..833bb29f 100644 --- a/src/gam/gamlib/glclargs.py +++ b/src/gam/gamlib/glclargs.py @@ -672,6 +672,8 @@ class GamCLArgs(): ARG_ORG = 'org' ARG_ORGS = 'orgs' ARG_ORGTREE = 'orgtree' + ARG_ORGUNIT = 'orgunit' + ARG_ORGUNITS = 'orgunits' ARG_ORGUNITSHAREDDRIVE = 'orgunitshareddrive' ARG_ORGUNITSHAREDDRIVES = 'orgunitshareddrives' ARG_ORPHANS = 'orphans'