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] [convertmbtogb]
<ActivityApplicationName> ::= <ActivityApplicationName> ::=
access|accesstransparency| accesstransparency|access|
admin| admin|
calendar|calendars| calendar|calendars|
chat| chat|
chrome| chrome|
classroom| classroom|
contextawareaccess| contextawareaccess|
currents|gplus|google+| gplus|currents|google+|
datastudio| datastudio|
devices|mobile|
domain|
drive|doc|docs| drive|doc|docs|
gcp|cloud| gcp|cloud|
gemini|geminiforworkspace| geminiinworkspaceapps|gemini|geminiforworkspace|
groups|group| groups|group|
groupsenterprise|enterprisegroups| groupsenterprise|enterprisegroups|
jamboard| jamboard|
@@ -4466,7 +4464,7 @@ gam report <ActivityApplicationName> [todrive <ToDriveAttribute>*]
[(user all|<UserItem>)|(orgunit|org|ou <OrgUnitPath> [showorgunit])|(select <UserTypeEntity>)] [(user all|<UserItem>)|(orgunit|org|ou <OrgUnitPath> [showorgunit])|(select <UserTypeEntity>)]
[([start <Time>] [end <Time>])|(range <Time> <Time>)| [([start <Time>] [end <Time>])|(range <Time> <Time>)|
yesterday|today|thismonth|(previousmonths <Integer>)] yesterday|today|thismonth|(previousmonths <Integer>)]
[filtertime.String> <Time>] [filter|filters <String>] [filtertime.<String> <Time>] [filter|filters <String>]
[event|events <EventNameList>] [ip <String>] [event|events <EventNameList>] [ip <String>]
[groupidfilter <String>] [groupidfilter <String>]
[maxactivities <Number>] [maxevents <Number>] [maxresults <Number>] [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 7.10.03
Fixed bug in commands that modify messages where the `labelids <LabelIdList>` option 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>' __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)' __license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
#pylint: disable=wrong-import-position #pylint: disable=wrong-import-position
@@ -13548,52 +13548,55 @@ def doReportUsage():
NL_SPACES_PATTERN = re.compile(r'\n +') 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})') DISABLED_REASON_TIME_PATTERN = re.compile(r'.*(\d{4}/\d{2}/\d{2}-\d{2}:\d{2}:\d{2})')
REPORT_CHOICE_MAP = { REPORT_ALIASES_CHOICE_MAP = {
'access': 'access_transparency', 'access': 'accesstransparency',
'accesstransparency': 'access_transparency',
'admin': 'admin',
'calendar': 'calendar',
'calendars': 'calendar', 'calendars': 'calendar',
'chat': 'chat',
'chrome': 'chrome',
'classroom': 'classroom',
'cloud': 'gcp', 'cloud': 'gcp',
'contextawareaccess': 'context_aware_access',
'currents': 'gplus', 'currents': 'gplus',
'customer': 'customer',
'customers': 'customer', 'customers': 'customer',
'datastudio': 'data_studio', 'domain': 'customer',
'devices': 'mobile', 'devices': 'mobile',
'doc': 'drive', 'doc': 'drive',
'docs': 'drive', 'docs': 'drive',
'domain': 'customer', 'enterprisegroups': 'groupsenterprise',
'drive': 'drive', 'gemini': 'geminiinworkspaceapps',
'enterprisegroups': 'groups_enterprise', 'geminiforworkspace': 'geminiinworkspaceapps',
'gcp': 'gcp',
'gemini': 'gemini_for_workspace',
'geminiforworkspace': 'gemini_for_workspace',
'gplus': 'gplus',
'google+': 'gplus',
'group': 'groups', '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', 'groups': 'groups',
'groupsenterprise': 'groups_enterprise', 'groupsenterprise': 'groups_enterprise',
'hangoutsmeet': 'meet',
'jamboard': 'jamboard', 'jamboard': 'jamboard',
'keep': 'keep', 'keep': 'keep',
'login': 'login', 'login': 'login',
'logins': 'login',
'lookerstudio': 'data_studio',
'meet': 'meet', 'meet': 'meet',
'mobile': 'mobile', 'mobile': 'mobile',
'oauthtoken': 'token',
'rules': 'rules', 'rules': 'rules',
'saml': 'saml', 'saml': 'saml',
'token': 'token', 'token': 'token',
'tokens': 'token',
'usage': 'usage', 'usage': 'usage',
'usageparameters': 'usageparameters', 'usageparameters': 'usageparameters',
'user': 'user', 'user': 'user',
'users': 'user',
'useraccounts': 'user_accounts', 'useraccounts': 'user_accounts',
'vault': 'vault', 'vault': 'vault',
} }
@@ -13883,7 +13886,7 @@ def doReport():
if dyn_choice.replace('_', '') not in REPORT_CHOICE_MAP and \ if dyn_choice.replace('_', '') not in REPORT_CHOICE_MAP and \
dyn_choice not in REPORT_CHOICE_MAP.values(): dyn_choice not in REPORT_CHOICE_MAP.values():
REPORT_CHOICE_MAP[dyn_choice.replace('_', '')] = dyn_choice 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': if report == 'usage':
doReportUsage() doReportUsage()
return return