Improved create shareddrive retries

This commit is contained in:
Ross Scroggs
2023-07-29 09:17:12 -07:00
parent fa70d9cbed
commit 438656a549
12 changed files with 229 additions and 74 deletions

View File

@ -10,7 +10,18 @@ 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.61.17
### 6.61.18
Added the following options to `gam [<UserTypeEntity>] create shareddrive` to allow better control
of the create/update process when attributes other than `themeid` are specified.
```
errorretries <Integer> - Number of create/update error retries; default value 5, range 0-10
updateinitialdelay <Integer> - Initial delay after create before update: default value 10, range 0-60
updateretrydelay <Integer> - Retry delay when update fails; default value 10, range 0-60
```
* See: https://github.com/taers232c/GAMADV-XTD3/wiki/Shared-Drives#create-a-shared-drive
### 6.61.17
Updated `gam print|show vaultexports|vaultholds|vaultqueries` to not set a non-zero return code
when a vault matter changes state from `OPEN` to `CLOSED|DELETED` while the command is being processed.
@ -21,7 +32,7 @@ ERROR: 403: permissionDenied - Request had insufficient authentication scopes.
```
It's not clear what causes the error.
6.61.16
### 6.61.16
Added the following license SKUs.
```

View File

@ -329,7 +329,7 @@ writes the credentials into the file oauth2.txt.
admin@server:/Users/admin/bin/gamadv-xtd3$ rm -f /Users/admin/GAMConfig/oauth2.txt
admin@server:/Users/admin/bin/gamadv-xtd3$ ./gam version
WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found
GAMADV-XTD3 6.61.14 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.61.18 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.10.8 64-bit final
MacOS High Sierra 10.13.6 x86_64
@ -969,7 +969,7 @@ writes the credentials into the file oauth2.txt.
C:\GAMADV-XTD3>del C:\GAMConfig\oauth2.txt
C:\GAMADV-XTD3>gam version
WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found
GAMADV-XTD3 6.61.14 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.61.18 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.11.4 64-bit final
Windows-10-10.0.17134 AMD64

View File

@ -206,6 +206,7 @@ gam [<UserTypeEntity>] create teamdrive <Name>
([customtheme <DriveFileID> <Float> <Float> <Float>] [color <ColorValue>])]
(<SharedDriveRestrictionsSubfieldName> <Boolean>)*
[hide <Boolean>] [ou|org|orgunit <OrgUnitItem>]
[errorretries <Integer>] [updateinitialdelay <Integer>] [updateretrydelay <Integer>]
[(csv [todrive <ToDriveAttribute>*] (addcsvdata <FieldName> <String>)*) | returnidonly]
[adminaccess|asadmin]
```
@ -218,14 +219,20 @@ gam [<UserTypeEntity>] create teamdrive <Name>
* `<SharedDriveRestrictionsSubfieldName> <Boolean>` - Set Shared Drive Restrictions
* `hide <Boolean>` - Set Shared Drive visibility
This option is only available when the command is run as an administrator.
* `ou|org|orgunit <OrgUnitItem>` - See: https://workspaceupdates.googleblog.com/2022/05/shared-drives-in-organizational-units-open-beta.html
If any attributes other than `themeid` are specified, GAM must create the Drive and then update the Drive attributes.
Even though the Create API returns success, the Update API fails and reports that the Drive does not exist.
For this reason, GAM waits 30 seconds after the create before attempting the update. GAM repeats the update
with waits of 15, 30, and 45 seconds if the Update API continues to fail. This is acceptable when creating
a single Shared Drive, for bulk Shared Drive creation see [Bulk Create Shared Drives](#bulk-create-shared-drives).
* `errorretries <Integer>` - Number of create/update error retries; default value 5, range 0-10
* `updateinitialdelay <Integer>` - Initial delay after create before update: default value 10, range 0-60
* `updateretrydelay <Integer>` - Retry delay when update fails; default value 10, range 0-60
For this reason, GAM waits `updateinitialdelay <Integer>` seconds after the create before attempting the update.
GAM repeats the update `errorretries <Integer>` times waiting `updateretrydelay <Integer>` between tries
if the Update API continues to fail.
This is acceptable when creating a single Shared Drive, for bulk Shared Drive creation see [Bulk Create Shared Drives](#bulk-create-shared-drives).
This option is only available when the command is run as an administrator.
* `ou|org|orgunit <OrgUnitItem>` - See: https://workspaceupdates.googleblog.com/2022/05/shared-drives-in-organizational-units-open-beta.html
By default, the Google Administrator and Shared Drive name and ID values are displayed on stdout.
* `csv [todrive <ToDriveAttribute>*]` - Write Google Administrator, Shared Drive name and ID values to a CSV file.
@ -236,9 +243,9 @@ When either of these options is chosen, no infomation about Shared Drive restric
To retrieve the Shared Drive ID with `returnidonly`:
```
Linux/MacOS
teamDriveId=`gam create teamdrive ... returnidonly`
teamDriveId=$(gam create teamdrive ... returnidonly)
Windows PowerShell
$teamDriveId = & gam create teamdrive ... returnidonly`
$teamDriveId = & gam create teamdrive ... returnidonly
```
## Bulk Create Shared Drives

