From ae4578758a65540675326a804a2fa28c2b2b6905 Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Thu, 10 Aug 2023 11:06:40 -0700 Subject: [PATCH] Added command `gam print diskusage` to display disk usage by folder. --- docs/GamUpdates.md | 10 ++ docs/How-to-Upgrade-from-Standard-GAM.md | 6 +- docs/Inbound-SSO.md | 1 + docs/Other-Resources.md | 2 + docs/Users-Drive-Files-Display.md | 91 ++++++++++ docs/Users-Drive-Shortcuts.md | 2 +- src/GamCommands.txt | 6 + src/GamUpdate.txt | 10 ++ src/gam/__init__.py | 201 ++++++++++++++++++++++- src/gam/gamlib/glclargs.py | 1 + src/gam/gamlib/glentity.py | 2 + 11 files changed, 327 insertions(+), 5 deletions(-) diff --git a/docs/GamUpdates.md b/docs/GamUpdates.md index d0e9f427..d3336cd2 100644 --- a/docs/GamUpdates.md +++ b/docs/GamUpdates.md @@ -10,6 +10,16 @@ Add the `-s` option to the end of the above commands to suppress creating the `g See [Downloads](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads) for Windows or other options, including manual installation. +### 6.62.05 + +Added progress messages (suppressible) to `gam print diskusage`. + +### 6.62.04 + +Added command `gam print diskusage` to display disk usage by folder. + +* See: https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Drive-Files-Display#display-disk-usage + ### 6.62.03 Handled Google Directory API bug in `gam print groups` that caused a trap. diff --git a/docs/How-to-Upgrade-from-Standard-GAM.md b/docs/How-to-Upgrade-from-Standard-GAM.md index a840f5c3..364b636f 100644 --- a/docs/How-to-Upgrade-from-Standard-GAM.md +++ b/docs/How-to-Upgrade-from-Standard-GAM.md @@ -329,7 +329,7 @@ writes the credentials into the file oauth2.txt. admin@server:/Users/admin/bin/gamadv-xtd3$ rm -f /Users/admin/GAMConfig/oauth2.txt admin@server:/Users/admin/bin/gamadv-xtd3$ ./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.62.00 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.62.05 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.10.8 64-bit final MacOS High Sierra 10.13.6 x86_64 @@ -969,7 +969,7 @@ writes the credentials into the file oauth2.txt. C:\GAMADV-XTD3>del C:\GAMConfig\oauth2.txt C:\GAMADV-XTD3>gam version WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found -GAMADV-XTD3 6.62.00 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.62.05 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.11.4 64-bit final Windows-10-10.0.17134 AMD64 @@ -1234,6 +1234,8 @@ Section: DEFAULT num_threads = 5 oauth2_txt = oauth2.txt ; C:\GAMConfig\oauth2.txt oauth2service_json = oauth2service.json ; C:\GAMConfig\oauth2service.json + output_dateformat = '' + output_timeformat = '' people_max_results = 100 quick_cros_move = false quick_info_user = False diff --git a/docs/Inbound-SSO.md b/docs/Inbound-SSO.md index 31c10c8c..4972d0e8 100644 --- a/docs/Inbound-SSO.md +++ b/docs/Inbound-SSO.md @@ -53,6 +53,7 @@ use the `returnnameonly` option to have GAM display just the profile name of the This will be useful in scripts that create|update a profile and then want to perform subsequent GAM commands that reference the profile. +``` gam delete inboundssoprofile ``` diff --git a/docs/Other-Resources.md b/docs/Other-Resources.md index ead95252..64bc0c91 100644 --- a/docs/Other-Resources.md +++ b/docs/Other-Resources.md @@ -11,3 +11,5 @@ Thank you. * Amado Tejada - https://github.com/amadotejada/GAMpass * Workspace Admins YouTube Channel - https://youtube.com/@googleworkspaceadmins * Goldy Arora - https://www.goldyarora.com/license-notifier/ +* Paul Ogier (Taming.Tech) - GAMADV-XTD3 Tutorials https://www.youtube.com/watch?v=g9LDeyXQNLI&list=PL_dLiK09pJVhKJxZHNk9CHK0q5hkZ856w +* Paul Ogier (Taming.Tech) - GAMADV-XTD3 Course on Udemy https://taming.tech/GAMCourse diff --git a/docs/Users-Drive-Files-Display.md b/docs/Users-Drive-Files-Display.md index d7b631cf..4e841b7c 100644 --- a/docs/Users-Drive-Files-Display.md +++ b/docs/Users-Drive-Files-Display.md @@ -28,6 +28,7 @@ - [File selection starting point for Display file list](#file-selection-starting-point-for-display-file-list) - [File selection with a particular drive label](#file-selection-with-a-particular-drive-label) - [Handle empty file lists](#handle-empty-file-lists) +- [Display disk usage](#display-disk-usage) ## API documentation * https://developers.google.com/drive/api/v3/reference/files @@ -1350,3 +1351,93 @@ Got 0 Drive Files/Folders that matched query ('me' in owners and name contains ' $ more Files.csv BadNews-NoData ``` +## Display disk usage +``` +gam print diskusage [todrive *] + [anyowner|(showownedby any|me|others)] + [pathdelimiter ] [excludetrashed] [stripcrsfromname] + (addcsvdata )* + [noprogress] [show all|summary|summaryandtrash] +``` +For each folder in ``, the following items are displayed: +* `User` - The email address of the user in `` +* `Owner` - The email address of the owner of the folder; omitted when displaying disk usage on Shared Drives +* `ownedByMe` - True if the folder is owned by `User`, False otherwise; omitted when displaying disk usage on Shared Drives +* `id` - The folder ID +* `name` - The Folder name +* `trashed` - True if the folder has been trashed, either explicitly or from a trashed parent folder, False otherwise +* `explicitlyTrashed` - True if the folder has been explicitly trashed, as opposed to recursively trashed from a parent folder, False otherwise +* `directFileCount` - The number of files directly in the folder +* `directFileSize` - The sum of the sizes of the files directly in the folder +* `directFolderCount` - The number of folders directly in the folder +* `totalFileCount` - The number of files directly in the folder and all of its subfolders +* `totalFileSize` - The sum of the sizes of the files directly in the folder and all of its subfolders +* `totalFolderCount` - The number of folders directly in the folder and all of its subfolders +* `path` - The path of the folder + +There is a final row detailing files and folders in the trash; it is omitted if `excludetrashed` or `show summary` are specified. +* `User` - The email address of the user in `` +* `Owner` - The email address of the user in `` +* `ownedByMe` - True +* `id` - Trash +* `name` - Trash +* `trashed` - True if there are any items in the trash +* `explicitlyTrashed` - True if any items have been explicitly trashed +* `directFileCount` - The number of explicitly trashed files +* `directFileSize` - The sum of the sizes of the explicitly trashed files +* `directFolderCount` - The number of explicitly trashed folders +* `totalFileCount` - The number of files in the trash +* `totalFileSize` - The sum of the sizes of the files in the trash +* `totalFolderCount` - The number of folders in the trash +* `path` - Trash + +By default, files owned by the user are counted. These options update the current query with the desired ownership. +* `showownedby me` - Count files owned by the user; this is the default +* `showownedby any` or `anyowner` - Count files accessible by the user +* `showownedby others` - Count files not owned by the user + +All folders are counted, regardless of ownership. + +By default, file path components are separated by `/`; use `pathdelimiter ` to use `` as the separator. + +Use the `excludetrashed` option to suppress counting files and folders in the trash. + +The `stripcrsfromname` option strips nulls, carriage returns and linefeeds from drive file names. +Use this option if you discover filenames containing these special characters; it is not common. + +Add additional columns of data from the command line to the output: +* `addcsvdata ` + +By default, progress messages are displayed for each folder, use `noprogress` to suppress these messages. + +Use the `show` option to control the display of data: +* `all` - Display a row for every folder in `` and a row detailing items in the trash when `excludetrashed` is omitted. This is the default. +* `summary` - Display a single row for the first folder in `` +* `summaryandtrash` - Display a single row for the first folder in `` and a row detailing items in the trash when `excludetrashed` is omitted. + +### Examples +``` +$ gam redirect csv ./MyDriveUsage.csv user testsimple@domain.com print diskusage mydrive +User: testsimple@domain.com, Print 1 Drive Disk Usage +$ more MyDriveUsage.csv +User,Owner,id,name,ownedByMe,trashed,explicitlyTrashed,directFileCount,directFileSize,directFolderCount,totalFileCount,totalFileSize,totalFolderCount,path +testsimple@domain.com,testsimple@domain.com,012YenC8f12ALUk9PVA,My Drive,,False,False,100,138212,24,167,189598,79,My Drive +testsimple@domain.com,testsimple@domain.com,456YenC8f12ALfndaQ1NHc0RtUG92Y1BIUUl4bjVBRmNkWG5oakNqVVFDcXJWOHNmdFlwZmc,Classroom,True,False,False,0,0,15,9,6840,17,My Drive/Classroom +... +testsimple@domain.com,testsimple@domain.com,1bHS_Tp77W3KSGRNSs_jP1RhAJhIGRCaI,XferFolder,True,False,False,1,1024,0,1,1024,0,My Drive/XferFolder +testsimple@domain.com,testsimple@domain.com,Trash,Trash,,True,True,0,0,1,3,3072,9,Trash + +$ gam redirect csv ./MyDriveUsage.csv user testsimple@domain.com print diskusage mydrive show summaryandtrash +User: testsimple@domain.com, Print 1 Drive Disk Usage +$ more MyDriveUsage.csv +User,Owner,id,name,ownedByMe,trashed,explicitlyTrashed,directFileCount,directFileSize,directFolderCount,totalFileCount,totalFileSize,totalFolderCount,path +testsimple@domain.com,testsimple@domain.com,012YenC8f12ALUk9PVA,My Drive,,False,False,100,138212,24,167,189598,79,My Drive +testsimple@domain.com,testsimple@domain.com,Trash,Trash,,True,True,0,0,1,3,3072,9,Trash + +$ gam redirect csv ./MyDriveUsage.csv user testsimple@domain.com print diskusage shareddriveid 0AL5LiIe4dqxZUk9PVA show summaryandtrash +User: testsimple@domain.com, Print 1 Drive Disk Usage +$ more MyDriveUsage.csv +User,id,name,trashed,explicitlyTrashed,directFileCount,directFileSize,directFolderCount,totalFileCount,totalFileSize,totalFolderCount,path +testsimple@domain.com,0125LiIe4dqxZUk9PVA,TS Shared Drive 1,False,False,16,6144,7,42,73799,25,SharedDrives/TS Shared Drive 1 +testsimple@domain.com,Trash,Trash,True,True,1,1024,0,1,1024,0,Trash +``` diff --git a/docs/Users-Drive-Shortcuts.md b/docs/Users-Drive-Shortcuts.md index 095bb85a..b86ddc7d 100644 --- a/docs/Users-Drive-Shortcuts.md +++ b/docs/Users-Drive-Shortcuts.md @@ -69,7 +69,7 @@ Alternatively, you can direct the output to a CSV file: To retrieve the shortcut ID with `returnidonly`: ``` Linux/MacOS -fileId=`gam user user@domain.com create drivefileshortcut ... returnidonly` +fileId=$(gam user user@domain.com create drivefileshortcut ... returnidonly) Windows PowerShell $fileId = & gam user user@domain.com create drivefileshortcut ... returnidonly ``` diff --git a/src/GamCommands.txt b/src/GamCommands.txt index ae16f943..455cf7f6 100644 --- a/src/GamCommands.txt +++ b/src/GamCommands.txt @@ -6556,6 +6556,12 @@ gam print filelist [todrive *] (addcsvdata )* [formatjson [quotechar ]] +gam print diskusage [todrive *] + [anyowner|(showownedby any|me|others)] + [pathdelimiter ] [excludetrashed] [stripcrsfromname] + (addcsvdata )* + [noprogress] [show all|summary|summaryandtrash] + ::= comment| create| diff --git a/src/GamUpdate.txt b/src/GamUpdate.txt index 8ef850f2..af4e7a0f 100644 --- a/src/GamUpdate.txt +++ b/src/GamUpdate.txt @@ -2,6 +2,16 @@ Merged GAM-Team version +6.62.05 + +Added progress messages (suppressible) to `gam print diskusage`. + +6.62.04 + +Added command `gam print diskusage` to display disk usage by folder. + +* See: https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Drive-Files-Display#display-disk-usage + 6.62.03 Handled Google Directory API bug in `gam print groups` that caused a trap. diff --git a/src/gam/__init__.py b/src/gam/__init__.py index a7eb6858..52500bb3 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -51209,6 +51209,8 @@ def noFileSelectFileIdEntity(fileIdEntity): and not fileIdEntity['shareddrivefilequery'] and not fileIdEntity['list'])) +SHOW_OWNED_BY_CHOICE_MAP = {'any': None, 'me': True, 'others': False} + class DriveListParameters(): def __init__(self, myargOptions): self.PM = PermissionMatch() @@ -51230,7 +51232,6 @@ class DriveListParameters(): self.showOwnedBy = True self.showSharedByMe = None - SHOW_OWNED_BY_CHOICE_MAP = {'any': None, 'me': True, 'others': False} SHOW_SHARED_BY_ME_CHOICE_MAP = {'any': None, 'true': True, 'false': False} def ProcessArgument(self, myarg, fileIdEntity): @@ -51250,7 +51251,7 @@ class DriveListParameters(): self.showOwnedBy = None self.UpdateAnyOwnerQuery() elif myarg == 'showownedby': - self.showOwnedBy = getChoice(self.SHOW_OWNED_BY_CHOICE_MAP, mapChoice=True) + self.showOwnedBy = getChoice(SHOW_OWNED_BY_CHOICE_MAP, mapChoice=True) self.UpdateQueryWithShowOwnedBy() elif myarg == 'showmimetype': self.mimeTypeCheck.Get() @@ -52437,6 +52438,200 @@ def printShowFileCounts(users): if csvPF: csvPF.writeCSVfile('Drive File Counts') +DISKUSAGE_SHOW_CHOICES = {'all', 'summary', 'summaryandtrash'} + +# gam print diskusage [todrive *] +# [anyowner|(showownedby any|me|others)] +# [pathdelimiter ] [excludetrashed] [stripcrsfromname] +# (addcsvdata )* +# [noprogress] [show all|summary|summaryandtrash] +def printDiskUsage(users): + def _getChildDriveFolderInfo(drive, fileEntry, user, i, count): + q = WITH_PARENTS.format(fileEntry['id']) + try: + children = callGAPIpages(drive.files(), 'list', 'files', + throwReasons=GAPI.DRIVE_USER_THROW_REASONS+[GAPI.INVALID_QUERY, GAPI.INVALID], + retryReasons=[GAPI.UNKNOWN_ERROR], + q=q, orderBy=orderBy, fields=pagesFields, + pageSize=GC.Values[GC.DRIVE_MAX_RESULTS], supportsAllDrives=True, includeItemsFromAllDrives=True) + except (GAPI.invalidQuery, GAPI.invalid): + entityActionFailedWarning([Ent.USER, user, Ent.DRIVE_FOLDER, None], invalidQuery(q), i, count) + return + except (GAPI.serviceNotAvailable, GAPI.authError, GAPI.domainPolicy) as e: + userSvcNotApplicableOrDriveDisabled(user, str(e), i, count) + return + Ind.Increment() + if showProgress: + entityActionPerformed([Ent.USER, user, Ent.DRIVE_FOLDER, fileEntry['path']]) + for childEntryInfo in children: + trashed = childEntryInfo['trashed'] + if trashed and excludeTrashed: + continue + mimeType = childEntryInfo.pop('mimeType') + if mimeType == MIMETYPE_GA_FOLDER: + fileEntry['directFolderCount'] += 1 + fileEntry['totalFolderCount'] += 1 + if trashed: + trashFolder['totalFolderCount'] += 1 + if childEntryInfo['explicitlyTrashed']: + trashFolder['directFolderCount'] += 1 + childEntryInfo['User'] = user + if includeOwner: + owners = childEntryInfo.pop('owners', []) + if owners: + childEntryInfo['Owner'] = owners[0].get('emailAddress', 'Unknown') + childEntryInfo.update(zeroFolderInfo) + if stripCRsFromName: + childEntryInfo['name'] = _stripControlCharsFromName(childEntryInfo['name']) + childEntryInfo['path'] = fileEntry['path']+pathDelimiter+childEntryInfo['name'] + foldersList.append(childEntryInfo) + _getChildDriveFolderInfo(drive, childEntryInfo, user, i, count) + fileEntry['totalFileCount'] += childEntryInfo['totalFileCount'] + fileEntry['totalFileSize'] += childEntryInfo['totalFileSize'] + fileEntry['totalFolderCount'] += childEntryInfo['totalFolderCount'] + elif mimeType != MIMETYPE_GA_SHORTCUT: + if includeOwner and showOwnedBy is not None and childEntryInfo['ownedByMe'] != showOwnedBy: + continue + fsize = int(childEntryInfo.get('size', '0')) + fileEntry['directFileCount'] += 1 + fileEntry['directFileSize'] += fsize + fileEntry['totalFileCount'] += 1 + fileEntry['totalFileSize'] += fsize + if trashed: + trashFolder['totalFileCount'] += 1 + trashFolder['totalFileSize'] += fsize + if childEntryInfo['explicitlyTrashed']: + trashFolder['directFileCount'] += 1 + trashFolder['directFileSize'] += fsize + Ind.Decrement() + + csvPF = CSVPrintFile(['User', 'Owner', 'id', 'name', 'ownedByMe', 'trashed', 'explicitlyTrashed', + 'directFileCount', 'directFileSize', 'directFolderCount', + 'totalFileCount', 'totalFileSize', 'totalFolderCount', 'path']) + excludeTrashed = stripCRsFromName = False + includeOwner = True + orderBy = 'folder,name' + zeroFolderInfo = {'directFileCount': 0, 'directFileSize': 0, 'directFolderCount': 0, + 'totalFileCount': 0, 'totalFileSize': 0, 'totalFolderCount': 0} + showOwnedBy = showProgress = True + pathDelimiter = '/' + fileIdEntity = getDriveFileEntity() + addCSVData = {} + showResults = 'all' + while Cmd.ArgumentsRemaining(): + myarg = getArgument() + if myarg == 'todrive': + csvPF.GetTodriveParameters() + elif myarg == 'anyowner': + showOwnedBy = None + elif myarg == 'showownedby': + showOwnedBy = getChoice(SHOW_OWNED_BY_CHOICE_MAP, mapChoice=True) + elif myarg == 'pathdelimiter': + pathDelimiter = getCharacter() + elif myarg == 'excludetrashed': + excludeTrashed = True + elif myarg == 'stripcrsfromname': + stripCRsFromName = True + elif myarg == 'addcsvdata': + k = getString(Cmd.OB_STRING) + addCSVData[k] = getString(Cmd.OB_STRING, minLen=0) + elif myarg == 'show': + showResults = getChoice(DISKUSAGE_SHOW_CHOICES) + elif myarg == 'noprogress': + showProgress = False + else: + unknownArgumentExit() + if addCSVData: + csvPF.AddTitles(sorted(addCSVData.keys())) + fieldsList = ['id', 'name', 'mimeType', 'size', 'trashed', 'explicitlyTrashed', 'owners(emailAddress)', 'ownedByMe'] + pagesFields = getItemFieldsFromFieldsList('files', fieldsList) + topFieldsList = fieldsList[:] + topFieldsList.extend(['driveId', 'parents']) + topFields = getFieldsFromFieldsList(topFieldsList) + i, count, users = getEntityArgument(users) + i = 0 + for user in users: + i += 1 + origUser = user + user, drive, jcount = _validateUserGetFileIDs(origUser, i, count, fileIdEntity, entityType=Ent.DRIVE_DISK_USAGE) + if jcount == 0: + continue + j = 0 + for fileId in fileIdEntity['list']: + j += 1 + foldersList = [] + trashFolder = {'User': user, 'id': 'Trash', 'name': 'Trash', 'path': 'Trash'} + trashFolder.update(zeroFolderInfo) + try: + topFolder = callGAPI(drive.files(), 'get', + throwReasons=GAPI.DRIVE_GET_THROW_REASONS, + fileId=fileId, fields=topFields, supportsAllDrives=True) + if stripCRsFromName: + topFolder['name'] = _stripControlCharsFromName(topFolder['name']) + mimeType = topFolder.pop('mimeType') + if mimeType != MIMETYPE_GA_FOLDER: + entityValueList = [Ent.USER, user, _getEntityMimeType(topFolder), topFolder['name']] + entityActionNotPerformedWarning(entityValueList, Msg.INVALID_MIMETYPE.format(mimeType, MIMETYPE_GA_FOLDER), i, count) + continue + if topFolder['trashed']: + if excludeTrashed: + entityValueList = [Ent.USER, user, Ent.DRIVE_FOLDER, topFolder['name']] + entityActionNotPerformedWarning(entityValueList, Msg.IN_TRASH_AND_EXCLUDE_TRASHED, i, count) + continue + trashFolder['totalFolderCount'] += 1 + if topFolder['explicitlyTrashed']: + trashFolder['directFolderCount'] += 1 + driveId = topFolder.pop('driveId', None) + if driveId: + includeOwner = False + csvPF.RemoveTitles(['Owner', 'ownedByMe']) + if topFolder['name'] == TEAM_DRIVE and not topFolder.get('parents'): + topFolder['name'] = _getSharedDriveNameFromId(drive, driveId) + topFolder['path'] = f'{SHARED_DRIVES}{pathDelimiter}{topFolder["name"]}' + else: + topFolder['path'] = topFolder['name'] + elif topFolder['name'] == MY_DRIVE and not topFolder.get('parents'): + topFolder['path'] = MY_DRIVE + else: + topFolder['path'] = topFolder['name'] + topFolder['User'] = user + if includeOwner: + owners = topFolder.pop('owners', []) + if owners: + topFolder['Owner'] = owners[0].get('emailAddress', 'Unknown') + trashFolder['Owner'] = topFolder['Owner'] + topFolder.pop('ownedByMe', None) + topFolder.pop('parents', None) + topFolder.update(zeroFolderInfo) + foldersList.append(topFolder) + _getChildDriveFolderInfo(drive, topFolder, user, i, count) + except GAPI.fileNotFound: + entityActionFailedWarning([Ent.USER, user, Ent.DRIVE_FOLDER, fileId], Msg.NOT_FOUND, j, jcount) + continue + except (GAPI.notFound, GAPI.teamDriveMembershipRequired) as e: + entityActionFailedWarning([Ent.USER, user, Ent.SHAREDDRIVE_ID, fileIdEntity['shareddrive']['driveId']], str(e), j, jcount) + continue + except (GAPI.serviceNotAvailable, GAPI.authError, GAPI.domainPolicy) as e: + userSvcNotApplicableOrDriveDisabled(user, str(e), i, count) + break + if showResults == 'all': + for folder in foldersList: + if addCSVData: + folder.update(addCSVData) + csvPF.WriteRow(folder) + else: + folder = foldersList[0] + if addCSVData: + folder.update(addCSVData) + csvPF.WriteRow(folder) + if showResults != 'summary' and not excludeTrashed: + trashFolder['trashed'] = trashFolder['totalFileCount']+trashFolder['totalFolderCount'] > 0 + trashFolder['explicitlyTrashed'] = trashFolder['directFileCount']+trashFolder['directFolderCount'] > 0 + if addCSVData: + trashFolder.update(addCSVData) + csvPF.WriteRow(trashFolder) + csvPF.writeCSVfile('Drive Disk Usage') + FILESHARECOUNTS_OWNER = 'Owner' FILESHARECOUNTS_TOTAL = 'Total' FILESHARECOUNTS_SHARED = 'Shared' @@ -70356,6 +70551,7 @@ USER_COMMANDS_WITH_OBJECTS = { Cmd.ARG_DATASTUDIOASSET: printShowDataStudioAssets, Cmd.ARG_DATASTUDIOPERMISSION: printShowDataStudioPermissions, Cmd.ARG_DELEGATE: printShowDelegates, + Cmd.ARG_DISKUSAGE: printDiskUsage, Cmd.ARG_DRIVEACTIVITY: printDriveActivity, Cmd.ARG_DRIVEFILEACL: printShowDriveFileACLs, Cmd.ARG_DRIVELABEL: printShowDriveLabels, @@ -70447,6 +70643,7 @@ USER_COMMANDS_WITH_OBJECTS = { Cmd.ARG_DATASTUDIOASSET: printShowDataStudioAssets, Cmd.ARG_DATASTUDIOPERMISSION: printShowDataStudioPermissions, Cmd.ARG_DELEGATE: printShowDelegates, + Cmd.ARG_DISKUSAGE: printDiskUsage, Cmd.ARG_DRIVEACTIVITY: printDriveActivity, Cmd.ARG_DRIVEFILEACL: printShowDriveFileACLs, Cmd.ARG_DRIVELABEL: printShowDriveLabels, diff --git a/src/gam/gamlib/glclargs.py b/src/gam/gamlib/glclargs.py index db66638b..f45a13b1 100644 --- a/src/gam/gamlib/glclargs.py +++ b/src/gam/gamlib/glclargs.py @@ -532,6 +532,7 @@ class GamCLArgs(): ARG_DEVICEUSER = 'deviceuser' ARG_DEVICEUSERS = 'deviceusers' ARG_DEVICEUSERSTATE = 'deviceuserstate' + ARG_DISKUSAGE = 'diskusage' ARG_DOCUMENT = 'document' ARG_DOMAIN = 'domain' ARG_DOMAINS = 'domains' diff --git a/src/gam/gamlib/glentity.py b/src/gam/gamlib/glentity.py index 330efe7d..211ba79a 100644 --- a/src/gam/gamlib/glentity.py +++ b/src/gam/gamlib/glentity.py @@ -170,6 +170,7 @@ class GamEntity(): DOMAIN_CONTACT = 'doco' DOMAIN_PEOPLE_CONTACT = 'dopc' DOMAIN_PROFILE = 'dopr' + DRIVE_DISK_USAGE = 'drdu' DRIVE_FILE = 'dfil' DRIVE_FILE_ID = 'fili' DRIVE_FILE_NAME = 'filn' @@ -495,6 +496,7 @@ class GamEntity(): DOMAIN_CONTACT: ['Domain Contacts', 'Domain Contact'], DOMAIN_PEOPLE_CONTACT: ['Domain People Contacts', 'Domain People Contact'], DOMAIN_PROFILE: ['Domain Profiles', 'Domain Profile'], + DRIVE_DISK_USAGE: ['Drive Disk Usages', 'Drive Disk Usage'], DRIVE_FILE: ['Drive Files', 'Drive File'], DRIVE_FILE_ID: ['Drive File IDs', 'Drive File ID'], DRIVE_FILE_NAME: ['Drive File Names', 'Drive File Name'],