mirror of
https://github.com/GAM-team/GAM.git
synced 2026-06-25 08:31:35 +00:00
Compare commits
6 Commits
20240527.0
...
20240531.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f9624ad5c | ||
|
|
9c9ddff973 | ||
|
|
f1636c7768 | ||
|
|
0ebefda760 | ||
|
|
5a335fb57b | ||
|
|
db95cbcfa4 |
@@ -837,7 +837,7 @@ gam update sakey
|
||||
(algorithm KEY_ALG_RSA_1024|KEY_ALG_RSA_2048)|
|
||||
(localkeysize 1024|2048|4096 [validityhours <Number>])|
|
||||
(yubikey yubikey_pin yubikey_slot AUTHENTICATION|SIGNATURE yubikey_serialnumber <Number>)
|
||||
gam rotate sakey replace_existing
|
||||
gam rotate sakey replace_current
|
||||
(algorithm KEY_ALG_RSA_1024|KEY_ALG_RSA_2048)|
|
||||
(localkeysize 1024|2048|4096 [validityhours <Number>])|
|
||||
(yubikey yubikey_pin yubikey_slot AUTHENTICATION|SIGNATURE yubikey_serialnumber <Number>)
|
||||
|
||||
@@ -457,6 +457,7 @@
|
||||
<ResellerID> ::= <String>
|
||||
<ResourceID> ::= <String>
|
||||
<SchemaName> ::= <String>
|
||||
<SchemaNameField> ::= <SchemaName>.<FieldName>
|
||||
<Section> ::= <String>
|
||||
<SendAsContent> ::=
|
||||
(sig|signature|htmlsig <String>)|
|
||||
@@ -513,6 +514,7 @@
|
||||
<Title> ::= <String>
|
||||
<ToDriveAttribute> ::=
|
||||
(tdaddsheet [<Boolean>])|
|
||||
(tdalert <EmailAddress>)*|
|
||||
(tdbackupsheet (id:<Number>)|<String>)|
|
||||
(tdcellnumberformat text|number)|
|
||||
(tdcellwrap clip|overflow|wrap)|
|
||||
@@ -520,17 +522,20 @@
|
||||
(tdcopysheet (id:<Number>)|<String>)|
|
||||
(tddescription <String>)|
|
||||
(tdfileid <DriveFileID>)|
|
||||
(tdfrom <EmailAddress>)|
|
||||
(tdlocalcopy [<Boolean>])|
|
||||
(tdlocale <Locale>)|
|
||||
(tdnobrowser [<Boolean>])|
|
||||
(tdnoemail [<Boolean>])|
|
||||
(tdnoescapechar [<Boolean>])|
|
||||
(tdnotify [<Boolean>])|
|
||||
(tdparent (id:<DriveFolderID>)|<DriveFolderName>)|
|
||||
(tdretaintitle [<Boolean>])|
|
||||
(tdshare <EmailAddress> commenter|reader|writer)*|
|
||||
(tdsheet (id:<Number>)|<String>)|
|
||||
(tdsheettimestamp [<Boolean>] [tdsheettimeformat <String>])
|
||||
(tdsheettitle <String>)|
|
||||
(tdsubject <String>)|
|
||||
([tdsheetdaysoffset <Number>] [tdsheethoursoffset <Number>])|
|
||||
(tdtimestamp [<Boolean>] [tdtimeformat <String>]
|
||||
[tddaysoffset <Number>] [tdhoursoffset <Number>])|
|
||||
|
||||
@@ -178,6 +178,7 @@ Client access works when accessing Resource calendars.
|
||||
<EventType> ::=
|
||||
default|
|
||||
focustime|
|
||||
fromgmail|
|
||||
outofoffice|
|
||||
workinglocation
|
||||
<EventTypeList> ::= "<EventType>(,<EventType>)*"
|
||||
|
||||
@@ -10,6 +10,30 @@ 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.76.10
|
||||
|
||||
Added `fromgmail` to `<EventType>` that can be used in `gam calendars <CalendarEntity> print|show events ... eventtype fromgmail`.
|
||||
|
||||
* See: https://workspaceupdates.googleblog.com/2024/05/google-calendar-api-event-type-fromgmail.html
|
||||
|
||||
### 6.76.09
|
||||
|
||||
Updated `gam update|delete|info adminrole` to handle the following error:
|
||||
```
|
||||
ERROR: 400: failedPrecondition - Precondition check failed.
|
||||
```
|
||||
|
||||
### 6.76.08
|
||||
|
||||
Updated `<SchemaNameList>` to `"<SchemaName>|<SchemaFieldName>(,<SchemaName>|<SchemaFieldName>)*"`
|
||||
that allows `schemas <SchemaNameList>` in `gam info user` and `gam print users` to display all fields or selected fields
|
||||
of the specified custom schemas.
|
||||
|
||||
### 6.76.07
|
||||
|
||||
Fixed bug where control-C was not recognized when GAM had processed all rows in a CSV file
|
||||
and was `Waiting for N running processes to finish before terminating`.
|
||||
|
||||
### 6.76.06
|
||||
|
||||
Fixed bug in `gam <UserTypeEntity> print messages ... positivecountsonly` where message counts with value 0 were deiplayed.
|
||||
|
||||
@@ -335,7 +335,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.76.06 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||
GAMADV-XTD3 6.76.10 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||
Ross Scroggs <ross.scroggs@gmail.com>
|
||||
Python 3.12.3 64-bit final
|
||||
MacOS Sonoma 14.4.1 x86_64
|
||||
@@ -1009,7 +1009,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.76.06 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||
GAMADV-XTD3 6.76.10 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||
Ross Scroggs <ross.scroggs@gmail.com>
|
||||
Python 3.12.3 64-bit final
|
||||
Windows-10-10.0.17134 AMD64
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
<QueryMobileList> ::= "<QueryMobile>(,<QueryMobile>)*"
|
||||
<QueryUserList> ::= "<QueryUser>(,<QueryUser>)*"
|
||||
<ResourceIDList> ::= "<ResourceID>(,<ResourceID>)*"
|
||||
<SchemaNameList> ::= "<SchemaName>(,<SchemaName>)*"
|
||||
<SchemaNameList> ::= "<SchemaName>|<SchemaFieldName>(,<SchemaName>|<SchemaFieldName>)*"
|
||||
<SerialNumberList> ::= "<SerialNumber>(,<SerialNumber>)*"
|
||||
<ServiceAccountKeyList> ::= "<ServiceAccountKey>(,<ServiceAccountKey>)*"
|
||||
<SiteACLScopeList> ::= "<SiteACLScope>(,<SiteACLScope>)*"
|
||||
|
||||
@@ -243,6 +243,7 @@
|
||||
<EventType> ::=
|
||||
default|
|
||||
focustime|
|
||||
fromgmail|
|
||||
outofoffice|
|
||||
workinglocation
|
||||
<EventTypeList> ::= "<EventType>(,<EventType>)*"
|
||||
|
||||
@@ -1036,6 +1036,10 @@ When `allfields` is specified (or no fields are specified), use `showshareddrive
|
||||
when shared drives are queried/selected. In this case, the Drive API returns the permission IDs
|
||||
but not the permissions themselves so GAM makes an additional API call per file to get the permissions.
|
||||
|
||||
By default, when `showimimetype` and `filepath|fullpath`are both specified, GAM locally filters files by MimeType;
|
||||
this may be slow if the user has a large number of files. Adding the option `mimetypeinquery` or `mimetypeinquery true`
|
||||
causes GAM to have Google filter files by MimeType; this will increase performance.
|
||||
|
||||
See [Select files for Display file counts, list, tree](#select-files-for-display-file-counts-list-tree)
|
||||
|
||||
## File selection by name and entity shortcuts for Display file list
|
||||
|
||||
@@ -110,6 +110,11 @@ queries "`"orgUnitPath=\'/Students/Lower\ School/2027\'`",`"orgUnitPath=\'/Stude
|
||||
<QueryUser> ::= <String>
|
||||
See: https://developers.google.com/admin-sdk/directory/v1/guides/search-users
|
||||
|
||||
<FieldName> ::= <String>
|
||||
<SchemaName> ::= <String>
|
||||
<SchemaNameField> ::= <SchemaName>.<FieldName>
|
||||
<SchemaNameList> ::= "<SchemaName>|<SchemaFieldName>(,<SchemaName>|<SchemaFieldName>)*"
|
||||
|
||||
<StorageBucketName> ::= <String>
|
||||
<StorageObjectName> ::= <String>
|
||||
<StorageBucketObjectName> ::=
|
||||
@@ -488,7 +493,7 @@ clearschema <SchemaName>
|
||||
```
|
||||
Clear a specific field in a schema:
|
||||
```
|
||||
clearschema <SchemaName>.<FieldName>
|
||||
clearschema <SchemaNameField>
|
||||
```
|
||||
|
||||
## Create a user
|
||||
@@ -614,7 +619,7 @@ gam update user <UserItem> [ignorenullpassword] <UserAttribute>*
|
||||
[updateoufromgroup <FileName> [charset <Charset>]
|
||||
[columndelimiter <Character>] [noescapechar <Boolean>] [quotechar <Character>]
|
||||
[fields <FieldNameList>] [keyfield <FieldName>] [datafield <FieldName>]]
|
||||
[clearschema <SchemaName>] [clearschema <SchemaName>.<FieldName>]
|
||||
[clearschema <SchemaName>|<SchemaNameField>]
|
||||
[createifnotfound] [notfoundpassword random|<Password>]
|
||||
(groups [<GroupRole>] [[delivery] <DeliverySetting>] <GroupEntity>)*
|
||||
[alias|aliases <EmailAddressList>]
|
||||
@@ -635,7 +640,7 @@ gam update users <UserTypeEntity> [ignorenullpassword] <UserAttribute>*
|
||||
[updateoufromgroup <FileName> [charset <Charset>]
|
||||
[columndelimiter <Character>] [noescapechar <Boolean>] [quotechar <Character>]
|
||||
[fields <FieldNameList>] [keyfield <FieldName>] [datafield <FieldName>]]
|
||||
[clearschema <SchemaName>] [clearschema <SchemaName>.<FieldName>]
|
||||
[clearschema <SchemaName>|<SchemaNameField>]
|
||||
[createifnotfound] [notfoundpassword random|<Password>]
|
||||
(groups [<GroupRole>] [[delivery] <DeliverySetting>] <GroupEntity>)*
|
||||
[alias|aliases <EmailAddressList>]
|
||||
@@ -656,7 +661,7 @@ gam <UserTypeEntity> update users [ignorenullpassword] <UserAttribute>*
|
||||
[updateoufromgroup <FileName> [charset <Charset>]
|
||||
[columndelimiter <Character>] [noescapechar <Boolean>] [quotechar <Character>]
|
||||
[fields <FieldNameList>] [keyfield <FieldName>] [datafield <FieldName>]]
|
||||
[clearschema <SchemaName>] [clearschema <SchemaName>.<FieldName>]
|
||||
[clearschema <SchemaName>|<SchemaNameField>]
|
||||
[createifnotfound] [notfoundpassword random|<Password>]
|
||||
(groups [<GroupRole>] [[delivery] <DeliverySetting>] <GroupEntity>)*
|
||||
[alias|aliases <EmailAddressList>]
|
||||
@@ -954,7 +959,7 @@ Starting in version `5.23.01`, the variable `quick_info_user` was added to `gam.
|
||||
|
||||
These existing options enable the display of additional information.
|
||||
* `(products|product <ProductIDList>)|(skus|sku <SKUIDList>)` - Display license information for a selected list of products/SKUs.
|
||||
* `schemas|custom|customschemas <SchemaNameList>` - Display the specified custom schemas
|
||||
* `schemas|custom|customschemas <SchemaNameList>` - Display all fields or selected fields of the specified custom schemas
|
||||
|
||||
By default, Gam displays fields that only an adminstrator can view.
|
||||
* `userview` - Only display fields that other users in the domain can view.
|
||||
@@ -1064,8 +1069,8 @@ By default, Gam displays only the primary email address for each user.
|
||||
* `allfields|basic` - Display all non custom schema fields for each user.
|
||||
* `full` - Display all fields including all custom schema fields for each user.
|
||||
* `<UserFieldName>* [fields <UserFieldNameList>]` - Only display selected fields.
|
||||
* `schemas|custom all` - Get custom schema information for all schemas.
|
||||
* `schemas|custom <SchemaNameList>` - Get custom schema information for a selected list of schemas.
|
||||
* `schemas|custom all` - Display custom schema information for all schemas.
|
||||
* `schemas|custom <SchemaNameList>` - Display all fields or selected fields of the specified custom schemas
|
||||
|
||||
By default, when aliases are displayed, all aliases are displayed. Use `aliasmatchpattern <RegularExpression>`
|
||||
to limit the display of aliases to those that match `<RegularExpression>`.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Print the current version of Gam with details
|
||||
```
|
||||
gam version
|
||||
GAMADV-XTD3 6.76.06 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||
GAMADV-XTD3 6.76.10 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||
Ross Scroggs <ross.scroggs@gmail.com>
|
||||
Python 3.12.3 64-bit final
|
||||
MacOS Sonoma 14.4.1 x86_64
|
||||
@@ -15,7 +15,7 @@ Time: 2023-06-02T21:10:00-07:00
|
||||
Print the current version of Gam with details and time offset information
|
||||
```
|
||||
gam version timeoffset
|
||||
GAMADV-XTD3 6.76.06 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||
GAMADV-XTD3 6.76.10 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||
Ross Scroggs <ross.scroggs@gmail.com>
|
||||
Python 3.12.3 64-bit final
|
||||
MacOS Sonoma 14.4.1 x86_64
|
||||
@@ -27,7 +27,7 @@ Your system time differs from www.googleapis.com by less than 1 second
|
||||
Print the current version of Gam with extended details and SSL information
|
||||
```
|
||||
gam version extended
|
||||
GAMADV-XTD3 6.76.06 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||
GAMADV-XTD3 6.76.10 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||
Ross Scroggs <ross.scroggs@gmail.com>
|
||||
Python 3.12.3 64-bit final
|
||||
MacOS Sonoma 14.4.1 x86_64
|
||||
@@ -64,7 +64,7 @@ MacOS High Sierra 10.13.6 x86_64
|
||||
Path: /Users/Admin/bin/gamadv-xtd3
|
||||
Version Check:
|
||||
Current: 5.35.08
|
||||
Latest: 6.76.06
|
||||
Latest: 6.76.10
|
||||
echo $?
|
||||
1
|
||||
```
|
||||
@@ -72,7 +72,7 @@ echo $?
|
||||
Print the current version number without details
|
||||
```
|
||||
gam version simple
|
||||
6.76.06
|
||||
6.76.10
|
||||
```
|
||||
In Linux/MacOS you can do:
|
||||
```
|
||||
@@ -82,7 +82,7 @@ echo $VER
|
||||
Print the current version of Gam and address of this Wiki
|
||||
```
|
||||
gam help
|
||||
GAM 6.76.06 - https://github.com/taers232c/GAMADV-XTD3
|
||||
GAM 6.76.10 - https://github.com/taers232c/GAMADV-XTD3
|
||||
Ross Scroggs <ross.scroggs@gmail.com>
|
||||
Python 3.12.3 64-bit final
|
||||
MacOS Sonoma 14.4.1 x86_64
|
||||
|
||||
@@ -546,6 +546,7 @@ If an item contains spaces, it should be surrounded by ".
|
||||
<ResellerID> ::= <String>
|
||||
<ResourceID> ::= <String>
|
||||
<SchemaName> ::= <String>
|
||||
<SchemaNameField> ::= <SchemaName>.<FieldName>
|
||||
<Section> ::= <String>
|
||||
<SendAsContent> ::=
|
||||
(sig|signature|htmlsig <String>)|
|
||||
@@ -626,7 +627,7 @@ If an item contains spaces, it should be surrounded by ".
|
||||
(tdsubject <String>)|
|
||||
([tdsheetdaysoffset <Number>] [tdsheethoursoffset <Number>])|
|
||||
(tdtimestamp [<Boolean>] [tdtimeformat <String>]
|
||||
([tddaysoffset <Number>] [tdhoursoffset <Number>])|
|
||||
[tddaysoffset <Number>] [tdhoursoffset <Number>])|
|
||||
(tdtimezone <TimeZone>)|
|
||||
(tdtitle <String>)|
|
||||
(tdupdatesheet [<Boolean>])|
|
||||
@@ -725,7 +726,7 @@ If an item contains spaces, it should be surrounded by ".
|
||||
<QueryMobileList> ::= "<QueryMobile>(,<QueryMobile>)*"
|
||||
<QueryUserList> ::= "<QueryUser>(,<QueryUser>)*"
|
||||
<ResourceIDList> ::= "<ResourceID>(,<ResourceID>)*"
|
||||
<SchemaNameList> ::= "<SchemaName>(,<SchemaName>)*"
|
||||
<SchemaNameList> ::= "<SchemaName>|<SchemaFieldName>(,<SchemaName>|<SchemaFieldName>)*"
|
||||
<SerialNumberList> ::= "<SerialNumber>(,<SerialNumber>)*"
|
||||
<ServiceAccountKeyList> ::= "<ServiceAccountKey>(,<ServiceAccountKey>)*"
|
||||
<SiteACLScopeList> ::= "<SiteACLScope>(,<SiteACLScope>)*"
|
||||
@@ -4220,7 +4221,8 @@ gam report usage customer [todrive <ToDriveAttribute>*]
|
||||
rules|
|
||||
saml|
|
||||
token|tokens|oauthtoken|
|
||||
useraccounts
|
||||
useraccounts|
|
||||
vault
|
||||
|
||||
gam report <ActivityApplicationName> [todrive <ToDriveAttribute>*]
|
||||
[(user all|<UserItem>)|(orgunit|org|ou <OrgUnitPath> [showorgunit])|(select <UserTypeEntity>)]
|
||||
@@ -4991,7 +4993,7 @@ gam <UserTypeEntity> show teamdriveacls
|
||||
(field:<UserReplacementField>)|
|
||||
(field:<UserReplacementFieldSubfield>)|
|
||||
(field:<UserReplacementFieldSubfieldMatchSubfield>)|
|
||||
(schema:<SchemaName>.<FieldName>)|
|
||||
(schema:<SchemaNameField>)|
|
||||
<String>
|
||||
|
||||
# Vault/Takeout
|
||||
@@ -5256,9 +5258,9 @@ gam download storagefile <StorageBucketObjectName>
|
||||
(recoveryemail <EmailAddress>)|
|
||||
(recoveryphone <string>)|
|
||||
(suspend|suspended <Boolean>)|
|
||||
(<SchemaName>.<FieldName> [scalarnonempty|
|
||||
[multivalued|multivalue|value|multinonempty [type home|other|work|(custom <String>)]]]
|
||||
<String>)
|
||||
(<SchemaNameField> [scalarnonempty|
|
||||
[multivalued|multivalue|value|multinonempty [type home|other|work|(custom <String>)]]]
|
||||
<String>)
|
||||
|
||||
<UserMultiAttribute> ::=
|
||||
(address type home|other|work|(custom <String>)
|
||||
@@ -5347,7 +5349,7 @@ gam update user <UserItem> [ignorenullpassword] <UserAttribute>*
|
||||
[columndelimiter <Character>] [noescapechar <Boolean>] [quotechar <Character>]
|
||||
[fields <FieldNameList>] [keyfield <FieldName>] [datafield <FieldName>]]
|
||||
[immutableous <OrgUnitEntity>]|
|
||||
[clearschema <SchemaName>] [clearschema <SchemaName>.<FieldName>]
|
||||
[clearschema <SchemaName> | <SchemaNameField>]
|
||||
[createifnotfound] [notfoundpassword (random [<Integer>])|blocklogin|<Password>]
|
||||
(groups [<GroupRole>] [[delivery] <DeliverySetting>] <GroupEntity>)*
|
||||
[alias|aliases <EmailAddressList>]
|
||||
@@ -5382,7 +5384,7 @@ gam update users <UserTypeEntity> [ignorenullpassword] <UserAttribute>*
|
||||
[updateoufromgroup <FileName> [charset <CharSet>]
|
||||
[columndelimiter <Character>] [noescapechar <Boolean>] [quotechar <Character>]
|
||||
[fields <FieldNameList>] [keyfield <FieldName>] [datafield <FieldName>]]
|
||||
[clearschema <SchemaName>] [clearschema <SchemaName>.<FieldName>]
|
||||
[clearschema <SchemaName>|<SchemaNameField>]
|
||||
[createifnotfound] [notfoundpassword (random [<Integer>])|blocklogin|<Password>]
|
||||
(groups [<GroupRole>] [[delivery] <DeliverySetting>] <GroupEntity>)*
|
||||
[alias|aliases <EmailAddressList>]
|
||||
@@ -5415,7 +5417,7 @@ gam <UserTypeEntity> update users [ignorenullpassword] <UserAttribute>*
|
||||
[verifynotinvitable] [noactionifalias]
|
||||
[updateprimaryemail <RegularExpression> <EmailReplacement>]
|
||||
[updateoufromgroup <CSVFileInput> [keyfield <FieldName>] [datafield <FieldName>]]
|
||||
[clearschema <SchemaName>] [clearschema <SchemaName>.<FieldName>]
|
||||
[clearschema <SchemaName> | <SchemaNameField>]
|
||||
[createifnotfound] [notfoundpassword (random [<Integer>])|blocklogin|<Password>]
|
||||
(groups [<GroupRole>] [[delivery] <DeliverySetting>] <GroupEntity>)*
|
||||
[alias|aliases <EmailAddressList>]
|
||||
|
||||
@@ -2,6 +2,30 @@
|
||||
|
||||
Merged GAM-Team version
|
||||
|
||||
6.76.10
|
||||
|
||||
Added `fromgmail` to `<EventType>` that can be used in `gam calendars <CalendarEntity> print|show events ... eventtype fromgmail`.
|
||||
|
||||
* See: https://workspaceupdates.googleblog.com/2024/05/google-calendar-api-event-type-fromgmail.html
|
||||
|
||||
6.76.09
|
||||
|
||||
Updated `gam update|delete|info adminrole` to handle the following error:
|
||||
```
|
||||
ERROR: 400: failedPrecondition - Precondition check failed.
|
||||
```
|
||||
|
||||
6.76.08
|
||||
|
||||
Updated `<SchemaNameList>` to `"<SchemaName>|<SchemaFieldName>(,<SchemaName>|<SchemaFieldName>)*"`
|
||||
that allows `schemas <SchemaNameList>` in `gam info user` and `gam print users` to display all fields or selected fields
|
||||
of the specified custom schemas.
|
||||
|
||||
6.76.07
|
||||
|
||||
Fixed bug where control-C was not recognized when GAM had processed all rows in a CSV file
|
||||
and was `Waiting for N running processes to finish before terminating`.
|
||||
|
||||
6.76.06
|
||||
|
||||
Fixed bug in `gam <UserTypeEntity> print messages ... positivecountsonly` where message counts with value 0 were deiplayed.
|
||||
|
||||
@@ -9695,16 +9695,18 @@ def MultiprocessGAMCommands(items, showCmds):
|
||||
GM.Globals[GM.MULTIPROCESS_EXIT_PROCESSING] = True
|
||||
|
||||
def signal_handler(sig, frame):
|
||||
controlC['trapped'] = True
|
||||
nonlocal controlC
|
||||
controlC = True
|
||||
|
||||
def handleControlC(source):
|
||||
nonlocal controlC
|
||||
batchWriteStderr(f'Control-C (Multiprocess-{source})\n')
|
||||
setSysExitRC(KEYBOARD_INTERRUPT_RC)
|
||||
batchWriteStderr(Msg.BATCH_CSV_TERMINATE_N_PROCESSES.format(currentISOformatTimeStamp(),
|
||||
numItems, poolProcessResults[0],
|
||||
PROCESS_PLURAL_SINGULAR[poolProcessResults[0] == 1]))
|
||||
pool.terminate()
|
||||
controlC['trapped'] = False
|
||||
controlC = False
|
||||
|
||||
if not items:
|
||||
return
|
||||
@@ -9758,7 +9760,7 @@ def MultiprocessGAMCommands(items, showCmds):
|
||||
else:
|
||||
mpQueueCSVFile = None
|
||||
# signal.signal(signal.SIGINT, origSigintHandler)
|
||||
controlC = {'trapped': False}
|
||||
controlC = False
|
||||
signal.signal(signal.SIGINT, signal_handler)
|
||||
batchWriteStderr(Msg.USING_N_PROCESSES.format(currentISOformatTimeStamp(),
|
||||
numItems, numPoolProcesses,
|
||||
@@ -9769,7 +9771,7 @@ def MultiprocessGAMCommands(items, showCmds):
|
||||
for item in items:
|
||||
if GM.Globals[GM.MULTIPROCESS_EXIT_PROCESSING]:
|
||||
break
|
||||
if controlC['trapped']:
|
||||
if controlC:
|
||||
break
|
||||
if item[0] == Cmd.COMMIT_BATCH_CMD:
|
||||
batchWriteStderr(Msg.COMMIT_BATCH_WAIT_N_PROCESSES.format(currentISOformatTimeStamp(),
|
||||
@@ -9839,7 +9841,7 @@ def MultiprocessGAMCommands(items, showCmds):
|
||||
break
|
||||
time.sleep(1)
|
||||
processWaitStart = time.time()
|
||||
if not controlC['trapped']:
|
||||
if not controlC:
|
||||
if GC.Values[GC.PROCESS_WAIT_LIMIT] > 0:
|
||||
waitRemaining = GC.Values[GC.PROCESS_WAIT_LIMIT]
|
||||
else:
|
||||
@@ -9857,6 +9859,9 @@ def MultiprocessGAMCommands(items, showCmds):
|
||||
for p in completedProcesses:
|
||||
del poolProcessResults[p]
|
||||
if poolProcessResults[0] > 0:
|
||||
if controlC:
|
||||
handleControlC('SIG')
|
||||
break
|
||||
time.sleep(5)
|
||||
if GC.Values[GC.PROCESS_WAIT_LIMIT] > 0:
|
||||
delta = int(time.time()-processWaitStart)
|
||||
@@ -12364,7 +12369,7 @@ def _formatOAuth2ServiceData(service_data):
|
||||
GM.Globals[GM.OAUTH2SERVICE_JSON_DATA] = service_data.copy()
|
||||
return json.dumps(GM.Globals[GM.OAUTH2SERVICE_JSON_DATA], indent=2, sort_keys=True)
|
||||
|
||||
def doProcessSvcAcctKeys(mode, iam=None, projectId=None, clientEmail=None, clientId=None):
|
||||
def doProcessSvcAcctKeys(mode=None, iam=None, projectId=None, clientEmail=None, clientId=None):
|
||||
def getSAKeyParms(body, new_data):
|
||||
nonlocal local_key_size, validityHours
|
||||
while Cmd.ArgumentsRemaining():
|
||||
@@ -12396,6 +12401,8 @@ def doProcessSvcAcctKeys(mode, iam=None, projectId=None, clientEmail=None, clien
|
||||
local_key_size = 2048
|
||||
validityHours = 0
|
||||
body = {}
|
||||
if mode is None:
|
||||
mode = getChoice(['retainnone', 'retainexisting', 'replacecurrent'])
|
||||
if iam is None or mode == 'upload':
|
||||
if iam is None:
|
||||
_, iam = buildGAPIServiceObject(API.IAM, None)
|
||||
@@ -13290,6 +13297,7 @@ REPORT_CHOICE_MAP = {
|
||||
'user': 'user',
|
||||
'users': 'user',
|
||||
'useraccounts': 'user_accounts',
|
||||
'vault': 'vault',
|
||||
}
|
||||
|
||||
REPORT_ACTIVITIES_UPPERCASE_EVENTS = {
|
||||
@@ -16181,12 +16189,12 @@ def doCreateUpdateAdminRoles():
|
||||
customer=GC.Values[GC.CUSTOMER_ID], body=body, fields='roleId,roleName')
|
||||
else:
|
||||
result = callGAPI(cd.roles(), 'patch',
|
||||
throwReasons=[GAPI.BAD_REQUEST, GAPI.CUSTOMER_NOT_FOUND, GAPI.FORBIDDEN]+[GAPI.NOT_FOUND],
|
||||
throwReasons=[GAPI.BAD_REQUEST, GAPI.CUSTOMER_NOT_FOUND, GAPI.FORBIDDEN]+[GAPI.NOT_FOUND, GAPI.FAILED_PRECONDITION],
|
||||
customer=GC.Values[GC.CUSTOMER_ID], roleId=roleId, body=body, fields='roleId,roleName')
|
||||
entityActionPerformed([Ent.ADMIN_ROLE, f"{result['roleName']}({result['roleId']})"])
|
||||
except GAPI.duplicate as e:
|
||||
entityActionFailedWarning([Ent.ADMIN_ROLE, f"{body['roleName']}"], str(e))
|
||||
except (GAPI.notFound, GAPI.forbidden) as e:
|
||||
except (GAPI.notFound, GAPI.forbidden, GAPI.failedPrecondition) as e:
|
||||
entityActionFailedWarning([Ent.ADMIN_ROLE, roleId], str(e))
|
||||
except (GAPI.badRequest, GAPI.customerNotFound):
|
||||
accessErrorExit(cd)
|
||||
@@ -16198,10 +16206,10 @@ def doDeleteAdminRole():
|
||||
checkForExtraneousArguments()
|
||||
try:
|
||||
callGAPI(cd.roles(), 'delete',
|
||||
throwReasons=[GAPI.BAD_REQUEST, GAPI.CUSTOMER_NOT_FOUND, GAPI.FORBIDDEN]+[GAPI.NOT_FOUND],
|
||||
throwReasons=[GAPI.BAD_REQUEST, GAPI.CUSTOMER_NOT_FOUND, GAPI.FORBIDDEN]+[GAPI.NOT_FOUND, GAPI.FAILED_PRECONDITION],
|
||||
customer=GC.Values[GC.CUSTOMER_ID], roleId=roleId)
|
||||
entityActionPerformed([Ent.ADMIN_ROLE, f"{role}({roleId})"])
|
||||
except (GAPI.notFound, GAPI.forbidden) as e:
|
||||
except (GAPI.notFound, GAPI.forbidden, GAPI.failedPrecondition) as e:
|
||||
entityActionFailedWarning([Ent.ADMIN_ROLE, roleId], str(e))
|
||||
except (GAPI.badRequest, GAPI.customerNotFound):
|
||||
accessErrorExit(cd)
|
||||
@@ -16242,12 +16250,12 @@ def doInfoAdminRole():
|
||||
fields = ','.join(set(fieldsList))
|
||||
try:
|
||||
role = callGAPI(cd.roles(), 'get',
|
||||
throwReasons=[GAPI.BAD_REQUEST, GAPI.CUSTOMER_NOT_FOUND, GAPI.FORBIDDEN]+[GAPI.NOT_FOUND],
|
||||
throwReasons=[GAPI.BAD_REQUEST, GAPI.CUSTOMER_NOT_FOUND, GAPI.FORBIDDEN]+[GAPI.NOT_FOUND, GAPI.FAILED_PRECONDITION],
|
||||
customer=GC.Values[GC.CUSTOMER_ID], roleId=roleId, fields=fields)
|
||||
role.setdefault('isSuperAdminRole', False)
|
||||
role.setdefault('isSystemRole', False)
|
||||
_showAdminRole(role)
|
||||
except (GAPI.notFound, GAPI.forbidden) as e:
|
||||
except (GAPI.notFound, GAPI.forbidden, GAPI.failedPrecondition) as e:
|
||||
entityActionFailedWarning([Ent.ADMIN_ROLE, roleId], str(e))
|
||||
except (GAPI.badRequest, GAPI.customerNotFound):
|
||||
accessErrorExit(cd)
|
||||
@@ -16401,9 +16409,9 @@ def doPrintShowAdmins():
|
||||
if roleId not in rolePrivileges:
|
||||
try:
|
||||
rolePrivileges[roleId] = callGAPI(cd.roles(), 'get',
|
||||
throwReasons=[GAPI.BAD_REQUEST, GAPI.CUSTOMER_NOT_FOUND, GAPI.FORBIDDEN]+[GAPI.NOT_FOUND],
|
||||
throwReasons=[GAPI.BAD_REQUEST, GAPI.CUSTOMER_NOT_FOUND, GAPI.FORBIDDEN]+[GAPI.NOT_FOUND, GAPI.FAILED_PRECONDITION],
|
||||
customer=GC.Values[GC.CUSTOMER_ID], roleId=roleId, fields='rolePrivileges')
|
||||
except (GAPI.notFound, GAPI.forbidden) as e:
|
||||
except (GAPI.notFound, GAPI.forbidden, GAPI.failedPrecondition) as e:
|
||||
entityActionFailedExit([Ent.USER, userKey, Ent.ADMIN_ROLE, admin['roleId']], str(e))
|
||||
rolePrivileges[roleId] = None
|
||||
except (GAPI.badRequest, GAPI.customerNotFound):
|
||||
@@ -36183,32 +36191,36 @@ def doCalendarsPrintShowACLs(calIds):
|
||||
|
||||
EVENT_TYPE_DEFAULT = 'default'
|
||||
EVENT_TYPE_FOCUSTIME = 'focusTime'
|
||||
EVENT_TYPE_FROMGMAIL = 'fromGmail'
|
||||
EVENT_TYPE_OUTOFOFFICE = 'outOfOffice'
|
||||
EVENT_TYPE_WORKINGLOCATION = 'workingLocation'
|
||||
|
||||
EVENT_TYPES_CHOICE_MAP = {
|
||||
'default': EVENT_TYPE_DEFAULT,
|
||||
'focustime': EVENT_TYPE_FOCUSTIME,
|
||||
'fromgmail': EVENT_TYPE_FROMGMAIL,
|
||||
'outofoffice': EVENT_TYPE_OUTOFOFFICE,
|
||||
'workinglocation': EVENT_TYPE_WORKINGLOCATION,
|
||||
}
|
||||
|
||||
EVENT_TYPE_DEFAULT_PROPERTIES_MAP = {
|
||||
EVENT_TYPE_DEFAULT: {'eventType': EVENT_TYPE_DEFAULT},
|
||||
EVENT_TYPE_FOCUSTIME: {'eventType': EVENT_TYPE_FOCUSTIME,
|
||||
'focusTimeProperties': {'autoDeclineMode': 'declineNone', 'declineMessage': 'Declined', 'chatStatus': 'doNotDisturb'},
|
||||
'transparency':'opaque'},
|
||||
EVENT_TYPE_OUTOFOFFICE: {'eventType': EVENT_TYPE_OUTOFOFFICE,
|
||||
'outOfOfficeProperties': {'autoDeclineMode': 'declineOnlyNewConflictingInvitations', 'declineMessage': 'Declined'},
|
||||
'transparency':'opaque'},
|
||||
EVENT_TYPE_WORKINGLOCATION: {'eventType': EVENT_TYPE_WORKINGLOCATION,
|
||||
'workingLocationProperties': {},
|
||||
'visibility': 'public', 'transparency':'transparent'},
|
||||
}
|
||||
#EVENT_TYPE_DEFAULT_PROPERTIES_MAP = {
|
||||
# EVENT_TYPE_DEFAULT: {'eventType': EVENT_TYPE_DEFAULT},
|
||||
# EVENT_TYPE_FOCUSTIME: {'eventType': EVENT_TYPE_FOCUSTIME,
|
||||
# 'focusTimeProperties': {'autoDeclineMode': 'declineNone', 'declineMessage': 'Declined', 'chatStatus': 'doNotDisturb'},
|
||||
# 'transparency':'opaque'},
|
||||
# EVENT_TYPE_FROMGMAIL: {'eventType': EVENT_TYPE_FROMGMAIL},
|
||||
# EVENT_TYPE_OUTOFOFFICE: {'eventType': EVENT_TYPE_OUTOFOFFICE,
|
||||
# 'outOfOfficeProperties': {'autoDeclineMode': 'declineOnlyNewConflictingInvitations', 'declineMessage': 'Declined'},
|
||||
# 'transparency':'opaque'},
|
||||
# EVENT_TYPE_WORKINGLOCATION: {'eventType': EVENT_TYPE_WORKINGLOCATION,
|
||||
# 'workingLocationProperties': {},
|
||||
# 'visibility': 'public', 'transparency':'transparent'},
|
||||
# }
|
||||
|
||||
EVENT_TYPE_PROPERTIES_NAME_MAP = {
|
||||
EVENT_TYPE_DEFAULT: None,
|
||||
EVENT_TYPE_FOCUSTIME: f'{EVENT_TYPE_FOCUSTIME}Properties',
|
||||
EVENT_TYPE_FROMGMAIL: None,
|
||||
EVENT_TYPE_OUTOFOFFICE: f'{EVENT_TYPE_OUTOFOFFICE}Properties',
|
||||
EVENT_TYPE_WORKINGLOCATION: f'{EVENT_TYPE_WORKINGLOCATION}Properties',
|
||||
}
|
||||
@@ -36216,6 +36228,7 @@ EVENT_TYPE_PROPERTIES_NAME_MAP = {
|
||||
EVENT_TYPE_ENTITY_MAP = {
|
||||
EVENT_TYPE_DEFAULT: None,
|
||||
EVENT_TYPE_FOCUSTIME: Ent.EVENT_FOCUSTIME,
|
||||
EVENT_TYPE_FROMGMAIL: None,
|
||||
EVENT_TYPE_OUTOFOFFICE: Ent.EVENT_OUTOFOFFICE,
|
||||
EVENT_TYPE_WORKINGLOCATION: Ent.EVENT_WORKINGLOCATION,
|
||||
}
|
||||
@@ -41912,7 +41925,7 @@ def verifyUserPrimaryEmail(cd, user, createIfNotFound, i, count):
|
||||
# [updateprimaryemail <RegularExpression> <EmailReplacement>]
|
||||
# [updateoufromgroup <CSVFileInput> [keyfield <FieldName>] [datafield <FieldName>]]
|
||||
# [immutableous <OrgUnitEntity>]|
|
||||
# [clearschema <SchemaName>] [clearschema <SchemaName>.<FieldName>]
|
||||
# [clearschema <SchemaName>|<SchemaNameField>]
|
||||
# [createifnotfound] [notfoundpassword (random [<Integer>])|blocklogin|<Password>]
|
||||
# (groups [<GroupRole>] [[delivery] <DeliverySetting>] <GroupEntity>)*
|
||||
# [alias|aliases <EmailAddressList>]
|
||||
@@ -42518,6 +42531,44 @@ def _formatLanguagesList(propertyValue, delimiter):
|
||||
languages.append(lang)
|
||||
return delimiter.join(languages)
|
||||
|
||||
def _initSchemaParms(projection):
|
||||
return {'projection': projection, 'customFieldMask': None, 'selectedSchemaFields': {}}
|
||||
|
||||
def _getSchemaNameList(schemaParms):
|
||||
customFieldMask = getString(Cmd.OB_SCHEMA_NAME_LIST).replace(' ', ',')
|
||||
if customFieldMask.lower() == 'all':
|
||||
schemaParms['projection'] = 'full'
|
||||
schemaParms['customFieldMask'] = None
|
||||
schemaParms['selectedSchemaFields'] = {}
|
||||
else:
|
||||
schemaParms['projection'] = 'custom'
|
||||
customFieldMaskList = []
|
||||
for schemaField in customFieldMask.split(','):
|
||||
if schemaField.find('.') == -1:
|
||||
customFieldMaskList.append(schemaField)
|
||||
else:
|
||||
schemaName, fieldName = schemaField.split('.', 1)
|
||||
customFieldMaskList.append(schemaName)
|
||||
schemaParms['selectedSchemaFields'] .setdefault(schemaName, set())
|
||||
schemaParms['selectedSchemaFields'][schemaName].add(fieldName)
|
||||
schemaParms['customFieldMask'] = ','.join(customFieldMaskList)
|
||||
|
||||
def _filterSchemaFields(userEntity, schemaParms):
|
||||
schemas = userEntity.pop('customSchemas', None)
|
||||
if schemas is None:
|
||||
return
|
||||
customSchemas = {}
|
||||
for schema in sorted(schemas):
|
||||
if schema in schemaParms['selectedSchemaFields']:
|
||||
for field, value in sorted(iter(schemas[schema].items())):
|
||||
if field not in schemaParms['selectedSchemaFields'][schema]:
|
||||
continue
|
||||
customSchemas.setdefault(schema, {})
|
||||
customSchemas[schema][field] = value
|
||||
else:
|
||||
customSchemas[schema] = schemas[schema]
|
||||
userEntity['customSchemas'] = customSchemas
|
||||
|
||||
def infoUsers(entityList):
|
||||
def printUserCIGroupMap(parent, group_name_mappings, seen_group_count, edges, direction):
|
||||
for a_parent, a_child in edges:
|
||||
@@ -42553,8 +42604,7 @@ def infoUsers(entityList):
|
||||
getAliases = getBuildingNames = getCIGroupsTree = getGroups = getLicenses = getSchemas = not GC.Values[GC.QUICK_INFO_USER]
|
||||
getGroupsTree = False
|
||||
FJQC = FormatJSONQuoteChar()
|
||||
projection = 'full'
|
||||
customFieldMask = None
|
||||
schemaParms = _initSchemaParms('full')
|
||||
viewType = 'admin_view'
|
||||
fieldsList = []
|
||||
groups = []
|
||||
@@ -42577,19 +42627,13 @@ def infoUsers(entityList):
|
||||
getLicenses = myarg in {'licenses', 'licences'}
|
||||
elif myarg == 'noschemas':
|
||||
getSchemas = False
|
||||
projection = 'basic'
|
||||
schemaParms = _initSchemaParms('basic')
|
||||
elif myarg == 'allschemas':
|
||||
getSchemas = True
|
||||
projection = 'full'
|
||||
schemaParms = _initSchemaParms('full')
|
||||
elif myarg in {'custom', 'schemas', 'customschemas'}:
|
||||
getSchemas = True
|
||||
customFieldMask = getString(Cmd.OB_SCHEMA_NAME_LIST).replace(' ', ',')
|
||||
if customFieldMask.lower() == 'all':
|
||||
customFieldMask = None
|
||||
projection = 'full'
|
||||
else:
|
||||
projection = 'custom'
|
||||
fieldsList.append('customSchemas')
|
||||
_getSchemaNameList(schemaParms)
|
||||
elif myarg in {'products', 'product'}:
|
||||
skus = SKU.convertProductListToSKUList(getGoogleProductList())
|
||||
elif myarg in {'sku', 'skus'}:
|
||||
@@ -42606,6 +42650,8 @@ def infoUsers(entityList):
|
||||
FJQC.GetFormatJSON(myarg)
|
||||
if fieldsList:
|
||||
fieldsList.append('primaryEmail')
|
||||
if getSchemas:
|
||||
fieldsList.append('customSchemas')
|
||||
if getAliases:
|
||||
fieldsList.extend(['aliases', 'nonEditableAliases'])
|
||||
fields = getFieldsFromFieldsList(fieldsList)
|
||||
@@ -42622,7 +42668,8 @@ def infoUsers(entityList):
|
||||
try:
|
||||
user = callGAPI(cd.users(), 'get',
|
||||
throwReasons=GAPI.USER_GET_THROW_REASONS+[GAPI.INVALID_INPUT, GAPI.RESOURCE_NOT_FOUND],
|
||||
userKey=userEmail, projection=projection, customFieldMask=customFieldMask, viewType=viewType, fields=fields)
|
||||
userKey=userEmail, projection=schemaParms['projection'], customFieldMask=schemaParms['customFieldMask'],
|
||||
viewType=viewType, fields=fields)
|
||||
groups = []
|
||||
memberships = []
|
||||
if getGroups or getGroupsTree:
|
||||
@@ -42854,25 +42901,29 @@ def infoUsers(entityList):
|
||||
typeKey = userProperty[UProp.TYPE_KEYWORDS][UProp.PTKW_ATTR_TYPE_KEYWORD]
|
||||
typeCustomValue = userProperty[UProp.TYPE_KEYWORDS][UProp.PTKW_ATTR_TYPE_CUSTOM_VALUE]
|
||||
customTypeKey = userProperty[UProp.TYPE_KEYWORDS][UProp.PTKW_ATTR_CUSTOMTYPE_KEYWORD]
|
||||
printKeyValueList([UProp.PROPERTIES[up][UProp.TITLE], None])
|
||||
Ind.Increment()
|
||||
for schema in sorted(propertyValue):
|
||||
printKeyValueList(['Schema', schema])
|
||||
if schemaParms['selectedSchemaFields']:
|
||||
_filterSchemaFields(user, schemaParms)
|
||||
propertyValue = user[up]
|
||||
if propertyValue:
|
||||
printKeyValueList([UProp.PROPERTIES[up][UProp.TITLE], None])
|
||||
Ind.Increment()
|
||||
for field in propertyValue[schema]:
|
||||
if isinstance(propertyValue[schema][field], list):
|
||||
printKeyValueList([field])
|
||||
Ind.Increment()
|
||||
for an_item in propertyValue[schema][field]:
|
||||
_showType(an_item, typeKey, typeCustomValue, customTypeKey, defaultType='work')
|
||||
for schema in sorted(propertyValue):
|
||||
printKeyValueList(['Schema', schema])
|
||||
Ind.Increment()
|
||||
for field in propertyValue[schema]:
|
||||
if isinstance(propertyValue[schema][field], list):
|
||||
printKeyValueList([field])
|
||||
Ind.Increment()
|
||||
printKeyValueList(['value', an_item['value']])
|
||||
for an_item in propertyValue[schema][field]:
|
||||
_showType(an_item, typeKey, typeCustomValue, customTypeKey, defaultType='work')
|
||||
Ind.Increment()
|
||||
printKeyValueList(['value', an_item['value']])
|
||||
Ind.Decrement()
|
||||
Ind.Decrement()
|
||||
Ind.Decrement()
|
||||
else:
|
||||
printKeyValueList([field, propertyValue[schema][field]])
|
||||
else:
|
||||
printKeyValueList([field, propertyValue[schema][field]])
|
||||
Ind.Decrement()
|
||||
Ind.Decrement()
|
||||
Ind.Decrement()
|
||||
if getAliases:
|
||||
for up in ['aliases', 'nonEditableAliases']:
|
||||
propertyValue = user.get(up, [])
|
||||
@@ -42937,8 +42988,8 @@ def infoUsers(entityList):
|
||||
GAPI.badRequest, GAPI.backendError, GAPI.systemError) as e:
|
||||
entityActionFailedWarning([Ent.USER, userEmail], str(e), i, count)
|
||||
except (GAPI.invalidInput, GAPI.invalidMember) as e:
|
||||
if customFieldMask:
|
||||
entityActionFailedWarning([Ent.USER, userEmail], invalidUserSchema(customFieldMask), i, count)
|
||||
if schemaParms['customFieldMask']:
|
||||
entityActionFailedWarning([Ent.USER, userEmail], invalidUserSchema(schemaParms['customFieldMask']), i, count)
|
||||
else:
|
||||
entityActionFailedWarning([Ent.USER, userEmail], str(e), i, count)
|
||||
|
||||
@@ -43053,6 +43104,8 @@ def doPrintUsers(entityList=None):
|
||||
phoneNumber = phone.get('value', '')
|
||||
if phoneNumber.startswith('+'):
|
||||
phone['value'] = "'"+phoneNumber
|
||||
if schemaParms['selectedSchemaFields']:
|
||||
_filterSchemaFields(userEntity, schemaParms)
|
||||
if printOptions['getGroupFeed']:
|
||||
printGettingAllEntityItemsForWhom(Ent.GROUP_MEMBERSHIP, userEmail, i, count)
|
||||
try:
|
||||
@@ -43123,8 +43176,8 @@ def doPrintUsers(entityList=None):
|
||||
entityUnknownWarning(Ent.USER, ri[RI_ITEM], int(ri[RI_J]), int(ri[RI_JCOUNT]))
|
||||
else:
|
||||
_writeUserEntity({'primaryEmail': ri[RI_ITEM], showValidColumn: False})
|
||||
elif (reason == GAPI.INVALID_INPUT) and customFieldMask:
|
||||
entityActionFailedWarning([Ent.USER, ri[RI_ITEM]], invalidUserSchema(customFieldMask), int(ri[RI_J]), int(ri[RI_JCOUNT]))
|
||||
elif (reason == GAPI.INVALID_INPUT) and schemaParms['customFieldMask']:
|
||||
entityActionFailedWarning([Ent.USER, ri[RI_ITEM]], invalidUserSchema(schemaParms['customFieldMask']), int(ri[RI_J]), int(ri[RI_JCOUNT]))
|
||||
elif reason not in GAPI.DEFAULT_RETRY_REASONS:
|
||||
errMsg = getHTTPError(_PRINT_USER_REASON_TO_MESSAGE_MAP, http_status, reason, message)
|
||||
printKeyValueList([ERROR, errMsg])
|
||||
@@ -43133,7 +43186,8 @@ def doPrintUsers(entityList=None):
|
||||
try:
|
||||
user = callGAPI(cd.users(), 'get',
|
||||
throwReasons=GAPI.USER_GET_THROW_REASONS+[GAPI.INVALID_INPUT, GAPI.RESOURCE_NOT_FOUND, GAPI.RATE_LIMIT_EXCEEDED],
|
||||
userKey=ri[RI_ITEM], projection=projection, customFieldMask=customFieldMask, viewType=viewType, fields=fields)
|
||||
userKey=ri[RI_ITEM], projection=schemaParms['projection'], customFieldMask=schemaParms['customFieldMask'],
|
||||
viewType=viewType, fields=fields)
|
||||
_printUser(user, int(ri[RI_J]), int(ri[RI_JCOUNT]))
|
||||
except (GAPI.userNotFound, GAPI.resourceNotFound):
|
||||
if not showValidColumn:
|
||||
@@ -43144,8 +43198,8 @@ def doPrintUsers(entityList=None):
|
||||
GAPI.badRequest, GAPI.backendError, GAPI.systemError, GAPI.rateLimitExceeded) as e:
|
||||
entityActionFailedWarning([Ent.USER, ri[RI_ITEM]], str(e), int(ri[RI_J]), int(ri[RI_JCOUNT]))
|
||||
except GAPI.invalidInput as e:
|
||||
if customFieldMask:
|
||||
entityActionFailedWarning([Ent.USER, ri[RI_ITEM]], invalidUserSchema(customFieldMask), int(ri[RI_J]), int(ri[RI_JCOUNT]))
|
||||
if schemaParms['customFieldMask']:
|
||||
entityActionFailedWarning([Ent.USER, ri[RI_ITEM]], invalidUserSchema(schemaParms['customFieldMask']), int(ri[RI_J]), int(ri[RI_JCOUNT]))
|
||||
else:
|
||||
entityActionFailedWarning([Ent.USER, ri[RI_ITEM]], str(e), int(ri[RI_J]), int(ri[RI_JCOUNT]))
|
||||
|
||||
@@ -43169,9 +43223,8 @@ def doPrintUsers(entityList=None):
|
||||
lic = None
|
||||
skus = None
|
||||
maxResults = GC.Values[GC.USER_MAX_RESULTS]
|
||||
projection = 'basic'
|
||||
schemaParms = _initSchemaParms('basic')
|
||||
projectionSet = False
|
||||
customFieldMask = None
|
||||
oneLicensePerRow = quotePlusPhoneNumbers = showDeleted = False
|
||||
aliasMatchPattern = isSuspended = orgUnitPath = orgUnitPathLower = orderBy = sortOrder = None
|
||||
viewType = 'admin_view'
|
||||
@@ -43198,27 +43251,22 @@ def doPrintUsers(entityList=None):
|
||||
orderBy, sortOrder = getOrderBySortOrder(USERS_ORDERBY_CHOICE_MAP)
|
||||
elif myarg == 'userview':
|
||||
viewType = 'domain_public'
|
||||
elif myarg in {'allfields', 'basic'}:
|
||||
schemaParms = _initSchemaParms('basic')
|
||||
projectionSet = printOptions['sortHeaders'] = True
|
||||
fieldsList = []
|
||||
elif myarg == 'full':
|
||||
if schemaParms['projection'] != 'custom':
|
||||
schemaParms = _initSchemaParms(myarg)
|
||||
projectionSet = printOptions['sortHeaders'] = True
|
||||
fieldsList = []
|
||||
elif myarg in {'custom', 'schemas', 'customschemas'}:
|
||||
if not fieldsList:
|
||||
fieldsList = ['primaryEmail']
|
||||
fieldsList.append('customSchemas')
|
||||
customFieldMask = getString(Cmd.OB_SCHEMA_NAME_LIST).replace(' ', ',')
|
||||
if customFieldMask.lower() == 'all':
|
||||
customFieldMask = None
|
||||
projection = 'full'
|
||||
else:
|
||||
projection = 'custom'
|
||||
projectionSet = True
|
||||
_getSchemaNameList(schemaParms)
|
||||
if fieldsList:
|
||||
fieldsList.append('customSchemas')
|
||||
elif myarg == 'delimiter':
|
||||
delimiter = getCharacter()
|
||||
elif myarg in PROJECTION_CHOICE_MAP:
|
||||
projection = myarg
|
||||
projectionSet = printOptions['sortHeaders'] = True
|
||||
fieldsList = []
|
||||
elif myarg == 'allfields':
|
||||
projection = 'basic'
|
||||
projectionSet = printOptions['sortHeaders'] = True
|
||||
fieldsList = []
|
||||
elif myarg == 'sortheaders':
|
||||
printOptions['sortHeaders'] = getBoolean()
|
||||
elif myarg == 'scalarsfirst':
|
||||
@@ -43321,7 +43369,8 @@ def doPrintUsers(entityList=None):
|
||||
GAPI.BAD_REQUEST, GAPI.RESOURCE_NOT_FOUND, GAPI.FORBIDDEN],
|
||||
query=query, fields=fields,
|
||||
showDeleted=showDeleted, orderBy=orderBy, sortOrder=sortOrder, viewType=viewType,
|
||||
projection=projection, customFieldMask=customFieldMask, maxResults=maxResults, **kwargs)
|
||||
projection=schemaParms['projection'], customFieldMask=schemaParms['customFieldMask'],
|
||||
maxResults=maxResults, **kwargs)
|
||||
for users in feed:
|
||||
if showItemCountOnly:
|
||||
itemCount += len(users)
|
||||
@@ -43346,12 +43395,12 @@ def doPrintUsers(entityList=None):
|
||||
entityActionFailedWarning([Ent.USER, None, Ent.DOMAIN, kwargs['domain']], Msg.NOT_FOUND)
|
||||
continue
|
||||
except (GAPI.invalidOrgunit, GAPI.invalidInput) as e:
|
||||
if query and not customFieldMask:
|
||||
if query and not schemaParms['customFieldMask']:
|
||||
entityActionFailedWarning([Ent.USER, None], invalidQuery(query))
|
||||
elif customFieldMask and not query:
|
||||
entityActionFailedWarning([Ent.USER, None], invalidUserSchema(customFieldMask))
|
||||
elif query and customFieldMask:
|
||||
entityActionFailedWarning([Ent.USER, None], f'{invalidQuery(query)} or {invalidUserSchema(customFieldMask)}')
|
||||
elif schemaParms['customFieldMask'] and not query:
|
||||
entityActionFailedWarning([Ent.USER, None], invalidUserSchema(schemaParms['customFieldMask']))
|
||||
elif query and schemaParms['customFieldMask']:
|
||||
entityActionFailedWarning([Ent.USER, None], f'{invalidQuery(query)} or {invalidUserSchema(schemaParms["customFieldMask"])}')
|
||||
else:
|
||||
entityActionFailedWarning([Ent.USER, None], str(e))
|
||||
continue
|
||||
@@ -43372,7 +43421,9 @@ def doPrintUsers(entityList=None):
|
||||
jcount = len(entityList)
|
||||
fields = getFieldsFromFieldsList(fieldsList)
|
||||
if GC.Values[GC.BATCH_SIZE] > 1 and jcount > 1:
|
||||
svcargs = dict([('userKey', None), ('fields', fields), ('projection', projection), ('customFieldMask', customFieldMask), ('viewType', viewType)]+GM.Globals[GM.EXTRA_ARGS_LIST])
|
||||
svcargs = dict([('userKey', None), ('fields', fields),
|
||||
('projection', schemaParms['projection']), ('customFieldMask', schemaParms['customFieldMask']),
|
||||
('viewType', viewType)]+GM.Globals[GM.EXTRA_ARGS_LIST])
|
||||
method = getattr(cd.users(), 'get')
|
||||
dbatch = cd.new_batch_http_request(callback=_callbackPrintUser)
|
||||
bcount = 0
|
||||
@@ -43397,7 +43448,8 @@ def doPrintUsers(entityList=None):
|
||||
try:
|
||||
user = callGAPI(cd.users(), 'get',
|
||||
throwReasons=GAPI.USER_GET_THROW_REASONS+[GAPI.INVALID_INPUT, GAPI.RESOURCE_NOT_FOUND, GAPI.RATE_LIMIT_EXCEEDED],
|
||||
userKey=userEmail, projection=projection, customFieldMask=customFieldMask, viewType=viewType, fields=fields)
|
||||
userKey=userEmail, projection=schemaParms['projection'], customFieldMask=schemaParms['customFieldMask'],
|
||||
viewType=viewType, fields=fields)
|
||||
_printUser(user, j, jcount)
|
||||
except (GAPI.userNotFound, GAPI.resourceNotFound):
|
||||
if not showValidColumn:
|
||||
@@ -43408,8 +43460,8 @@ def doPrintUsers(entityList=None):
|
||||
GAPI.badRequest, GAPI.backendError, GAPI.systemError, GAPI.rateLimitExceeded) as e:
|
||||
entityActionFailedWarning([Ent.USER, userEmail], str(e), j, jcount)
|
||||
except GAPI.invalidInput as e:
|
||||
if customFieldMask:
|
||||
entityActionFailedWarning([Ent.USER, userEmail], invalidUserSchema(customFieldMask), j, jcount)
|
||||
if schemaParms['customFieldMask']:
|
||||
entityActionFailedWarning([Ent.USER, userEmail], invalidUserSchema(schemaParms['customFieldMask']), j, jcount)
|
||||
else:
|
||||
entityActionFailedWarning([Ent.USER, userEmail], str(e), j, jcount)
|
||||
# The only field specified was primaryEmail, just list the users/count the domains
|
||||
@@ -53946,10 +53998,9 @@ def printFileList(users):
|
||||
showParent = getBoolean()
|
||||
elif myarg == 'nodataheaders':
|
||||
nodataFields = getString(Cmd.OB_FIELD_NAME_LIST).replace('_', '').replace(',', ' ').split()
|
||||
elif myarg == 'filepath':
|
||||
elif myarg in {'filepath', 'fullpath'}:
|
||||
filepath = True
|
||||
elif myarg == 'fullpath':
|
||||
filepath = fullpath = True
|
||||
fullpath = myarg == 'fullpath'
|
||||
elif myarg == 'folderpathonly':
|
||||
folderPathOnly = getBoolean()
|
||||
elif myarg == 'pathdelimiter':
|
||||
|
||||
@@ -92,6 +92,10 @@ _SKUS = {
|
||||
'product': '101047', 'aliases': ['gwlabs', 'workspacelabs'], 'displayName': 'Google Workspace Labs'},
|
||||
'1010470003': {
|
||||
'product': '101047', 'aliases': ['geminibiz'], 'displayName': 'Gemini Business'},
|
||||
'1010470006': {
|
||||
'product': '101047', 'aliases': ['aisecurity'], 'displayName': 'AI Security'},
|
||||
'1010470007': {
|
||||
'product': '101047', 'aliases': ['aimeetingsandmessaging'], 'displayName': 'AI Meetings and Messaging'},
|
||||
'1010490001': {
|
||||
'product': '101049', 'aliases': ['eeu'], 'displayName': 'Endpoint Education Upgrade'},
|
||||
'Google-Apps': {
|
||||
|
||||
Reference in New Issue
Block a user