View File

@ -308,7 +308,7 @@ When copying folders, the option is only useful when copying a folder without re
To retrieve the file ID with `returnidonly`:
```
Linux/MacOS
fileId=gam user user@domain.com copy drivefile <DriveFileEntity> ... returnidonly
fileId=$(gam user user@domain.com copy drivefile <DriveFileEntity> ... returnidonly)
Windows PowerShell
$fileId = & gam user user@domain.com copy drivefile <DriveFileEntity> ... returnidonly
```

View File

@ -213,7 +213,7 @@ Alternatively, you can direct the output to a CSV file:
To retrieve the file ID with `returnidonly`:
```
Linux/MacOS
fileId=`gam user user@domain.com create drivefile ... returnidonly`
fileId=$(gam user user@domain.com create drivefile ... returnidonly)
Windows PowerShell
$fileId = & gam user user@domain.com create drivefile ... returnidonly
```
@ -511,7 +511,7 @@ By default, the user, file name, updated file name and id values are displayed o
To retrieve the file ID with `returnidonly`:
```
Linux/MacOS
fileId=`gam user user@domain.com update drivefile <DriveFileEntity> copy ... returnidonly`
fileId=$(gam user user@domain.com update drivefile <DriveFileEntity> copy ... returnidonly)
Windows PowerShell
$fileId = & gam user user@domain.com update drivefile <DriveFileEntity> copy ... returnidonly
```

View File

@ -60,7 +60,7 @@ By default, the user, form title and file name/ID values are displayed on stdout
To retrieve the file ID with `returnidonly`:
```
Linux/MacOS
fileId=`gam user user@domain.com create form title "xyz" ... returnidonly`
fileId=$(gam user user@domain.com create form title "xyz" ... returnidonly)
Windows PowerShell
$fileId = & gam user user@domain.com create form title "xyz" ... returnidonly
```

View File

