Updated gam report <ActivityApplicationName>

This commit is contained in:
Ross Scroggs
2025-06-22 12:31:13 -07:00
parent f29f27577c
commit cd0d82e994
3 changed files with 42 additions and 33 deletions

View File

@@ -4435,20 +4435,18 @@ gam report usage customer [todrive <ToDriveAttribute>*]
[convertmbtogb]
<ActivityApplicationName> ::=
access|accesstransparency|
accesstransparency|access|
admin|
calendar|calendars|
chat|
chrome|
classroom|
contextawareaccess|
currents|gplus|google+|
gplus|currents|google+|
datastudio|
devices|mobile|
domain|
drive|doc|docs|
gcp|cloud|
gemini|geminiforworkspace|
geminiinworkspaceapps|gemini|geminiforworkspace|
groups|group|
groupsenterprise|enterprisegroups|
jamboard|
@@ -4466,7 +4464,7 @@ gam report <ActivityApplicationName> [todrive <ToDriveAttribute>*]
[(user all|<UserItem>)|(orgunit|org|ou <OrgUnitPath> [showorgunit])|(select <UserTypeEntity>)]
[([start <Time>] [end <Time>])|(range <Time> <Time>)|
yesterday|today|thismonth|(previousmonths <Integer>)]
[filtertime.String> <Time>] [filter|filters <String>]
[filtertime.<String> <Time>] [filter|filters <String>]
[event|events <EventNameList>] [ip <String>]
[groupidfilter <String>]
[maxactivities <Number>] [maxevents <Number>] [maxresults <Number>]

View File

@@ -1,3 +1,11 @@
7.10.04
Updated `gam report <ActivityApplicationName>` to accept accept application names as defined
in the Reports API discovery document; this means that GAM does not have to be updated when
Google defines a new application name.
`gemini_in_workspace_apps` is now available in `gam report`.
7.10.03
Fixed bug in commands that modify messages where the `labelids <LabelIdList>` option

View File

@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
"""
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
__version__ = '7.10.03'
__version__ = '7.10.04'
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
#pylint: disable=wrong-import-position
@@ -13548,52 +13548,55 @@ def doReportUsage():
NL_SPACES_PATTERN = re.compile(r'\n +')
DISABLED_REASON_TIME_PATTERN = re.compile(r'.*(\d{4}/\d{2}/\d{2}-\d{2}:\d{2}:\d{2})')
REPORT_CHOICE_MAP = {
'access': 'access_transparency',
'accesstransparency': 'access_transparency',
'admin': 'admin',
'calendar': 'calendar',
REPORT_ALIASES_CHOICE_MAP = {
'access': 'accesstransparency',
'calendars': 'calendar',
'chat': 'chat',
'chrome': 'chrome',
'classroom': 'classroom',
'cloud': 'gcp',
'contextawareaccess': 'context_aware_access',
'currents': 'gplus',
'customer': 'customer',
'customers': 'customer',
'datastudio': 'data_studio',
'domain': 'customer',
'devices': 'mobile',
'doc': 'drive',
'docs': 'drive',
'domain': 'customer',
'drive': 'drive',
'enterprisegroups': 'groups_enterprise',
'gcp': 'gcp',
'gemini': 'gemini_for_workspace',
'geminiforworkspace': 'gemini_for_workspace',
'gplus': 'gplus',
'google+': 'gplus',
'enterprisegroups': 'groupsenterprise',
'gemini': 'geminiinworkspaceapps',
'geminiforworkspace': 'geminiinworkspaceapps',
'group': 'groups',
'google+': 'gplus',
'hangoutsmeet': 'meet',
'logins': 'login',
'lookerstudio': 'datastudio',
'oauthtoken': 'token',
'tokens': 'token',
'users': 'user',
}
REPORT_CHOICE_MAP = {
'accesstransparency': 'access_transparency',
'admin': 'admin',
'calendar': 'calendar',
'chat': 'chat',
'chrome': 'chrome',
'contextawareaccess': 'context_aware_access',
'customer': 'customer',
'datastudio': 'data_studio',
'drive': 'drive',
'gcp': 'gcp',
'geminiinworkspaceapps': 'gemini_in_workspace_apps',
'gplus': 'gplus',
'groups': 'groups',
'groupsenterprise': 'groups_enterprise',
'hangoutsmeet': 'meet',
'jamboard': 'jamboard',
'keep': 'keep',
'login': 'login',
'logins': 'login',
'lookerstudio': 'data_studio',
'meet': 'meet',
'mobile': 'mobile',
'oauthtoken': 'token',
'rules': 'rules',
'saml': 'saml',
'token': 'token',
'tokens': 'token',
'usage': 'usage',
'usageparameters': 'usageparameters',
'user': 'user',
'users': 'user',
'useraccounts': 'user_accounts',
'vault': 'vault',
}
@@ -13883,7 +13886,7 @@ def doReport():
if dyn_choice.replace('_', '') not in REPORT_CHOICE_MAP and \
dyn_choice not in REPORT_CHOICE_MAP.values():
REPORT_CHOICE_MAP[dyn_choice.replace('_', '')] = dyn_choice
report = getChoice(REPORT_CHOICE_MAP, mapChoice=True)
report = getChoice(REPORT_CHOICE_MAP, choiceAliases=REPORT_ALIASES_CHOICE_MAP, mapChoice=True)
if report == 'usage':
doReportUsage()
return