mirror of
https://github.com/GAM-team/GAM.git
synced 2026-06-21 22:51:37 +00:00
Compare commits
23 Commits
20250522.0
...
20250528.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
12f5c5e670 | ||
|
|
a1216b6782 | ||
|
|
05f4795bc3 | ||
|
|
e1ff1ba378 | ||
|
|
5b2804643e | ||
|
|
3925166987 | ||
|
|
5dece6c719 | ||
|
|
b48d316bd9 | ||
|
|
1f2b33b805 | ||
|
|
a6773901c9 | ||
|
|
840784fa98 | ||
|
|
aecb17b9fe | ||
|
|
2d90c75f03 | ||
|
|
cd8691b438 | ||
|
|
e2f0afe891 | ||
|
|
65cd2439d5 | ||
|
|
652ab1dc6d | ||
|
|
88cad201a5 | ||
|
|
9f8100dfbf | ||
|
|
7fbafb2ba0 | ||
|
|
2c631af66c | ||
|
|
3b900ca56f | ||
|
|
4a1e19a753 |
@@ -1876,7 +1876,7 @@ gam calendar <CalendarEntity> moveevent (id|eventid <EventID>)+ destination <Cal
|
||||
gam calendar <CalendarEntity> wipe
|
||||
gam calendar <CalendarEntity> printevents <EventSelectProperty>* <EventDisplayProperty>*
|
||||
[fields <EventFieldNameList>] [showdayofweek]
|
||||
[countsonly]
|
||||
[countsonly [eventrowfilter]]
|
||||
[formatjson [quotechar <Character>]] [todrive <ToDriveAttribute>*]
|
||||
|
||||
<CalendarSettingsField> ::=
|
||||
|
||||
@@ -1,3 +1,59 @@
|
||||
7.07.13
|
||||
|
||||
Added option `showitemcountonly` to `gam [<UserTypeEntity>] print|show shareddrives` that causes GAM to display the
|
||||
number of Shared Drives on stdout; no CSV file is written.
|
||||
|
||||
7.07.12
|
||||
|
||||
Fixed bug in `gam print|show oushareddrives` that caused a trap.
|
||||
|
||||
Improved getting Shared Drive names from IDs when accessing Shared Drives in external workspaces.
|
||||
|
||||
7.07.11
|
||||
|
||||
Updated `gam calendars <CalendarEntity> update events` and `gam <UserTypeEntity> update events <UserCalendarEntity>`
|
||||
to handle the following error:
|
||||
```
|
||||
ERROR: 400: badRequest - Bad Request
|
||||
```
|
||||
|
||||
Updated `gam <UserTypeEntity> move drivefile` to handle the following error:
|
||||
```
|
||||
ERROR: 400: shareOutNotPermitted
|
||||
```
|
||||
|
||||
7.07.10
|
||||
|
||||
Updated `gam calendars <CalendarEntity> update events` and `gam <UserTypeEntity> update events <UserCalendarEntity>`
|
||||
to handle the following error:
|
||||
```
|
||||
ERROR: 400: eventTypeRestriction - Attendees cannot be added to 'fromGmail' event with this visibility setting.
|
||||
```
|
||||
|
||||
7.07.09
|
||||
|
||||
Updated `gam calendars <CalendarEntity> update events` and `gam <UserTypeEntity> update events <UserCalendarEntity>`
|
||||
to handle the following error:
|
||||
```
|
||||
gamlib.glgapi.serviceNotAvailable: Authentication backend unavailable.
|
||||
```
|
||||
|
||||
7.07.08
|
||||
|
||||
Fixed bug in `gam <UserTypeEntity> print filelist ... countsonly` that issued an
|
||||
incorrect warning message like the following when `redirect csv <FileName> multiprocess` was specified.
|
||||
```
|
||||
WARNING: csv_output_row_filter column "^name$" does not match any output columns
|
||||
```
|
||||
|
||||
7.07.07
|
||||
|
||||
Fixed bug in `gam report <ActivityApplictionName> ... countsonly eventrowfilter` that issued an
|
||||
incorrect warning message like the following when `redirect csv <FileName> multiprocess` was specified.
|
||||
```
|
||||
WARNING: csv_output_row_filter column "^doc_title$" does not match any output columns
|
||||
```
|
||||
|
||||
7.07.06
|
||||
|
||||
Added option `eventrowfilter` to `gam calendars <CalendarEntity> print events ... countsonly`
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# GAM7
|
||||
#
|
||||
# Copyright 2024, All Rights Reserved.
|
||||
# Copyright 2025, All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
|
||||
"""
|
||||
|
||||
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
||||
__version__ = '7.07.06'
|
||||
__version__ = '7.07.13'
|
||||
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
||||
|
||||
#pylint: disable=wrong-import-position
|
||||
@@ -8565,7 +8565,7 @@ class CSVPrintFile():
|
||||
if not self.JSONtitlesSet:
|
||||
systemErrorExit(USAGE_ERROR_RC, Msg.NO_COLUMNS_SELECTED_WITH_CSV_OUTPUT_HEADER_FILTER.format(GC.CSV_OUTPUT_HEADER_FILTER, GC.CSV_OUTPUT_HEADER_DROP_FILTER))
|
||||
|
||||
def writeCSVfile(self, list_type):
|
||||
def writeCSVfile(self, list_type, clearRowFilters=False):
|
||||
|
||||
def todriveCSVErrorExit(entityValueList, errMsg):
|
||||
systemErrorExit(ACTION_FAILED_RC, formatKeyValueList(Ind.Spaces(),
|
||||
@@ -8956,11 +8956,13 @@ class CSVPrintFile():
|
||||
self.oneItemPerRow,
|
||||
self.showPermissionsLast,
|
||||
self.zeroBlankMimeTypeCounts)))
|
||||
if clearRowFilters:
|
||||
GM.Globals[GM.CSVFILE][GM.REDIRECT_QUEUE].put((GM.REDIRECT_QUEUE_CLEAR_ROW_FILTERS, clearRowFilters))
|
||||
GM.Globals[GM.CSVFILE][GM.REDIRECT_QUEUE].put((GM.REDIRECT_QUEUE_DATA, self.rows))
|
||||
return
|
||||
if self.zeroBlankMimeTypeCounts:
|
||||
self.ZeroBlankMimeTypeCounts()
|
||||
if self.rowFilter or self.rowDropFilter:
|
||||
if not clearRowFilters and (self.rowFilter or self.rowDropFilter):
|
||||
self.CheckOutputRowFilterHeaders()
|
||||
if self.headerFilter or self.headerDropFilter:
|
||||
if not self.formatJSON:
|
||||
@@ -9582,6 +9584,7 @@ def CSVFileQueueHandler(mpQueue, mpQueueStdout, mpQueueStderr, csvPF, datetimeNo
|
||||
GM.Globals[GM.DATETIME_NOW] = datetimeNow
|
||||
GC.Values[GC.TIMEZONE] = tzinfo
|
||||
GC.Values[GC.OUTPUT_TIMEFORMAT] = output_timeformat
|
||||
clearRowFilters = False
|
||||
# if sys.platform.startswith('win'):
|
||||
# signal.signal(signal.SIGINT, signal.SIG_IGN)
|
||||
if multiprocessing.get_start_method() == 'spawn':
|
||||
@@ -9639,9 +9642,15 @@ def CSVFileQueueHandler(mpQueue, mpQueueStdout, mpQueueStderr, csvPF, datetimeNo
|
||||
csvPF.SetTimestampColumn(GC.Values[GC.CSV_OUTPUT_TIMESTAMP_COLUMN])
|
||||
csvPF.SetHeaderFilter(GC.Values[GC.CSV_OUTPUT_HEADER_FILTER])
|
||||
csvPF.SetHeaderDropFilter(GC.Values[GC.CSV_OUTPUT_HEADER_DROP_FILTER])
|
||||
csvPF.SetRowFilter(GC.Values[GC.CSV_OUTPUT_ROW_FILTER], GC.Values[GC.CSV_OUTPUT_ROW_FILTER_MODE])
|
||||
csvPF.SetRowDropFilter(GC.Values[GC.CSV_OUTPUT_ROW_DROP_FILTER], GC.Values[GC.CSV_OUTPUT_ROW_DROP_FILTER_MODE])
|
||||
if not clearRowFilters:
|
||||
csvPF.SetRowFilter(GC.Values[GC.CSV_OUTPUT_ROW_FILTER], GC.Values[GC.CSV_OUTPUT_ROW_FILTER_MODE])
|
||||
csvPF.SetRowDropFilter(GC.Values[GC.CSV_OUTPUT_ROW_DROP_FILTER], GC.Values[GC.CSV_OUTPUT_ROW_DROP_FILTER_MODE])
|
||||
else:
|
||||
csvPF.SetRowFilter([], GC.Values[GC.CSV_OUTPUT_ROW_FILTER_MODE])
|
||||
csvPF.SetRowDropFilter([], GC.Values[GC.CSV_OUTPUT_ROW_DROP_FILTER_MODE])
|
||||
csvPF.SetRowLimit(GC.Values[GC.CSV_OUTPUT_ROW_LIMIT])
|
||||
elif dataType == GM.REDIRECT_QUEUE_CLEAR_ROW_FILTERS:
|
||||
clearRowFilters = dataItem
|
||||
else: #GM.REDIRECT_QUEUE_EOF
|
||||
break
|
||||
csvPF.writeCSVfile(list_type)
|
||||
@@ -14348,6 +14357,7 @@ def doReport():
|
||||
else:
|
||||
if eventRowFilter:
|
||||
csvPF.SetRowFilter([], GC.Values[GC.CSV_OUTPUT_ROW_FILTER_MODE])
|
||||
csvPF.SetRowDropFilter([], GC.Values[GC.CSV_OUTPUT_ROW_DROP_FILTER_MODE])
|
||||
if not countsSummary:
|
||||
titles = ['emailAddress']
|
||||
if countsOnly and countsByDate:
|
||||
@@ -14396,7 +14406,7 @@ def doReport():
|
||||
if addCSVData:
|
||||
row.update(addCSVData)
|
||||
csvPF.WriteRow(row)
|
||||
csvPF.writeCSVfile(f'{report.capitalize()} Activity Report')
|
||||
csvPF.writeCSVfile(f'{report.capitalize()} Activity Report', eventRowFilter)
|
||||
|
||||
# Substitute for #user#, #email#, #usernamne#
|
||||
def _substituteForUser(field, user, userName):
|
||||
@@ -39255,7 +39265,8 @@ def _updateCalendarEvents(origUser, user, origCal, calIds, count, calendarEventE
|
||||
try:
|
||||
if updateFieldList:
|
||||
event = callGAPI(cal.events(), 'get',
|
||||
throwReasons=GAPI.CALENDAR_THROW_REASONS+[GAPI.NOT_FOUND, GAPI.DELETED, GAPI.FORBIDDEN],
|
||||
throwReasons=GAPI.CALENDAR_THROW_REASONS+[GAPI.NOT_FOUND, GAPI.DELETED, GAPI.FORBIDDEN, GAPI.BACKEND_ERROR],
|
||||
retryReasons=GAPI.SERVICE_NOT_AVAILABLE_RETRY_REASONS+[GAPI.BACKEND_ERROR],
|
||||
calendarId=calId, eventId=eventId, fields=updateFields)
|
||||
if 'description' in updateFieldList and 'description' in event:
|
||||
body['description'] = event['description']
|
||||
@@ -39285,10 +39296,11 @@ def _updateCalendarEvents(origUser, user, origCal, calIds, count, calendarEventE
|
||||
if parameters['clearResources']:
|
||||
body['attendees'] = [attendee for attendee in body['attendees'] if not attendee['email'].lower().endswith('@resource.calendar.google.com')]
|
||||
event = callGAPI(cal.events(), 'patch',
|
||||
throwReasons=GAPI.CALENDAR_THROW_REASONS+[GAPI.NOT_FOUND, GAPI.DELETED, GAPI.FORBIDDEN,
|
||||
throwReasons=GAPI.CALENDAR_THROW_REASONS+[GAPI.NOT_FOUND, GAPI.DELETED, GAPI.FORBIDDEN, GAPI.BACKEND_ERROR,
|
||||
GAPI.INVALID, GAPI.REQUIRED, GAPI.TIME_RANGE_EMPTY, GAPI.EVENT_DURATION_EXCEEDS_LIMIT,
|
||||
GAPI.REQUIRED_ACCESS_LEVEL, GAPI.CANNOT_CHANGE_ORGANIZER_OF_INSTANCE,
|
||||
GAPI.MALFORMED_WORKING_LOCATION_EVENT],
|
||||
GAPI.MALFORMED_WORKING_LOCATION_EVENT, GAPI.EVENT_TYPE_RESTRICTION, GAPI.BAD_REQUEST],
|
||||
retryReasons=GAPI.SERVICE_NOT_AVAILABLE_RETRY_REASONS+[GAPI.BACKEND_ERROR],
|
||||
calendarId=calId, eventId=eventId, conferenceDataVersion=1, sendUpdates=parameters['sendUpdates'], supportsAttachments=True,
|
||||
body=body, fields=pfields)
|
||||
if parameters['csvPF'] is None:
|
||||
@@ -39302,8 +39314,9 @@ def _updateCalendarEvents(origUser, user, origCal, calIds, count, calendarEventE
|
||||
entityUnknownWarning(Ent.CALENDAR, calId, j, jcount)
|
||||
break
|
||||
entityActionFailedWarning([Ent.CALENDAR, calId, Ent.EVENT, eventId], str(e), j, jcount)
|
||||
except (GAPI.forbidden, GAPI.invalid, GAPI.required, GAPI.timeRangeEmpty, GAPI.eventDurationExceedsLimit,
|
||||
GAPI.requiredAccessLevel, GAPI.cannotChangeOrganizerOfInstance, GAPI.malformedWorkingLocationEvent) as e:
|
||||
except (GAPI.forbidden, GAPI.backendError, GAPI.invalid, GAPI.required, GAPI.timeRangeEmpty, GAPI.eventDurationExceedsLimit,
|
||||
GAPI.requiredAccessLevel, GAPI.cannotChangeOrganizerOfInstance, GAPI.malformedWorkingLocationEvent,
|
||||
GAPI.eventTypeRestriction, GAPI.badRequest) as e:
|
||||
entityActionFailedWarning([Ent.CALENDAR, calId, Ent.EVENT, eventId], str(e), j, jcount)
|
||||
except GAPI.notACalendarUser:
|
||||
userCalServiceNotEnabledWarning(calId, i, count)
|
||||
@@ -39925,9 +39938,10 @@ def doCalendarsPrintShowEvents(calIds):
|
||||
csvPF, FJQC, fieldsList)
|
||||
if csvPF:
|
||||
if calendarEventEntity['countsOnly'] and calendarEventEntity['eventRowFilter']:
|
||||
csvPF.SetRowFilter([], GC.Values[GC.CSV_OUTPUT_ROW_FILTER_MODE])
|
||||
csvPF.SetTitles(calendarEventEntity['countsOnlyTitles'])
|
||||
csvPF.writeCSVfile('Calendar Events')
|
||||
csvPF.writeCSVfile('Calendar Events', True)
|
||||
else:
|
||||
csvPF.writeCSVfile('Calendar Events')
|
||||
|
||||
# <CalendarSettings> ::==
|
||||
# [description <String>] [location <String>] [summary <String>] [timezone <TimeZone>]
|
||||
@@ -42007,22 +42021,21 @@ def printShowUserVaultHolds(entityList):
|
||||
else:
|
||||
printKeyValueList(['Total Holds', totalHolds])
|
||||
|
||||
def _cleanVaultQuery(query, cd):
|
||||
def _cleanVaultQuery(query, cd, drive):
|
||||
if 'query' in query:
|
||||
if cd is not None:
|
||||
if 'orgUnitInfo' in query['query']:
|
||||
query['query']['orgUnitInfo']['orgUnitPath'] = convertOrgUnitIDtoPath(cd, query['query']['orgUnitInfo']['orgUnitId'])
|
||||
if 'sharedDriveInfo' in query['query']:
|
||||
query['query']['sharedDriveInfo']['sharedDriveNames'] = []
|
||||
for sharedDriveId in query['query']['sharedDriveInfo']['sharedDriveIds']:
|
||||
query['query']['sharedDriveInfo']['sharedDriveNames'].append(_getSharedDriveNameFromId(sharedDriveId))
|
||||
if cd is not None and 'orgUnitInfo' in query['query']:
|
||||
query['query']['orgUnitInfo']['orgUnitPath'] = convertOrgUnitIDtoPath(cd, query['query']['orgUnitInfo']['orgUnitId'])
|
||||
if drive is not None and 'sharedDriveInfo' in query['query']:
|
||||
query['query']['sharedDriveInfo']['sharedDriveNames'] = []
|
||||
for sharedDriveId in query['query']['sharedDriveInfo']['sharedDriveIds']:
|
||||
query['query']['sharedDriveInfo']['sharedDriveNames'].append(_getSharedDriveNameFromId(drive, sharedDriveId, False))
|
||||
query['query'].pop('searchMethod', None)
|
||||
query['query'].pop('teamDriveInfo', None)
|
||||
|
||||
VAULT_QUERY_TIME_OBJECTS = {'createTime', 'endTime', 'startTime', 'versionDate'}
|
||||
|
||||
def _showVaultQuery(matterNameId, query, cd, FJQC, k=0, kcount=0):
|
||||
_cleanVaultQuery(query, cd)
|
||||
def _showVaultQuery(matterNameId, query, cd, drive, FJQC, k=0, kcount=0):
|
||||
_cleanVaultQuery(query, cd, drive)
|
||||
if FJQC is not None and FJQC.formatJSON:
|
||||
printLine(json.dumps(cleanJSON(query, timeObjects=VAULT_QUERY_TIME_OBJECTS), ensure_ascii=False, sort_keys=False))
|
||||
return
|
||||
@@ -42054,7 +42067,7 @@ def doInfoVaultQuery():
|
||||
queryId, queryName, queryNameId = convertQueryNameToID(v, getString(Cmd.OB_QUERY_ITEM), matterId, matterNameId)
|
||||
else:
|
||||
queryName = getString(Cmd.OB_QUERY_ITEM)
|
||||
cd = None
|
||||
cd = drive = None
|
||||
fieldsList = []
|
||||
FJQC = FormatJSONQuoteChar()
|
||||
while Cmd.ArgumentsRemaining():
|
||||
@@ -42064,8 +42077,8 @@ def doInfoVaultQuery():
|
||||
queryId, queryName, queryNameId = convertQueryNameToID(v, queryName, matterId, matterNameId)
|
||||
elif myarg == 'shownames':
|
||||
cd = buildGAPIObject(API.DIRECTORY)
|
||||
_, GM.Globals[GM.ADMIN_DRIVE] = buildGAPIServiceObject(API.DRIVE3, _getAdminEmail())
|
||||
if GM.Globals[GM.ADMIN_DRIVE] is None:
|
||||
_, drive = buildGAPIServiceObject(API.DRIVE3, _getAdminEmail())
|
||||
if drive is None:
|
||||
return
|
||||
elif getFieldsList(myarg, VAULT_QUERY_FIELDS_CHOICE_MAP, fieldsList, initialField=['savedQueryId', 'displayName']):
|
||||
pass
|
||||
@@ -42076,7 +42089,7 @@ def doInfoVaultQuery():
|
||||
query = callGAPI(v.matters().savedQueries(), 'get',
|
||||
throwReasons=[GAPI.NOT_FOUND, GAPI.BAD_REQUEST, GAPI.FORBIDDEN, GAPI.INVALID_ARGUMENT],
|
||||
matterId=matterId, savedQueryId=queryId, fields=fields)
|
||||
_showVaultQuery(matterNameId, query, cd, FJQC)
|
||||
_showVaultQuery(matterNameId, query, cd, drive, FJQC)
|
||||
except (GAPI.notFound, GAPI.badRequest, GAPI.forbidden, GAPI.invalidArgument) as e:
|
||||
entityActionFailedWarning([Ent.VAULT_MATTER, matterNameId, Ent.VAULT_QUERY, queryNameId], str(e))
|
||||
|
||||
@@ -42093,7 +42106,7 @@ def doPrintShowVaultQueries():
|
||||
csvPF = CSVPrintFile(PRINT_VAULT_QUERIES_TITLES, 'sortall') if Act.csvFormat() else None
|
||||
FJQC = FormatJSONQuoteChar(csvPF)
|
||||
matters = []
|
||||
cd = None
|
||||
cd = drive = None
|
||||
fieldsList = []
|
||||
while Cmd.ArgumentsRemaining():
|
||||
myarg = getArgument()
|
||||
@@ -42103,8 +42116,8 @@ def doPrintShowVaultQueries():
|
||||
matters = shlexSplitList(getString(Cmd.OB_MATTER_ITEM_LIST))
|
||||
elif myarg == 'shownames':
|
||||
cd = buildGAPIObject(API.DIRECTORY)
|
||||
_, GM.Globals[GM.ADMIN_DRIVE] = buildGAPIServiceObject(API.DRIVE3, _getAdminEmail())
|
||||
if GM.Globals[GM.ADMIN_DRIVE] is None:
|
||||
_, drive = buildGAPIServiceObject(API.DRIVE3, _getAdminEmail())
|
||||
if drive is None:
|
||||
return
|
||||
elif getFieldsList(myarg, VAULT_QUERY_FIELDS_CHOICE_MAP, fieldsList, initialField=['savedQueryId', 'displayName']):
|
||||
pass
|
||||
@@ -42166,11 +42179,11 @@ def doPrintShowVaultQueries():
|
||||
k = 0
|
||||
for query in queries:
|
||||
k += 1
|
||||
_showVaultQuery(matterNameId, query, cd, FJQC, k, kcount)
|
||||
_showVaultQuery(matterNameId, query, cd, drive, FJQC, k, kcount)
|
||||
Ind.Decrement()
|
||||
else:
|
||||
for query in queries:
|
||||
_cleanVaultQuery(query, cd)
|
||||
_cleanVaultQuery(query, cd, drive)
|
||||
row = flattenJSON(query, flattened={'matterId': matterId, 'matterName': matterName}, timeObjects=VAULT_QUERY_TIME_OBJECTS)
|
||||
if not FJQC.formatJSON:
|
||||
csvPF.WriteRowTitles(row)
|
||||
@@ -51419,9 +51432,10 @@ def printShowCalendarEvents(users):
|
||||
Ind.Decrement()
|
||||
if csvPF:
|
||||
if calendarEventEntity['countsOnly'] and calendarEventEntity['eventRowFilter']:
|
||||
csvPF.SetRowFilter([], GC.Values[GC.CSV_OUTPUT_ROW_FILTER_MODE])
|
||||
csvPF.SetTitles(calendarEventEntity['countsOnlyTitles'])
|
||||
csvPF.writeCSVfile('Calendar Events')
|
||||
csvPF.writeCSVfile('Calendar Events', True)
|
||||
else:
|
||||
csvPF.writeCSVfile('Calendar Events')
|
||||
|
||||
def getStatusEventDateTime(dateType, dateList):
|
||||
if dateType == 'timerange':
|
||||
@@ -52432,20 +52446,15 @@ def _convertSharedDriveNameToId(drive, user, i, count, fileIdEntity, useDomainAd
|
||||
','.join([td['id'] for td in tdlist])), i, count)
|
||||
return False
|
||||
|
||||
def _getSharedDriveNameFromId(sharedDriveId):
|
||||
def _getSharedDriveNameFromId(drive, sharedDriveId, useDomainAdminAccess=False):
|
||||
sharedDriveName = GM.Globals[GM.MAP_SHAREDDRIVE_ID_TO_NAME].get(sharedDriveId)
|
||||
if not sharedDriveName:
|
||||
if not GM.Globals[GM.ADMIN_DRIVE]:
|
||||
_, GM.Globals[GM.ADMIN_DRIVE] = buildGAPIServiceObject(API.DRIVE3, _getAdminEmail())
|
||||
if GM.Globals[GM.ADMIN_DRIVE]:
|
||||
try:
|
||||
sharedDriveName = callGAPI(GM.Globals[GM.ADMIN_DRIVE].drives(), 'get',
|
||||
throwReasons=GAPI.DRIVE_USER_THROW_REASONS+[GAPI.NOT_FOUND],
|
||||
useDomainAdminAccess=True,
|
||||
driveId=sharedDriveId, fields='name')['name']
|
||||
except (GAPI.notFound, GAPI.serviceNotAvailable, GAPI.authError, GAPI.domainPolicy):
|
||||
sharedDriveName = TEAM_DRIVE
|
||||
else:
|
||||
try:
|
||||
sharedDriveName = callGAPI(drive.drives(), 'get',
|
||||
throwReasons=GAPI.DRIVE_USER_THROW_REASONS+[GAPI.NOT_FOUND],
|
||||
useDomainAdminAccess=useDomainAdminAccess,
|
||||
driveId=sharedDriveId, fields='name')['name']
|
||||
except (GAPI.notFound, GAPI.serviceNotAvailable, GAPI.authError, GAPI.domainPolicy):
|
||||
sharedDriveName = TEAM_DRIVE
|
||||
GM.Globals[GM.MAP_SHAREDDRIVE_ID_TO_NAME][sharedDriveId] = sharedDriveName
|
||||
return sharedDriveName
|
||||
@@ -52458,7 +52467,7 @@ def _getDriveFileNameFromId(drive, fileId, combineTitleId=True, useDomainAdminAc
|
||||
if result:
|
||||
fileName = result['name']
|
||||
if (result['mimeType'] == MIMETYPE_GA_FOLDER) and result.get('driveId') and (result['name'] == TEAM_DRIVE):
|
||||
fileName = _getSharedDriveNameFromId(result['driveId'])
|
||||
fileName = _getSharedDriveNameFromId(drive, result['driveId'])
|
||||
if combineTitleId:
|
||||
fileName += '('+fileId+')'
|
||||
return (fileName, _getEntityMimeType(result), result['mimeType'])
|
||||
@@ -53540,7 +53549,7 @@ def getFilePaths(drive, fileTree, initialResult, filePathInfo, addParentsToTree=
|
||||
fullpath=False, showDepth=False, folderPathOnly=False):
|
||||
def _getParentName(result):
|
||||
if (result['mimeType'] == MIMETYPE_GA_FOLDER) and result.get('driveId') and (result['name'] == TEAM_DRIVE):
|
||||
parentName = _getSharedDriveNameFromId(result['driveId'])
|
||||
parentName = _getSharedDriveNameFromId(drive, result['driveId'])
|
||||
if parentName != TEAM_DRIVE:
|
||||
return f'{SHARED_DRIVES}{filePathInfo["delimiter"]}{parentName}'
|
||||
return result['name']
|
||||
@@ -54239,9 +54248,9 @@ def showFileInfo(users):
|
||||
driveId = result.get('driveId')
|
||||
if driveId:
|
||||
if result['mimeType'] == MIMETYPE_GA_FOLDER and result['name'] == TEAM_DRIVE:
|
||||
result['name'] = _getSharedDriveNameFromId(driveId)
|
||||
result['name'] = _getSharedDriveNameFromId(drive, driveId)
|
||||
if DFF.showSharedDriveNames:
|
||||
result['driveName'] = _getSharedDriveNameFromId(driveId)
|
||||
result['driveName'] = _getSharedDriveNameFromId(drive, driveId)
|
||||
if showNoParents:
|
||||
result.setdefault('parents', [])
|
||||
if getPermissionsForSharedDrives and driveId and 'permissions' not in result:
|
||||
@@ -54929,7 +54938,7 @@ def extendFileTreeParents(drive, fileTree, fields):
|
||||
result['parents'] = [ORPHANS] if result.get('ownedByMe', False) and 'sharedWithMeTime' not in result else [SHARED_WITHME]
|
||||
else:
|
||||
if result['name'] == TEAM_DRIVE:
|
||||
result['name'] = _getSharedDriveNameFromId(result['driveId'])
|
||||
result['name'] = _getSharedDriveNameFromId(drive, result['driveId'])
|
||||
result['parents'] = [SHARED_DRIVES] if 'sharedWithMeTime' not in result else [SHARED_WITHME]
|
||||
fileTree[fileId]['info'] = result
|
||||
fileTree[fileId]['info']['noDisplay'] = True
|
||||
@@ -55674,7 +55683,7 @@ def printFileList(users):
|
||||
if not pmselect and 'permissions' in fileInfo:
|
||||
fileInfo['permissions'] = DLP.GetFileMatchingPermission(fileInfo)
|
||||
if DFF.showSharedDriveNames and driveId:
|
||||
fileInfo['driveName'] = _getSharedDriveNameFromId(driveId)
|
||||
fileInfo['driveName'] = _getSharedDriveNameFromId(drive, driveId)
|
||||
if filepath:
|
||||
if not FJQC.formatJSON or not addPathsToJSON:
|
||||
addFilePathsToRow(drive, fileTree, fileInfo, filePathInfo, csvPF, row,
|
||||
@@ -56197,6 +56206,7 @@ def printFileList(users):
|
||||
summaryMimeTypeInfo[mimeType]['size'] += mtinfo['size']
|
||||
if summary != FILECOUNT_SUMMARY_ONLY:
|
||||
writeMimeTypeCountsRow(user, 'Various', 'Various', mimeTypeInfo)
|
||||
titlePrefix = f'{Cmd.Argument(GM.Globals[GM.ENTITY_CL_START])} {Cmd.Argument(GM.Globals[GM.ENTITY_CL_START]+1)} ' if GM.Globals[GM.CSVFILE][GM.REDIRECT_QUEUE] is None else ''
|
||||
if not countsOnly:
|
||||
if not csvPF.rows:
|
||||
setSysExitRC(NO_ENTITIES_FOUND_RC)
|
||||
@@ -56205,22 +56215,14 @@ def printFileList(users):
|
||||
else:
|
||||
if 'JSON' in csvPF.JSONtitlesList:
|
||||
csvPF.MoveJSONTitlesToEnd(['JSON'])
|
||||
if GM.Globals[GM.CSVFILE][GM.REDIRECT_QUEUE] is None:
|
||||
csvPF.writeCSVfile(f'{Cmd.Argument(GM.Globals[GM.ENTITY_CL_START])} {Cmd.Argument(GM.Globals[GM.ENTITY_CL_START]+1)} Drive Files')
|
||||
else:
|
||||
csvPF.writeCSVfile('Drive Files')
|
||||
csvPF.writeCSVfile(f'{titlePrefix}Drive Files')
|
||||
else:
|
||||
if not csvPFco.rows:
|
||||
setSysExitRC(NO_ENTITIES_FOUND_RC)
|
||||
if summary != FILECOUNT_SUMMARY_NONE:
|
||||
writeMimeTypeCountsRow(summaryUser, 'Various', 'Various', summaryMimeTypeInfo)
|
||||
csvPFco.todrive = csvPF.todrive
|
||||
if not countsRowFilter:
|
||||
csvPFco.SetRowFilter([], GC.Values[GC.CSV_OUTPUT_ROW_FILTER_MODE])
|
||||
if GM.Globals[GM.CSVFILE][GM.REDIRECT_QUEUE] is None:
|
||||
csvPFco.writeCSVfile(f'{Cmd.Argument(GM.Globals[GM.ENTITY_CL_START])} {Cmd.Argument(GM.Globals[GM.ENTITY_CL_START]+1)} Drive File Counts')
|
||||
else:
|
||||
csvPFco.writeCSVfile('Drive File Counts')
|
||||
csvPFco.writeCSVfile(f'{titlePrefix}Drive File Counts', not countsRowFilter)
|
||||
|
||||
FILECOMMENTS_FIELDS_CHOICE_MAP = {
|
||||
'action': 'action',
|
||||
@@ -56551,7 +56553,7 @@ def printShowFilePaths(users):
|
||||
driveId = result.get('driveId')
|
||||
if driveId:
|
||||
if result['mimeType'] == MIMETYPE_GA_FOLDER and result['name'] == TEAM_DRIVE:
|
||||
result['name'] = _getSharedDriveNameFromId(driveId)
|
||||
result['name'] = _getSharedDriveNameFromId(drive, driveId)
|
||||
if returnPathOnly:
|
||||
if fullpath:
|
||||
writeStdout(f'{SHARED_DRIVES}/{result["name"]}\n')
|
||||
@@ -56641,7 +56643,7 @@ def printFileParentTree(users):
|
||||
driveId = result.get('driveId')
|
||||
if driveId:
|
||||
if result['mimeType'] == MIMETYPE_GA_FOLDER and result['name'] == TEAM_DRIVE:
|
||||
result['name'] = _getSharedDriveNameFromId(driveId)
|
||||
result['name'] = _getSharedDriveNameFromId(drive, driveId)
|
||||
result['isRoot'] = True
|
||||
result['parents'] = ['']
|
||||
fileList.append(result)
|
||||
@@ -56878,7 +56880,7 @@ def printShowFileCounts(users):
|
||||
if not drive:
|
||||
continue
|
||||
sharedDriveId = fileIdEntity.get('shareddrive', {}).get('driveId', '')
|
||||
sharedDriveName = _getSharedDriveNameFromId(sharedDriveId) if sharedDriveId else ''
|
||||
sharedDriveName = _getSharedDriveNameFromId(drive, sharedDriveId) if sharedDriveId else ''
|
||||
mimeTypeInfo = {}
|
||||
userLastModification = _initLastModification()
|
||||
gettingEntity = _getGettingEntity(user, fileIdEntity)
|
||||
@@ -57023,7 +57025,7 @@ def printShowDrivelastModifications(users):
|
||||
if not drive:
|
||||
continue
|
||||
sharedDriveId = fileIdEntity.get('shareddrive', {}).get('driveId', '')
|
||||
sharedDriveName = _getSharedDriveNameFromId(sharedDriveId) if sharedDriveId else ''
|
||||
sharedDriveName = _getSharedDriveNameFromId(drive, sharedDriveId) if sharedDriveId else ''
|
||||
userLastModification = _initLastModification()
|
||||
gettingEntity = _getGettingEntity(user, fileIdEntity)
|
||||
printGettingAllEntityItemsForWhom(Ent.DRIVE_FILE_OR_FOLDER, gettingEntity, i, count)
|
||||
@@ -57206,7 +57208,7 @@ def printDiskUsage(users):
|
||||
includeOwner = False
|
||||
csvPF.RemoveTitles(['Owner', 'ownedByMe'])
|
||||
if topFolder['name'] == TEAM_DRIVE and not topFolder.get('parents'):
|
||||
topFolder['name'] = _getSharedDriveNameFromId(driveId)
|
||||
topFolder['name'] = _getSharedDriveNameFromId(drive, driveId)
|
||||
topFolder['path'] = f'{SHARED_DRIVES}{pathDelimiter}{topFolder["name"]}'
|
||||
else:
|
||||
topFolder['path'] = topFolder['name']
|
||||
@@ -57646,7 +57648,7 @@ def printShowFileTree(users):
|
||||
fileId=fileId, fields=fields, supportsAllDrives=True)
|
||||
if (fileEntryInfo['mimeType'] == MIMETYPE_GA_FOLDER and fileEntryInfo.get('driveId') and
|
||||
fileEntryInfo['name'] == TEAM_DRIVE and not fileEntryInfo.get('parents', [])):
|
||||
fileEntryInfo['name'] = f"{SHARED_DRIVES}/{_getSharedDriveNameFromId(fileId)}"
|
||||
fileEntryInfo['name'] = f"{SHARED_DRIVES}/{_getSharedDriveNameFromId(drive, fileId)}"
|
||||
if stripCRsFromName:
|
||||
fileEntryInfo['name'] = _stripControlCharsFromName(fileEntryInfo['name'])
|
||||
if buildTree:
|
||||
@@ -59287,7 +59289,7 @@ def _getCopyMoveParentInfo(drive, user, i, count, j, jcount, newParentId, statis
|
||||
result['destParentType'] = DEST_PARENT_MYDRIVE_FOLDER
|
||||
else:
|
||||
if result['name'] == TEAM_DRIVE and not result.get('parents', []):
|
||||
result['name'] = _getSharedDriveNameFromId(result['driveId'])
|
||||
result['name'] = _getSharedDriveNameFromId(drive, result['driveId'])
|
||||
result['destParentType'] = DEST_PARENT_SHAREDDRIVE_ROOT
|
||||
else:
|
||||
result['destParentType'] = DEST_PARENT_SHAREDDRIVE_FOLDER
|
||||
@@ -59836,7 +59838,8 @@ def copyDriveFile(users):
|
||||
# Source at root of Shared Drive?
|
||||
sourceMimeType = source['mimeType']
|
||||
if sourceMimeType == MIMETYPE_GA_FOLDER and source.get('driveId') and source['name'] == TEAM_DRIVE and not source.get('parents', []):
|
||||
source['name'] = _getSharedDriveNameFromId(source['driveId'])
|
||||
copyMoveOptions['sourceIsMyDriveSharedDrive'] = True
|
||||
source['name'] = _getSharedDriveNameFromId(drive, source['driveId'])
|
||||
sourceName = source['name']
|
||||
sourceNameId = f"{sourceName}({source['id']})"
|
||||
copyMoveOptions['sourceDriveId'] = source.get('driveId')
|
||||
@@ -60442,6 +60445,7 @@ def moveDriveFile(users):
|
||||
GAPI.FILE_OWNER_NOT_MEMBER_OF_TEAMDRIVE,
|
||||
GAPI.FILE_OWNER_NOT_MEMBER_OF_WRITER_DOMAIN,
|
||||
GAPI.FILE_WRITER_TEAMDRIVE_MOVE_IN_DISABLED,
|
||||
GAPI.SHARE_OUT_NOT_PERMITTED,
|
||||
GAPI.TARGET_USER_ROLE_LIMITED_BY_LICENSE_RESTRICTION,
|
||||
GAPI.CANNOT_MOVE_TRASHED_ITEM_INTO_TEAMDRIVE,
|
||||
GAPI.CANNOT_MOVE_TRASHED_ITEM_OUT_OF_TEAMDRIVE,
|
||||
@@ -60456,7 +60460,7 @@ def moveDriveFile(users):
|
||||
_incrStatistic(statistics, STAT_FILE_COPIED_MOVED)
|
||||
return
|
||||
except (GAPI.fileNotFound, GAPI.forbidden, GAPI.internalError, GAPI.unknownError, GAPI.badRequest,
|
||||
GAPI.targetUserRoleLimitedByLicenseRestriction,
|
||||
GAPI.shareOutNotPermitted, GAPI.targetUserRoleLimitedByLicenseRestriction,
|
||||
GAPI.cannotMoveTrashedItemIntoTeamDrive, GAPI.cannotMoveTrashedItemOutOfTeamDrive,
|
||||
GAPI.teamDrivesShortcutFileNotSupported, GAPI.storageQuotaExceeded) as e:
|
||||
entityActionFailedWarning(kvList, str(e), k, kcount)
|
||||
@@ -60606,7 +60610,7 @@ def moveDriveFile(users):
|
||||
if sourceMimeType == MIMETYPE_GA_FOLDER and source['name'] in [MY_DRIVE, TEAM_DRIVE] and not source.get('parents', []):
|
||||
copyMoveOptions['sourceIsMyDriveSharedDrive'] = True
|
||||
if source.get('driveId'):
|
||||
source['name'] = _getSharedDriveNameFromId(source['driveId'])
|
||||
source['name'] = _getSharedDriveNameFromId(drive, source['driveId'])
|
||||
sourceName = source['name']
|
||||
sourceNameId = f"{sourceName}({source['id']})"
|
||||
copyMoveOptions['sourceDriveId'] = source.get('driveId')
|
||||
@@ -63050,7 +63054,7 @@ def printEmptyDriveFolders(users):
|
||||
fileIdEntity['shareddrive'] = {'driveId': sharedDriveId, 'corpora': 'drive', 'includeItemsFromAllDrives': True, 'supportsAllDrives': True}
|
||||
csvPF.AddTitles(['driveId'])
|
||||
csvPF.MoveTitlesToEnd(['name'])
|
||||
pathList = [f'{SHARED_DRIVES}/{_getSharedDriveNameFromId(sharedDriveId)}']
|
||||
pathList = [f'{SHARED_DRIVES}/{_getSharedDriveNameFromId(drive, sharedDriveId)}']
|
||||
else:
|
||||
pathList = [fileEntryInfo['name']]
|
||||
mimeType = fileEntryInfo['mimeType']
|
||||
@@ -63140,7 +63144,7 @@ def deleteEmptyDriveFolders(users):
|
||||
if 'driveId' in fileEntryInfo:
|
||||
sharedDriveId = fileEntryInfo['driveId']
|
||||
fileIdEntity['shareddrive'] = {'driveId': sharedDriveId, 'corpora': 'drive', 'includeItemsFromAllDrives': True, 'supportsAllDrives': True}
|
||||
pathList = [f'{SHARED_DRIVES}/{_getSharedDriveNameFromId(sharedDriveId)}']
|
||||
pathList = [f'{SHARED_DRIVES}/{_getSharedDriveNameFromId(drive, sharedDriveId)}']
|
||||
else:
|
||||
pathList = [fileEntryInfo['name']]
|
||||
mimeType = fileEntryInfo['mimeType']
|
||||
@@ -65413,12 +65417,14 @@ SHAREDDRIVE_ACL_ROLES_MAP = {
|
||||
# (role|roles <SharedDriveACLRoleList>)*
|
||||
# [fields <SharedDriveFieldNameList>] [noorgunits [<Boolean>]]
|
||||
# [guiroles [<Boolean>]] [formatjson [quotechar <Character>]]
|
||||
# [showitemcountonly]
|
||||
# gam <UserTypeEntity> show shareddrives
|
||||
# [asadmin [shareddriveadminquery|query <QuerySharedDrive>]]
|
||||
# [matchname <REMatchPattrn>] [orgunit|org|ou <OrgUnitPath>]
|
||||
# (role|roles <SharedDriveACLRoleLIst>)*
|
||||
# [fields <SharedDriveFieldNameList>] [noorgunits [<Boolean>]]
|
||||
# [guiroles [<Boolean>]] [formatjson]
|
||||
# [showitemcountonly]
|
||||
def printShowSharedDrives(users, useDomainAdminAccess=False):
|
||||
def stripNonShowFields(shareddrive):
|
||||
if orgUnitIdToPathMap:
|
||||
@@ -65442,7 +65448,7 @@ def printShowSharedDrives(users, useDomainAdminAccess=False):
|
||||
SHAREDDRIVE_FIELDS_CHOICE_MAP.update(SHAREDDRIVE_LIST_FIELDS_CHOICE_MAP)
|
||||
showOrgUnitPaths = True
|
||||
orgUnitIdToPathMap = None
|
||||
guiRoles = False
|
||||
guiRoles = showItemCountOnly = False
|
||||
while Cmd.ArgumentsRemaining():
|
||||
myarg = getArgument()
|
||||
if csvPF and myarg == 'todrive':
|
||||
@@ -65472,6 +65478,9 @@ def printShowSharedDrives(users, useDomainAdminAccess=False):
|
||||
showOrgUnitPaths = not getBoolean()
|
||||
elif myarg == 'guiroles':
|
||||
guiRoles = getBoolean()
|
||||
elif myarg == 'showitemcountonly':
|
||||
showItemCountOnly = True
|
||||
showOrgUnitPaths = False
|
||||
else:
|
||||
FJQC.GetFormatJSONQuoteChar(myarg, True)
|
||||
if query and not useDomainAdminAccess:
|
||||
@@ -65541,6 +65550,9 @@ def printShowSharedDrives(users, useDomainAdminAccess=False):
|
||||
jcount = len(matchedFeed)
|
||||
if jcount == 0:
|
||||
setSysExitRC(NO_ENTITIES_FOUND_RC)
|
||||
if showItemCountOnly:
|
||||
writeStdout(f'{jcount}\n')
|
||||
return
|
||||
if not csvPF:
|
||||
if not FJQC.formatJSON:
|
||||
entityPerformActionNumItems([Ent.USER, user], jcount, Ent.SHAREDDRIVE, i, count)
|
||||
@@ -65571,13 +65583,15 @@ def doPrintShowSharedDrives():
|
||||
# gam print oushareddrives [todrive <ToDriveAttribute>*]
|
||||
# [ou|org|orgunit <OrgUnitPath>]
|
||||
# [formatjson [quotechar <Character>]]
|
||||
# [showitemcountonly]
|
||||
# gam show oushareddrives
|
||||
# [ou|org|orgunit <OrgUnitPath>]
|
||||
# [formatjson]
|
||||
# [showitemcountonly]
|
||||
def doPrintShowOrgunitSharedDrives():
|
||||
def _getOrgUnitSharedDriveInfo(shareddrive):
|
||||
shareddrive['driveId'] = shareddrive['name'].rsplit(';')[1]
|
||||
shareddrive['driveName'] = _getSharedDriveNameFromId(shareddrive['driveId'])
|
||||
shareddrive['driveName'] = _getSharedDriveNameFromId(drive, shareddrive['driveId'], True)
|
||||
shareddrive['orgUnitPath'] = orgUnitPath
|
||||
|
||||
def _showOrgUnitSharedDrive(shareddrive, j, jcount, FJQC):
|
||||
@@ -65591,23 +65605,26 @@ def doPrintShowOrgunitSharedDrives():
|
||||
printEntity([Ent.MEMBER_URI, shareddrive['memberUri']])
|
||||
printEntity([Ent.SHAREDDRIVE_ID, shareddrive['driveId']])
|
||||
printEntity([Ent.SHAREDDRIVE_NAME, shareddrive['driveName']])
|
||||
printEntity([Ent.ORGANIZATIONAL_UNIT, shareddrive['orgUnit']])
|
||||
printEntity([Ent.ORGANIZATIONAL_UNIT, shareddrive['orgUnitPath']])
|
||||
Ind.Decrement()
|
||||
|
||||
ci = buildGAPIObject(API.CLOUDIDENTITY_ORGUNITS_BETA)
|
||||
cd = buildGAPIObject(API.DIRECTORY)
|
||||
_, GM.Globals[GM.ADMIN_DRIVE] = buildGAPIServiceObject(API.DRIVE3, _getAdminEmail())
|
||||
if not GM.Globals[GM.ADMIN_DRIVE]:
|
||||
_, drive = buildGAPIServiceObject(API.DRIVE3, _getAdminEmail())
|
||||
if drive is None:
|
||||
return
|
||||
csvPF = CSVPrintFile(['name', 'type', 'member', 'memberUri', 'driveId', 'driveName', 'orgUnitPath']) if Act.csvFormat() else None
|
||||
FJQC = FormatJSONQuoteChar(csvPF)
|
||||
orgUnitPath = '/'
|
||||
showItemCountOnly = False
|
||||
while Cmd.ArgumentsRemaining():
|
||||
myarg = getArgument()
|
||||
if csvPF and myarg == 'todrive':
|
||||
csvPF.GetTodriveParameters()
|
||||
elif myarg in {'ou', 'org', 'orgunit'}:
|
||||
orgUnitPath = getString(Cmd.OB_ORGUNIT_ITEM)
|
||||
elif myarg == 'showitemcountonly':
|
||||
showItemCountOnly = True
|
||||
else:
|
||||
FJQC.GetFormatJSONQuoteChar(myarg, True)
|
||||
if csvPF and FJQC.formatJSON:
|
||||
@@ -65622,6 +65639,9 @@ def doPrintShowOrgunitSharedDrives():
|
||||
jcount = len(sds)
|
||||
if jcount == 0:
|
||||
setSysExitRC(NO_ENTITIES_FOUND_RC)
|
||||
if showItemCountOnly:
|
||||
writeStdout(f'{jcount}\n')
|
||||
return
|
||||
if not csvPF:
|
||||
if not FJQC.formatJSON:
|
||||
entityPerformActionNumItems([Ent.ORGANIZATIONAL_UNIT, orgUnitPath], jcount, Ent.SHAREDDRIVE)
|
||||
@@ -65676,13 +65696,13 @@ def copySyncSharedDriveACLs(users, useDomainAdminAccess=False):
|
||||
if not drive:
|
||||
continue
|
||||
if not srcFileIdEntity.get('shareddrivename'):
|
||||
srcFileIdEntity['shareddrivename'] = _getSharedDriveNameFromId(srcFileIdEntity['shareddrive']['driveId'])
|
||||
srcFileIdEntity['shareddrivename'] = _getSharedDriveNameFromId(drive, srcFileIdEntity['shareddrive']['driveId'])
|
||||
if tgtFileIdEntity.get('shareddrivename'):
|
||||
if not _convertSharedDriveNameToId(drive, user, i, count, tgtFileIdEntity, useDomainAdminAccess):
|
||||
continue
|
||||
tgtFileIdEntity['shareddrive']['corpora'] = 'drive'
|
||||
else:
|
||||
tgtFileIdEntity['shareddrivename'] = _getSharedDriveNameFromId(tgtFileIdEntity['shareddrive']['driveId'])
|
||||
tgtFileIdEntity['shareddrivename'] = _getSharedDriveNameFromId(drive, tgtFileIdEntity['shareddrive']['driveId'])
|
||||
statistics = _initStatistics()
|
||||
copyMoveOptions['sourceDriveId'] = srcFileIdEntity['shareddrive']['driveId']
|
||||
copyMoveOptions['destDriveId'] = tgtFileIdEntity['shareddrive']['driveId']
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2024 Ross Scroggs All Rights Reserved.
|
||||
# Copyright (C) 2025 Ross Scroggs All Rights Reserved.
|
||||
#
|
||||
# All Rights Reserved.
|
||||
#
|
||||
@@ -260,12 +260,12 @@ SMTP_HOST = 'smtp_host'
|
||||
SMTP_USERNAME = 'smtp_username'
|
||||
# SMTP password
|
||||
SMTP_PASSWORD = 'smtp_password'
|
||||
# Time Zone
|
||||
TIMEZONE = 'timezone'
|
||||
## Minimum TLS Version required for HTTPS connections
|
||||
TLS_MIN_VERSION = 'tls_min_version'
|
||||
## Maximum TLS Version used for HTTPS connections
|
||||
TLS_MAX_VERSION = 'tls_max_version'
|
||||
# Time Zone
|
||||
TIMEZONE = 'timezone'
|
||||
# Clear basic filter when updating an existing sheet
|
||||
TODRIVE_CLEARFILTER = 'todrive_clearfilter'
|
||||
# Use client access for todrive
|
||||
@@ -431,9 +431,9 @@ Defaults = {
|
||||
SMTP_HOST: '',
|
||||
SMTP_USERNAME: '',
|
||||
SMTP_PASSWORD: '',
|
||||
TIMEZONE: 'utc',
|
||||
TLS_MIN_VERSION: 'TLSv1_3',
|
||||
TLS_MAX_VERSION: '',
|
||||
TIMEZONE: 'utc',
|
||||
TODRIVE_CLEARFILTER: FALSE,
|
||||
TODRIVE_CLIENTACCESS: FALSE,
|
||||
TODRIVE_CONVERSION: TRUE,
|
||||
@@ -599,9 +599,9 @@ VAR_INFO = {
|
||||
SMTP_HOST: {VAR_TYPE: TYPE_STRING, VAR_LIMITS: (0, None)},
|
||||
SMTP_USERNAME: {VAR_TYPE: TYPE_STRING, VAR_LIMITS: (0, None)},
|
||||
SMTP_PASSWORD: {VAR_TYPE: TYPE_PASSWORD, VAR_LIMITS: (0, None)},
|
||||
TIMEZONE: {VAR_TYPE: TYPE_TIMEZONE},
|
||||
TLS_MIN_VERSION: {VAR_TYPE: TYPE_CHOICE, VAR_ENVVAR: 'GAM_TLS_MIN_VERSION', VAR_CHOICES: TLS_CHOICE_MAP},
|
||||
TLS_MAX_VERSION: {VAR_TYPE: TYPE_CHOICE, VAR_ENVVAR: 'GAM_TLS_MAX_VERSION', VAR_CHOICES: TLS_CHOICE_MAP},
|
||||
TIMEZONE: {VAR_TYPE: TYPE_TIMEZONE},
|
||||
TODRIVE_CLEARFILTER: {VAR_TYPE: TYPE_BOOLEAN},
|
||||
TODRIVE_CLIENTACCESS: {VAR_TYPE: TYPE_BOOLEAN},
|
||||
TODRIVE_CONVERSION: {VAR_TYPE: TYPE_BOOLEAN},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2024 Ross Scroggs All Rights Reserved.
|
||||
# Copyright (C) 2025 Ross Scroggs All Rights Reserved.
|
||||
#
|
||||
# All Rights Reserved.
|
||||
#
|
||||
@@ -72,6 +72,7 @@ DOMAIN_POLICY = 'domainPolicy'
|
||||
DOWNLOAD_QUOTA_EXCEEDED = 'downloadQuotaExceeded'
|
||||
DUPLICATE = 'duplicate'
|
||||
EVENT_DURATION_EXCEEDS_LIMIT = 'eventDurationExceedsLimit'
|
||||
EVENT_TYPE_RESTRICTION = 'eventTypeRestriction'
|
||||
EXPIRATION_DATES_MUST_BE_IN_THE_FUTURE = 'expirationDatesMustBeInTheFuture'
|
||||
EXPIRATION_DATE_NOT_ALLOWED_FOR_SHARED_DRIVE_MEMBERS = 'expirationDateNotAllowedForSharedDriveMembers'
|
||||
FAILED_PRECONDITION = 'failedPrecondition'
|
||||
@@ -457,6 +458,8 @@ class duplicate(Exception):
|
||||
pass
|
||||
class eventDurationExceedsLimit(Exception):
|
||||
pass
|
||||
class eventTypeRestriction(Exception):
|
||||
pass
|
||||
class expirationDatesMustBeInTheFuture(Exception):
|
||||
pass
|
||||
class expirationDateNotAllowedForSharedDriveMembers(Exception):
|
||||
@@ -725,6 +728,7 @@ REASON_EXCEPTION_MAP = {
|
||||
DOWNLOAD_QUOTA_EXCEEDED: downloadQuotaExceeded,
|
||||
DUPLICATE: duplicate,
|
||||
EVENT_DURATION_EXCEEDS_LIMIT: eventDurationExceedsLimit,
|
||||
EVENT_TYPE_RESTRICTION: eventTypeRestriction,
|
||||
EXPIRATION_DATES_MUST_BE_IN_THE_FUTURE: expirationDatesMustBeInTheFuture,
|
||||
EXPIRATION_DATE_NOT_ALLOWED_FOR_SHARED_DRIVE_MEMBERS: expirationDateNotAllowedForSharedDriveMembers,
|
||||
FAILED_PRECONDITION: failedPrecondition,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2023 Ross Scroggs All Rights Reserved.
|
||||
# Copyright (C) 2025 Ross Scroggs All Rights Reserved.
|
||||
#
|
||||
# All Rights Reserved.
|
||||
#
|
||||
@@ -25,8 +25,6 @@
|
||||
# Some commands want to set a non-zero return code but not bail
|
||||
# GAM admin user from oauth2.txt or oauth2service.json
|
||||
ADMIN = 'admn'
|
||||
# Drive service for admin; used to look up Shared Drive Names
|
||||
ADMIN_DRIVE = 'addr'
|
||||
# Number/length of API call retries
|
||||
API_CALLS_RETRY_DATA = 'rtry'
|
||||
# GAM cache directory. If no_cache is True, this variable will be set to None
|
||||
@@ -207,6 +205,7 @@ REDIRECT_WRITE_HEADER = 'rdwh'
|
||||
REDIRECT_MULTIPROCESS = 'rdmp'
|
||||
REDIRECT_QUEUE = 'rdq'
|
||||
REDIRECT_QUEUE_NAME = 'name'
|
||||
REDIRECT_QUEUE_CLEAR_ROW_FILTERS = 'clearRowFilters'
|
||||
REDIRECT_QUEUE_TODRIVE = 'todrive'
|
||||
REDIRECT_QUEUE_CSVPF = 'csvpf'
|
||||
REDIRECT_QUEUE_DATA = 'rows'
|
||||
@@ -219,7 +218,6 @@ REDIRECT_QUEUE_EOF = 'eof'
|
||||
#
|
||||
Globals = {
|
||||
ADMIN: None,
|
||||
ADMIN_DRIVE: None,
|
||||
API_CALLS_RETRY_DATA: {},
|
||||
CACHE_DIR: None,
|
||||
CACHE_DISCOVERY_ONLY: True,
|
||||
|
||||
@@ -64,6 +64,7 @@ Verify the following steps:
|
||||
* If groups are used to authenticate access, make sure the super admin is in one of the groups
|
||||
* Collapse "Service status"
|
||||
* Expand "Cloud Resource Manager API settings"
|
||||
* Select the OU in the left that contains the super admin you'll be using
|
||||
* Make sure that "Allow users to create projects" is checked
|
||||
|
||||
Verify that all scopes are available:
|
||||
|
||||
@@ -567,7 +567,7 @@ By default, Gam displays the information as an indented list of keys and values.
|
||||
```
|
||||
gam calendar <CalendarEntity> show events [<EventEntity>] <EventDisplayProperty>*
|
||||
[fields <EventFieldNameList>] [showdayofweek]
|
||||
[countsonly] [formatjson]
|
||||
[countsly] [formatjson]
|
||||
```
|
||||
In `<EventEntity>`, any `<EventSelectProperty>` options must precede all other options.
|
||||
|
||||
@@ -585,8 +585,9 @@ By default, Gam displays event details, use `countsonly` to display only the num
|
||||
|
||||
```
|
||||
gam calendar <CalendarEntity> print events [<EventEntity>] <EventDisplayProperty>*
|
||||
[fields <EventFieldNameList>] [showdayofweek]
|
||||
[countsonly] [formatjson [quotechar <Character>]] [todrive <ToDriveAttribute>*]
|
||||
[fields <EventFieldNameList>] [showdayofweek]
|
||||
[countsonly [eventrowfilter]]
|
||||
[formatjson [quotechar <Character>]] [todrive <ToDriveAttribute>*]
|
||||
```
|
||||
In `<EventEntity>`, any `<EventSelectProperty>` options must precede all other options.
|
||||
|
||||
@@ -602,6 +603,11 @@ By default, Gam displays the information as columns of fields; the following opt
|
||||
|
||||
By default, Gam displays event details, use `countsonly` to display only the number of events. `formatjson` does not apply in this case.
|
||||
|
||||
When `countsonly` is specified, the `eventrowfilter` option causes
|
||||
GAM to apply `config csv_output_row_filter` to the event details rather than the event counts.
|
||||
This will be useful when `<EventSelectProperty>` and `<EventMatchProperty>` do not have the
|
||||
capabilty to select the events of interest; e.g., you want to filter based on the event `created` property.
|
||||
|
||||
By default, when writing CSV files, Gam uses a quote character of double quote `"`. The quote character is used to enclose columns that contain
|
||||
the quote character itself, the column delimiter (comma by default) and new-line characters. Any quote characters within the column are doubled.
|
||||
When using the `formatjson` option, double quotes are used extensively in the data resulting in hard to read/process output.
|
||||
@@ -627,6 +633,8 @@ gam calendar <CalendarEntity> deleteevent (id|eventid <EventID>)+ [doit] [<Event
|
||||
gam calendar <CalendarEntity> moveevent (id|eventid <EventID>)+ destination <CalendarItem> [<EventNotificationAttribute>]
|
||||
gam calendar <CalendarEntity> updateevent <EventID> <EventAttribute>+ [<EventNotificationAttribute>]
|
||||
gam calendar <CalendarEntity> wipe
|
||||
gam calendar <CalendarEntity> printevents <EventSelectProperty>* <EventDisplayProperty>* [fields <EventFieldNameList>]
|
||||
[formatjson [quotechar <Character>]] [todrive <ToDriveAttribute>*]
|
||||
gam calendar <CalendarEntity> printevents <EventSelectProperty>* <EventDisplayProperty>*
|
||||
[fields <EventFieldNameList>]
|
||||
[countsonly [eventrowfilter]]
|
||||
[formatjson [quotechar <Character>]] [todrive <ToDriveAttribute>*]
|
||||
```
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
You can download and install the current GAM7 release from the [GitHub Releases](https://github.com/GAM-team/GAM/releases/latest) page.
|
||||
Choose one of the following:
|
||||
|
||||
## Executable, Automatic
|
||||
|
||||
* Executable Archive, Automatic, Linux/Mac OS/Google Cloud Shell/Raspberry Pi/ChromeOS
|
||||
- Start a terminal session and execute one of the following commands:
|
||||
- New install, default path `$HOME/bin`
|
||||
@@ -16,6 +18,12 @@ Choose one of the following:
|
||||
By default, a folder, `gam7`, is created in the default or specified path and the files are downloaded into that folder.
|
||||
Add the `-s` option to the end of the above commands to suppress creating the `gam7` folder; the files are downloaded directly into the default or specified path.
|
||||
|
||||
If, when executing one of the above commands, you get an error message stating that Python is not installed,
|
||||
go here [Python](https://www.python.org/downloads/) and download/install Python. When the installation is complete,
|
||||
start a new terminal session and reissue the command from above.
|
||||
|
||||
## Executable, Manual
|
||||
|
||||
* Executable Archive, Manual, Linux/Google Cloud Shell
|
||||
- `gam-7.wx.yz-linux-x86_64-glibc2.35.tar.xz`
|
||||
- `gam-7.wx.yz-linux-x86_64-glibc2.39.tar.xz`
|
||||
@@ -65,6 +73,8 @@ Add the `-s` option to the end of the above commands to suppress creating the `g
|
||||
- Download the installer and run it.
|
||||
- Start a Command Prompt/PowerShell session.
|
||||
|
||||
## Source
|
||||
|
||||
* Source, all platforms
|
||||
- `Source code(zip)`
|
||||
- `Source code(tar.gz)`
|
||||
|
||||
@@ -10,6 +10,68 @@ Add the `-s` option to the end of the above commands to suppress creating the `g
|
||||
|
||||
See [Downloads-Installs-GAM7](https://github.com/GAM-team/GAM/wiki/Downloads-Installs) for Windows or other options, including manual installation
|
||||
|
||||
### 7.07.12
|
||||
|
||||
Fixed bug in `gam print|show oushareddrives` that caused a trap.
|
||||
|
||||
Improved getting Shared Drive names from IDs when accessing Shared Drives in external workspaces.
|
||||
|
||||
### 7.07.11
|
||||
|
||||
Updated `gam calendars <CalendarEntity> update events` and `gam <UserTypeEntity> update events <UserCalendarEntity>`
|
||||
to handle the following error:
|
||||
```
|
||||
ERROR: 400: badRequest - Bad Request
|
||||
```
|
||||
|
||||
Updated `gam <UserTypeEntity> move drivefile` to handle the following error:
|
||||
```
|
||||
ERROR: 400: shareOutNotPermitted
|
||||
```
|
||||
|
||||
### 7.07.10
|
||||
|
||||
Updated `gam calendars <CalendarEntity> update events` and `gam <UserTypeEntity> update events <UserCalendarEntity>`
|
||||
to handle the following error:
|
||||
```
|
||||
ERROR: 400: eventTypeRestriction - Attendees cannot be added to 'fromGmail' event with this visibility setting.
|
||||
```
|
||||
|
||||
### 7.07.09
|
||||
|
||||
Updated `gam calendars <CalendarEntity> update events` and `gam <UserTypeEntity> update events <UserCalendarEntity>`
|
||||
to handle the following error:
|
||||
```
|
||||
gamlib.glgapi.serviceNotAvailable: Authentication backend unavailable.
|
||||
```
|
||||
|
||||
### 7.07.08
|
||||
|
||||
Fixed bug in `gam <UserTypeEntity> print filelist ... countsonly` that issued an
|
||||
incorrect warning message like the following when `redirect csv <FileName> multiprocess` was specified.
|
||||
```
|
||||
WARNING: csv_output_row_filter column "^name$" does not match any output columns
|
||||
```
|
||||
|
||||
### 7.07.07
|
||||
|
||||
Fixed bug in `gam report <ActivityApplictionName> ... countsonly eventrowfilter` that issued an
|
||||
incorrect warning message like the following when `redirect csv <FileName> multiprocess` was specified.
|
||||
```
|
||||
WARNING: csv_output_row_filter column "^doc_title$" does not match any output columns
|
||||
```
|
||||
|
||||
### 7.07.06
|
||||
|
||||
Added option `eventrowfilter` to `gam calendars <CalendarEntity> print events ... countsonly`
|
||||
and `gam <UserTypeEntity> print events <UserCalendarEntity> ... countsonly` that causes
|
||||
GAM to apply `config csv_output_row_filter` to the event details rather than the event counts.
|
||||
This will be useful when `<EventSelectProperty>` and `<EventMatchProperty>` do not have the
|
||||
capabilty to select the events of interest; e.g., you want to filter based on the event `created` property.
|
||||
|
||||
Dropped the extraneous `id` column for `gam calendars <CalendarEntity> print events ... countsonly`
|
||||
and `gam <UserTypeEntity> print events <UserCalendarEntity> ... countsonly`.
|
||||
|
||||
### 7.07.05
|
||||
|
||||
Updated `gam <UserTypeEntity> move drivefile` to recognize the API error: `ERROR: 400: shareOutWarning`.
|
||||
|
||||
@@ -335,6 +335,11 @@ gam update group group@domain.com whoCanViewMembership ALL_MEMBERS_CAN_VIEW whoC
|
||||
Group: group@domain.com, Updated
|
||||
```
|
||||
|
||||
If you are entering a valid combination but an error message is returned, do the following and then re-issue your command.
|
||||
```
|
||||
gam update group group@domain.com whoCanViewMembership ALL_IN_DOMAIN_CAN_VIEW whoCanDiscoverGroup ALL_IN_DOMAIN_CAN_DISCOVER
|
||||
```
|
||||
|
||||
## Manage groups
|
||||
|
||||
These commands allow you to create, update and delete groups.
|
||||
|
||||
@@ -251,10 +251,10 @@ 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
|
||||
GAM 7.07.05 - https://github.com/GAM-team/GAM - pyinstaller
|
||||
GAM 7.07.12 - https://github.com/GAM-team/GAM - pyinstaller
|
||||
GAM Team <google-apps-manager@googlegroups.com>
|
||||
Python 3.13.3 64-bit final
|
||||
MacOS Sequoia 15.4.1 x86_64
|
||||
MacOS Sequoia 15.5 x86_64
|
||||
Path: /Users/admin/bin/gam7
|
||||
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
|
||||
|
||||
@@ -989,7 +989,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
|
||||
GAM 7.07.05 - https://github.com/GAM-team/GAM - pythonsource
|
||||
GAM 7.07.12 - https://github.com/GAM-team/GAM - pythonsource
|
||||
GAM Team <google-apps-manager@googlegroups.com>
|
||||
Python 3.13.3 64-bit final
|
||||
Windows-10-10.0.17134 AMD64
|
||||
|
||||
@@ -671,8 +671,9 @@ By default, Gam displays event details, use `countsonly` to display only the num
|
||||
|
||||
```
|
||||
gam <UserTypeEntity> print events <UserCalendarEntity> [<EventEntity>] <EventDisplayProperty>*
|
||||
[fields <EventFieldNameList>] [showdayofweek]
|
||||
[countsonly] [formatjson [quotechar <Character>]] [todrive <ToDriveAttribute>*]
|
||||
[fields <EventFieldNameList>] [showdayofweek]
|
||||
[countsonly]
|
||||
[formatjson [quotechar <Character>]] [todrive <ToDriveAttribute>*]
|
||||
```
|
||||
In `<EventEntity>`, any `<EventSelectProperty>` options must precede all other options.
|
||||
|
||||
@@ -688,6 +689,11 @@ By default, Gam displays the information as columns of fields; the following opt
|
||||
|
||||
By default, Gam displays event details, use `countsonly` to display only the number of events. `formatjson` does not apply in this case.
|
||||
|
||||
When `countsonly` is specified, the `eventrowfilter` option causes
|
||||
GAM to apply `config csv_output_row_filter` to the event details rather than the event counts.
|
||||
This will be useful when `<EventSelectProperty>` and `<EventMatchProperty>` do not have the
|
||||
capabilty to select the events of interest; e.g., you want to filter based on the event `created` property.
|
||||
|
||||
By default, when writing CSV files, Gam uses a quote character of double quote `"`. The quote character is used to enclose columns that contain
|
||||
the quote character itself, the column delimiter (comma by default) and new-line characters. Any quote characters within the column are doubled.
|
||||
When using the `formatjson` option, double quotes are used extensively in the data resulting in hard to read/process output.
|
||||
|
||||
@@ -662,7 +662,7 @@ When moving a folder you can use the `retainsourcefolders` option to cause GAM t
|
||||
Moving a Drive folder to a Shared Drive is not directly supported by the API; GAM has to make a copy of the folder on the Shared Drive and
|
||||
recursively adjust the files/folders within it to point to the new parent folder. Once the original folder is emptied, it is deleted unless `retainsourcefolders` is specified.
|
||||
|
||||
### Move content of a Shared Drive to another Shared Drive
|
||||
## Move content of a Shared Drive to another Shared Drive
|
||||
Suppose you have a source Shared Drive with ID 0AC_1AB with multiple files and folders, and want to move all of its content to the target Shared Drive with ID 0AE_9ZX.
|
||||
|
||||
The following command will change the parents of the top level files and folders from 0AC_1AB to 0AE_9ZX; the sub files and folders will move along with their top level folder.
|
||||
@@ -676,3 +676,19 @@ If you want the source Shared Drive with ID 0AC_1AB to be contained in a top lev
|
||||
```
|
||||
gam user user@domain.com move drivefile teamdriveid 0AC_1AB teamdriveparentid 0AE_9ZX
|
||||
```
|
||||
|
||||
### Inter-workspace moves
|
||||
Due to a restructuring, you want to move data from Shared Drive A in domaina.com to Shared Drive B in domainb.com.
|
||||
* Shared Drive A in domaina.com has the following unchecked: `Allow people outside of Domain A to access files`
|
||||
* Shared Drive B in domainb.com has the following checked: `Allow people outside of Domain B to access files`
|
||||
* `user@domaina.com` is a manager of both Shared Drives.
|
||||
|
||||
```
|
||||
$ gam user user@domaina move drivefile teamdriveid <SharedDriveAID> teamdriveparentid <SharedDriveBID> mergewithparent
|
||||
User: user@domaina.com, Move 1 Drive File/Folder
|
||||
User: user@domaina.com, Drive Folder: Shared Drive A(<SharedDriveAID>), Move(Merge) contents with Drive Folder: Shared Drive B(<SharedDriveBID>)
|
||||
User: user@domaina.com, Drive File: Filename(<FileID>), Move Failed: Bad Request. User message: "shareOutNotPermitted"
|
||||
...
|
||||
User: user@domaina.com, Drive Folder: Shared Drive A(<SharedDriveAID>), Retained
|
||||
```
|
||||
To get this to work, you must check `Allow people outside of Domain A to access files` on Shared Drive A in domaina.com
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
* [Shared Drive Limits](https://support.google.com/a/users/answer/7338880)
|
||||
* [My Drive Shared Drive API differences](https://developers.google.com/drive/api/v3/shared-drives-diffs)
|
||||
* [Google Docs API](https://developers.google.com/docs/api/reference/rest)
|
||||
* [Limited Access](https://workspaceupdates.googleblog.com/2025/02/updating-access-experience-in-google-drive.html)
|
||||
* [Limited and Expansive Access](https://developers.google.com/workspace/drive/api/guides/limited-expansive-access)
|
||||
|
||||
## Definitions
|
||||
* [`<DriveFileEntity>`](Drive-File-Selection)
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
Print the current version of Gam with details
|
||||
```
|
||||
gam version
|
||||
GAM 7.07.05 - https://github.com/GAM-team/GAM - pyinstaller
|
||||
GAM 7.07.12 - https://github.com/GAM-team/GAM - pyinstaller
|
||||
GAM Team <google-apps-manager@googlegroups.com>
|
||||
Python 3.13.3 64-bit final
|
||||
MacOS Sequoia 15.4.1 x86_64
|
||||
MacOS Sequoia 15.5 x86_64
|
||||
Path: /Users/Admin/bin/gam7
|
||||
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
|
||||
Time: 2023-06-02T21:10:00-07:00
|
||||
@@ -15,10 +15,10 @@ Time: 2023-06-02T21:10:00-07:00
|
||||
Print the current version of Gam with details and time offset information
|
||||
```
|
||||
gam version timeoffset
|
||||
GAM 7.07.05 - https://github.com/GAM-team/GAM - pyinstaller
|
||||
GAM 7.07.12 - https://github.com/GAM-team/GAM - pyinstaller
|
||||
GAM Team <google-apps-manager@googlegroups.com>
|
||||
Python 3.13.3 64-bit final
|
||||
MacOS Sequoia 15.4.1 x86_64
|
||||
MacOS Sequoia 15.5 x86_64
|
||||
Path: /Users/Admin/bin/gam7
|
||||
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
|
||||
Your system time differs from www.googleapis.com by less than 1 second
|
||||
@@ -27,10 +27,10 @@ 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
|
||||
GAM 7.07.05 - https://github.com/GAM-team/GAM - pyinstaller
|
||||
GAM 7.07.12 - https://github.com/GAM-team/GAM - pyinstaller
|
||||
GAM Team <google-apps-manager@googlegroups.com>
|
||||
Python 3.13.3 64-bit final
|
||||
MacOS Sequoia 15.4.1 x86_64
|
||||
MacOS Sequoia 15.5 x86_64
|
||||
Path: /Users/Admin/bin/gam7
|
||||
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
|
||||
Time: 2023-06-02T21:10:00-07:00
|
||||
@@ -64,7 +64,7 @@ MacOS High Sierra 10.13.6 x86_64
|
||||
Path: /Users/Admin/bin/gam7
|
||||
Version Check:
|
||||
Current: 5.35.08
|
||||
Latest: 7.07.05
|
||||
Latest: 7.07.12
|
||||
echo $?
|
||||
1
|
||||
```
|
||||
@@ -72,7 +72,7 @@ echo $?
|
||||
Print the current version number without details
|
||||
```
|
||||
gam version simple
|
||||
7.07.05
|
||||
7.07.12
|
||||
```
|
||||
In Linux/MacOS you can do:
|
||||
```
|
||||
@@ -82,10 +82,10 @@ echo $VER
|
||||
Print the current version of Gam and address of this Wiki
|
||||
```
|
||||
gam help
|
||||
GAM 7.07.05 - https://github.com/GAM-team/GAM
|
||||
GAM 7.07.12 - https://github.com/GAM-team/GAM
|
||||
GAM Team <google-apps-manager@googlegroups.com>
|
||||
Python 3.13.3 64-bit final
|
||||
MacOS Sequoia 15.4.1 x86_64
|
||||
MacOS Sequoia 15.5 x86_64
|
||||
Path: /Users/Admin/bin/gam7
|
||||
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
|
||||
Time: 2023-06-02T21:10:00-07:00
|
||||
|
||||
@@ -287,7 +287,7 @@ csv_output_users_audit
|
||||
Default: False
|
||||
customer_id
|
||||
Google Customer ID
|
||||
Default: Blank
|
||||
Default: my_customer
|
||||
Environment variable: CUSTOMER_ID
|
||||
debug_level
|
||||
If debug_level > 0, turn on API debugging output.
|
||||
@@ -321,7 +321,7 @@ drive_v3_native_names
|
||||
email_batch_size
|
||||
When archiving, printing, showing, trashing, untrashing, marking as spam Gmail messages.
|
||||
how many should be processed in each batch
|
||||
Default: 100
|
||||
Default: 50
|
||||
Range: 1 - 100
|
||||
enable_dasa
|
||||
Enable/disable Delegated Admin Service Account API Access
|
||||
@@ -384,7 +384,7 @@ message_batch_size
|
||||
message_max_results
|
||||
When retrieving lists of Gmail messages from API,
|
||||
how many should be retrieved in each API call
|
||||
Default: 1000
|
||||
Default: 500
|
||||
Range: 1 - 10000
|
||||
mobile_max_results
|
||||
When retrieving lists of Mobile devices from API,
|
||||
@@ -416,8 +416,10 @@ no_short_urls
|
||||
the shortened URL redirects to the long URL.
|
||||
When True, the long scopes URLs in `gam oauth create` and
|
||||
`gam <UserTypeEntity> check|update serviceaccount` will be used as is.
|
||||
Default: True
|
||||
no_verify_ssl
|
||||
Disable SSL certificate validation
|
||||
Default: False
|
||||
num_tbatch_threads
|
||||
Number of threads for gam tbatch
|
||||
Default: 2
|
||||
|
||||
Reference in New Issue
Block a user