@ -181,6 +181,7 @@ gam <UserTypeEntity> create teamdrive <Name>
([customtheme <DriveFileID> <Float> <Float> <Float>] [color <ColorValue>])]
(<SharedDriveRestrictionsSubfieldName> <Boolean>)*
[hide <Boolean>] [ou|org|orgunit <OrgUnitItem>]
[errorretries <Integer>] [updateinitialdelay <Integer>] [updateretrydelay <Integer>]
[(csv [todrive <ToDriveAttribute>*] (addcsvdata <FieldName> <String>)*) | returnidonly]
```
* `themeid` - a Shared Drive themeId obtained from `show teamdrivethemes`
@ -191,12 +192,21 @@ gam <UserTypeEntity> create teamdrive <Name>
* `color` - set the Shared Drive color
* `<SharedDriveRestrictionsSubfieldName> <Boolean>` - Set Shared Drive Restrictions
* `hide <Boolean>` - Set Shared Drive visibility
* `ou|org|orgunit <OrgUnitItem>` - See: https://workspaceupdates.googleblog.com/2022/05/shared-drives-in-organizational-units-open-beta.html
If any attributes other than `themeid` are specified, GAM must create the Drive and then update the Drive attributes.
Even though the Create API returns success, the Update API fails and reports that the Drive does not exist.
For this reason, GAM waits 30 seconds after the create before attempting the update. GAM repeats the update
with waits of 15, 30, and 45 seconds if the Update API continues to fail.
* `errorretries <Integer>` - Number of create/update error retries; default value 5, range 0-10
* `updateinitialdelay <Integer>` - Initial delay after create before update: default value 10, range 0-60
* `updateretrydelay <Integer>` - Retry delay when update fails; default value 10, range 0-60
For this reason, GAM waits `updateinitialdelay <Integer>` seconds after the create before attempting the update.
GAM repeats the update `errorretries <Integer>` times waiting `updateretrydelay <Integer>` between tries
if the Update API continues to fail.
This is acceptable when creating a single Shared Drive, for bulk Shared Drive creation see [Bulk Create Shared Drives](#bulk-create-shared-drives).
This option is only available when the command is run as an administrator.
* `ou|org|orgunit <OrgUnitItem>` - See: https://workspaceupdates.googleblog.com/2022/05/shared-drives-in-organizational-units-open-beta.html
By default, the user and Shared Drive name and ID values are displayed on stdout.
* `csv [todrive <ToDriveAttribute>*]` - Write user, Shared Drive name and ID values to a CSV file.
@ -207,9 +217,9 @@ When either of these options is chosen, no infomation about Shared Drive restric
To retrieve the Shared Drive ID with `returnidonly`:
```
Linux/MacOS
teamDriveId=`gam user user@domain.com create teamdrive ... returnidonly`
teamDriveId=$(gam user user@domain.com create teamdrive ... returnidonly)
Windows PowerShell
$teamDriveId = & gam user user@domain.com create teamdrive ... returnidonly`
$teamDriveId = & gam user user@domain.com create teamdrive ... returnidonly
```
## Bulk Create Shared Drives

View File

@ -3,7 +3,7 @@
Print the current version of Gam with details
```
gam version
GAMADV-XTD3 6.61.14 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.61.18 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.11.4 64-bit final
MacOS Monterey 12.6.6 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.61.14 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.61.18 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.11.4 64-bit final
MacOS Monterey 12.6.6 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.61.14 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.61.18 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.11.4 64-bit final
MacOS Monterey 12.6.6 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.61.14
Latest: 6.61.18
echo $?
1
```
@ -72,7 +72,7 @@ echo $?
Print the current version number without details
```
gam version simple
6.61.14
6.61.18
```
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.61.14 - https://github.com/taers232c/GAMADV-XTD3
GAM 6.61.18 - https://github.com/taers232c/GAMADV-XTD3
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.11.4 64-bit final
MacOS Monterey 12.6.6 x86_64

94
docs~ Normal file
View File

@ -0,0 +1,94 @@
# Version and Help
Print the current version of Gam with details
```
gam version
GAMADV-XTD3 6.61.18 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.11.4 64-bit final
MacOS Monterey 12.6.6 x86_64
Path: /Users/Admin/bin/gamadv-xtd3
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain.com
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.61.18 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.11.4 64-bit final
MacOS Monterey 12.6.6 x86_64
Path: /Users/Admin/bin/gamadv-xtd3
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain.com
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.61.18 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.11.4 64-bit final
MacOS Monterey 12.6.6 x86_64
Path: /Users/Admin/bin/gamadv-xtd3
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain.com
Time: 2023-06-02T21:10:00-07:00
Your system time differs from admin.googleapis.com by less than 1 second
OpenSSL 3.1.1 30 May 2023
cryptography 41.0.1
filelock 3.12.0
google-api-python-client 2.88.0
google-auth-httplib2 0.1.0
google-auth-oauthlib 1.0.0
google-auth 2.19.1
httplib2 0.22.0
passlib 1.7.4
python-dateutil 2.8.2
yubikey-manager 5.1.1
admin.googleapis.com connects using TLSv1.3 TLS_AES_256_GCM_SHA384
```
Print the current and latest versions of Gam and:
* set the return code to 0 if the current version is the latest version
* set the return code to 1 if the current version is not the latest
```
gam version checkrc
GAM 5.35.08 - https://github.com/taers232c/GAMADV-XTD3
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.8.1 64-bit final
google-api-python-client 2.77.0
httplib2 0.16.0
oauth2client 4.1.3
MacOS High Sierra 10.13.6 x86_64
Path: /Users/Admin/bin/gamadv-xtd3
Version Check:
Current: 5.35.08
Latest: 6.61.18
echo $?
1
```
Print the current version number without details
```
gam version simple
6.61.18
```
In Linux/MacOS you can do:
```
VER=`gam version simple`
echo $VER
```
Print the current version of Gam and address of this Wiki
```
gam help
GAM 6.61.18 - https://github.com/taers232c/GAMADV-XTD3
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.11.4 64-bit final
MacOS Monterey 12.6.6 x86_64
Path: /Users/Admin/bin/gamadv-xtd3
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain.com
Time: 2023-06-02T21:10:00-07:00
Help: Syntax in file /Users/Admin/bin/gamadv-xtd3/GamCommands.txt
Help: Documentation is at https://github.com/taers232c/GAMADV-XTD3/wiki
```

View File

@ -290,14 +290,18 @@ If an item contains spaces, it should be surrounded by ".
wsbizplus | workspacebusinessplus | 1010020025 |
wsbizplusarchived | workspacebusinessplusarchived | 1010340003 |
wsbizstan | workspacebusinessstandard | 1010020028 |
wsbizstanarchived | workspacebusinessstandardarchived | 1010340006 |
wsbizstarter | workspacebusinessstarter | wsbizstart | 1010020027 |
wsbizstarterarchived | workspacebusinessstarterarchived | 1010340005 |
wsentess | workspaceenterpriseessentials | 1010060003 |
wsentplus | workspaceenterpriseplus | gae | gse | enterprise | gsuiteenterprise | 1010020020 |
wsentstan | workspaceenterprisestandard | 1010020026 |
wsentstanarchived | workspaceenterprisestandardarchived | 1010340004 |
wsentstarter | workspaceenterprisestarter | 1010020029 | wes |
wsess | workspaceesentials | gsuiteessentials | essentials | d4e | driveenterprise | drive4enterprise | 1010060001 |
wsflw | workspacefrontline | workspacefrontlineworker | 1010020030
wsessplus | workspaceessentialsplus | 1010060005 |
wsflw | workspacefrontline | workspacefrontlineworker | 1010020030 |
wsflwstan | workspacefrontlinestan | workspacefrontlineworkerstan | 1010020031
## Items built from primitives
@ -4410,7 +4414,7 @@ gam [<UserTypeEntity>] info siteacls <SiteEntity> <SiteACLScopeEntity>
gam [<UserTypeEntity>] show siteacls <SiteEntity>
gam [<UserTypeEntity>] print siteacls <SiteEntity> [todrive <ToDriveAttribute>*]
# Shared Drives
# Shared Drives - Administrator
<SharedDriveFieldName> ::=
backgroundimagefile|
@ -4442,30 +4446,31 @@ sharingfoldersrequiresorganizerpermission true
In these commands, the Google administrator named in oauth2.txt is used.
gam show teamdrivethemes
gam create|add teamdrive <Name>
gam show shareddrivethemes
gam create shareddrive <Name>
[(theme|themeid <String>) | ([customtheme <DriveFileID> <Float> <Float> <Float>] [color <ColorValue>])]
(<SharedDriveRestrictionsSubfieldName> <Boolean>)*
[hide|hidden <Boolean>] [ou|org|orgunit <OrgUnitItem>]
[errorretries <Integer>] [updateinitialdelay <Integer>] [updateretrydelay <Integer>]
[(csv [todrive <ToDriveAttribute>*] (addcsvdata <FieldName> <String>)*) | returnidonly]
gam update teamdrive <SharedDriveEntity> [name <Name>]
gam update shareddrive <SharedDriveEntity> [name <Name>]
[(theme|themeid <String>) | ([customtheme <DriveFileID> <Float> <Float> <Float>] [color <ColorValue>])]
(<SharedDriveRestrictionsFieldName> <Boolean>)*
[hide|hidden <Boolean>] [ou|org|orgunit <OrgUnitItem>]
gam delete teamdrive <SharedDriveEntity>
gam delete shareddrive <SharedDriveEntity>
[adminaccess|asadmin] [allowitemdeletion]
gam hide teamdrive <SharedDriveEntity>
gam unhide teamdrive <SharedDriveEntity>
gam info teamdrive <SharedDriveEntity> [fields <SharedDriveFieldNameList>]
gam hide shareddrive <SharedDriveEntity>
gam unhide shareddrive <SharedDriveEntity>
gam info shareddrive <SharedDriveEntity> [fields <SharedDriveFieldNameList>]
[formatjson]
gam show teamdriveinfo <SharedDriveEntity> [fields <SharedDriveFieldNameList>]
gam show shareddriveinfo <SharedDriveEntity> [fields <SharedDriveFieldNameList>]
[formatjson]
gam print teamdrives [todrive <ToDriveAttribute>*]
gam print shareddrives [todrive <ToDriveAttribute>*]
[teamdriveadminquery|query <QueryTeamDrive>]
[matchname <RegularExpression>] [orgunit|org|ou <OrgUnitPath>]
[fields <SharedDriveFieldNameList>] [noorgunits [<Boolean>]]
[formatjson [quotechar <Character>]]
gam show teamdrives
gam show shareddrives
[teamdriveadminquery|query <QueryTeamDrive>]
[matchname <RegularExpression>] [orgunit|org|ou <OrgUnitPath>]
[fields <SharedDriveFieldNameList>] [noorgunits [<Boolean>]]
@ -4480,24 +4485,29 @@ gam show oushareddrives
In these commands, you specify an administrator and then indicate that you want domain administrator access with the adminaccess option.
gam <UserTypeEntity> create|add teamdrive <Name> adminaccess
gam <UserTypeEntity> create shareddrive <Name> adminaccess
[(theme|themeid <String>) | ([customtheme <DriveFileID> <Float> <Float> <Float>] [color <ColorValue>])]
(<SharedDriveRestrictionsSubfieldName> <Boolean>)*
[hide <Boolean>]
[hide|hidden <Boolean>] [ou|org|orgunit <OrgUnitItem>]
[errorretries <Integer>] [updateinitialdelay <Integer>] [updateretrydelay <Integer>]
[(csv [todrive <ToDriveAttribute>*] (addcsvdata <FieldName> <String>)*) | returnidonly]
gam <UserTypeEntity> delete teamdrive <SharedDriveEntity>
gam update shareddrive <SharedDriveEntity> asadmin [name <Name>]
[(theme|themeid <String>) | ([customtheme <DriveFileID> <Float> <Float> <Float>] [color <ColorValue>])]
(<SharedDriveRestrictionsFieldName> <Boolean>)*
[hide|hidden <Boolean>] [ou|org|orgunit <OrgUnitItem>]
gam <UserTypeEntity> delete shareddrive <SharedDriveEntity>
adminaccess [allowitemdeletion]
gam <UserTypeEntity> info teamdrive <SharedDriveEntity> adminaccess [fields <SharedDriveFieldNameList>]
gam <UserTypeEntity> info shareddrive <SharedDriveEntity> adminaccess [fields <SharedDriveFieldNameList>]
[formatjson]
gam <UserTypeEntity> show teamdriveinfo <SharedDriveEntity> adminaccess [fields <SharedDriveFieldNameList>]
gam <UserTypeEntity> show shareddriveinfo <SharedDriveEntity> adminaccess [fields <SharedDriveFieldNameList>]
[formatjson]
gam <UserTypeEntity> print teamdrives [todrive <ToDriveAttribute>*]
gam <UserTypeEntity> print shareddrives [todrive <ToDriveAttribute>*]
adminaccess [teamdriveadminquery|query <QueryTeamDrive>]
[matchname <RegularExpression>] [orgunit|org|ou <OrgUnitPath>]
(role|roles <SharedDriveACLRoleList>)*
[fields <SharedDriveFieldNameList>]
[formatjson [quotechar <Character>]]
gam <UserTypeEntity> show teamdrives
gam <UserTypeEntity> show shareddrives
adminaccess [teamdriveadminquery|query <QueryTeamDrive>]
[matchname <RegularExpression>] [orgunit|org|ou <OrgUnitPath>]
(role|roles <SharedDriveACLRoleList>)*
@ -7355,7 +7365,7 @@ gam <UserTypeEntity> show tasklists
gam <UserTypeEntity> print tasklists [todrive <ToDriveAttribute>*]
[countsonly | (formatjson [quotechar <Character>])]
# Users - Team Drives
# Users - Shared Drives
<SharedDriveRestrictionsSubfieldName> ::=
adminmanagedrestrictions|
@ -7373,32 +7383,32 @@ sharingfoldersrequiresorganizerpermission false
allowcontentmanagerstosharefolders false
sharingfoldersrequiresorganizerpermission true
gam <UserTypeEntity> show teamdrivethemes
gam <UserTypeEntity> create|add teamdrive <Name> [adminaccess|asadmin]
gam <UserTypeEntity> show shareddrivethemes
gam <UserTypeEntity> create shareddrive <Name>
[(theme|themeid <String>) | ([customtheme <DriveFileID> <Float> <Float> <Float>] [color <ColorValue>])]
(<SharedDriveRestrictionsSubfieldName> <Boolean>)*
[hide|hidden <Boolean>] [ou|org|orgunit <OrgUnitItem>]
gam <UserTypeEntity> update teamdrive <SharedDriveEntity> [adminaccess|asadmin] [name <Name>]
[hide|hidden <Boolean>]
[errorretries <Integer>] [updateinitialdelay <Integer>] [updateretrydelay <Integer>]
[(csv [todrive <ToDriveAttribute>*] (addcsvdata <FieldName> <String>)*) | returnidonly]
gam <UserTypeEntity> update shareddrive <SharedDriveEntity> [name <Name>]
[(theme|themeid <String>) | ([customtheme <DriveFileID> <Float> <Float> <Float>] [color <ColorValue>])]
(<SharedDriveRestrictionsSubfieldName> <Boolean>)*
[hide|hidden <Boolean>] [ou|org|orgunit <OrgUnitItem>]
gam <UserTypeEntity> delete teamdrive <SharedDriveEntity>
[adminaccess|asadmin] [allowitemdeletion]
gam <UserTypeEntity> hide teamdrive <SharedDriveEntity>
gam <UserTypeEntity> unhide teamdrive <SharedDriveEntity>
gam <UserTypeEntity> info teamdrive <SharedDriveEntity> [fields <SharedDriveFieldNameList>]
[hide|hidden <Boolean>]
gam <UserTypeEntity> delete shareddrive <SharedDriveEntity>
[allowitemdeletion]
gam <UserTypeEntity> hide shareddrive <SharedDriveEntity>
gam <UserTypeEntity> unhide shareddrive <SharedDriveEntity>
gam <UserTypeEntity> info shareddrive <SharedDriveEntity> [fields <SharedDriveFieldNameList>]
[formatjson]
gam <UserTypeEntity> info teamdrive <SharedDriveEntity> [fields <SharedDriveFieldNameList>]
gam <UserTypeEntity> show shareddriveinfo <SharedDriveEntity> [fields <SharedDriveFieldNameList>]
[formatjson]
gam <UserTypeEntity> show teamdriveinfo <SharedDriveEntity> [fields <SharedDriveFieldNameList>]
[formatjson]
gam <UserTypeEntity> print teamdrives [todrive <ToDriveAttribute>*]
gam <UserTypeEntity> print shareddrives [todrive <ToDriveAttribute>*]
[adminaccess|asadmin [teamdriveadminquery|query <QueryTeamDrive>]]
[matchname <RegularExpression>] [orgunit|org|ou <OrgUnitPath>]
(role|roles <SharedDriveACLRoleList>)*
[fields <SharedDriveFieldNameList>] [noorgunits [<Boolean>]]
[formatjson [quotechar <Character>]]
gam <UserTypeEntity> show teamdrives
gam <UserTypeEntity> show shareddrives
[adminaccess|asadmin [teamdriveadminquery|query <QueryTeamDrive>]]
[matchname <RegularExpression>] [orgunit|org|ou <OrgUnitPath>]
(role|roles <SharedDriveACLRoleList>)*

View File

@ -2,6 +2,17 @@
Merged GAM-Team version
6.61.18
Added the following options to `gam [<UserTypeEntity>] create shareddrive` to allow better control
of the create/update process when attributes other than `themeid` are specified.
```
errorretries <Integer> - Number of create/update error retries; default value 5, range 0-10
updateinitialdelay <Integer> - Initial delay after create before update: default value 10, range 0-60
updateretrydelay <Integer> - Retry delay when update fails; default value 10, range 0-60
```
* See: https://github.com/taers232c/GAMADV-XTD3/wiki/Shared-Drives#create-a-shared-drive
6.61.17
Updated `gam print|show vaultexports|vaultholds|vaultqueries` to not set a non-zero return code

View File

@ -59201,7 +59201,7 @@ def _getSharedDriveRestrictions(myarg, body):
return True
return False
def _moveSharedDriveToOU(orgUnit, orgUnitId, driveId, user, i, count, ci=None):
def _moveSharedDriveToOU(orgUnit, orgUnitId, driveId, user, i, count, ci, returnIdOnly):
action = Act.Get()
name = f'orgUnits/-/memberships/shared_drive;{driveId}'
if ci is None:
@ -59211,6 +59211,7 @@ def _moveSharedDriveToOU(orgUnit, orgUnitId, driveId, user, i, count, ci=None):
try:
callGAPI(ci.orgUnits().memberships(), 'move',
name=name, body=cibody)
if not returnIdOnly:
Act.Set(Act.MOVE)
entityModifierNewValueActionPerformed([Ent.SHAREDDRIVE, driveId], Act.MODIFIER_TO, f'{Ent.Singular(Ent.ORGANIZATIONAL_UNIT)}: {orgUnit}', i, count)
except (GAPI.notFound, GAPI.forbidden, GAPI.badRequest, GAPI.internalError,
@ -59225,10 +59226,11 @@ def _moveSharedDriveToOU(orgUnit, orgUnitId, driveId, user, i, count, ci=None):
# [(theme|themeid <String>) | ([customtheme <DriveFileID> <Float> <Float> <Float>] [color <ColorValue>])]
# (<SharedDriveRestrictionsFieldName> <Boolean>)*
# [hide|hidden <Boolean>] [ou|org|orgunit <OrgUnitItem>]
# [errorretries <Integer>] [updateinitialdelay <Integer>] [updateretrydelay <Integer>]
# [(csv [todrive <ToDriveAttribute>*] (addcsvdata <FieldName> <String>)*) | returnidonly]
def createSharedDrive(users, useDomainAdminAccess=False):
def waitingForCreationToComplete(sleep_time):
writeStdout(Ind.Spaces()+Msg.WAITING_FOR_SHARED_DRIVE_CREATION_TO_COMPLETE_SLEEPING.format(sleep_time))
writeStderr(Ind.Spaces()+Msg.WAITING_FOR_SHARED_DRIVE_CREATION_TO_COMPLETE_SLEEPING.format(sleep_time))
time.sleep(sleep_time)
requestId = str(uuid.uuid4())
@ -59238,6 +59240,9 @@ def createSharedDrive(users, useDomainAdminAccess=False):
addCSVData = {}
hide = returnIdOnly = False
orgUnit = orgUnitId = ci = None
errorRetries = 5
updateInitialDelay = 10
updateRetryDelay = 10
while Cmd.ArgumentsRemaining():
myarg = getArgument()
if _getSharedDriveTheme(myarg, body):
@ -59259,6 +59264,12 @@ def createSharedDrive(users, useDomainAdminAccess=False):
addCSVData[k] = getString(Cmd.OB_STRING, minLen=0)
elif myarg in ADMIN_ACCESS_OPTIONS:
useDomainAdminAccess = True
elif myarg == 'errorretries':
errorRetries = getInteger(minVal=0, maxVal=10)
elif myarg == 'updateinitialdelay':
updateInitialDelay = getInteger(minVal=0, maxVal=60)
elif myarg == 'updateretrydelay':
updateRetryDelay = getInteger(minVal=0, maxVal=60)
else:
unknownArgumentExit()
if csvPF:
@ -59299,7 +59310,7 @@ def createSharedDrive(users, useDomainAdminAccess=False):
break
except (GAPI.transientError, GAPI.teamDriveAlreadyExists) as e:
retry += 1
if retry > 3:
if retry > errorRetries:
entityActionFailedWarning([Ent.USER, user, Ent.REQUEST_ID, requestId], str(e), i, count)
break
requestId = str(uuid.uuid4())
@ -59313,7 +59324,8 @@ def createSharedDrive(users, useDomainAdminAccess=False):
userSvcNotApplicableOrDriveDisabled(user, str(e), i, count)
break
if doUpdate and (updateBody or hide or orgUnit):
waitingForCreationToComplete(30)
if updateBody or hide:
waitingForCreationToComplete(updateInitialDelay)
try:
if updateBody:
Act.Set(Act.UPDATE)
@ -59332,10 +59344,10 @@ def createSharedDrive(users, useDomainAdminAccess=False):
break
except GAPI.notFound as e:
retry += 1
if retry > 3:
if retry > errorRetries:
entityActionFailedWarning([Ent.USER, user, Ent.REQUEST_ID, requestId], str(e), i, count)
break
waitingForCreationToComplete(retry*15)
waitingForCreationToComplete(updateRetryDelay)
except (GAPI.badRequest, GAPI.internalError, GAPI.permissionDenied) as e:
entityActionFailedWarning([Ent.USER, user, Ent.SHAREDDRIVE_ID, driveId], str(e), i, count)
break
@ -59357,12 +59369,12 @@ def createSharedDrive(users, useDomainAdminAccess=False):
break
except GAPI.notFound as e:
retry += 1
if retry > 3:
if retry > errorRetries:
entityActionFailedWarning([Ent.USER, user, Ent.REQUEST_ID, requestId], str(e), i, count)
break
time.sleep(retry*retry)
waitingForCreationToComplete(updateRetryDelay)
if orgUnit:
ci = _moveSharedDriveToOU(orgUnit, orgUnitId, driveId, user, i, count, ci)
ci = _moveSharedDriveToOU(orgUnit, orgUnitId, driveId, user, i, count, ci, returnIdOnly)
except (GAPI.forbidden, GAPI.badRequest, GAPI.noManageTeamDriveAdministratorPrivilege) as e:
entityActionFailedWarning([Ent.USER, user, Ent.SHAREDDRIVE_ID, driveId], str(e), i, count)
except (GAPI.serviceNotAvailable, GAPI.authError, GAPI.domainPolicy) as e:
@ -59431,7 +59443,7 @@ def updateSharedDrive(users, useDomainAdminAccess=False):
driveId=driveId)
entityActionPerformed([Ent.USER, user, Ent.SHAREDDRIVE_ID, driveId], i, count)
if orgUnit:
ci = _moveSharedDriveToOU(orgUnit, orgUnitId, driveId, user, i, count, ci)
ci = _moveSharedDriveToOU(orgUnit, orgUnitId, driveId, user, i, count, ci, False)
except (GAPI.notFound, GAPI.forbidden, GAPI.badRequest, GAPI.internalError,
GAPI.noManageTeamDriveAdministratorPrivilege) as e:
entityActionFailedWarning([Ent.USER, user, Ent.SHAREDDRIVE_ID, driveId], str(e), i, count)