Formatting a Download Vault Export Request

557 views
Skip to first unread message

Steve - DynTech

unread,
May 7, 2019, 1:54:24 AM5/7/19
to GAM for G Suite
gam download vaultexport|export <ExportItem> matter <MatterItem> [targetfolder <FilePath>] [noverify] [noextract] [ziptostdout]
gam download vaultexport|export <MatterItem> <ExportItem> [targetfolder <FilePath>] [noverify] [noextract] [ziptostdout]

Looking at Download Vault Exports format I thought my first one below would match but no...
Then I was hoping I could send the export straight todrive but don't see that as an option so I'm wondering now if some super long command with ziptostdout then back to drive with  


steve@gam:~$ gam download vaultexport exportly-abbe535b-0c2c-419b-9e1c-6596d8085ee1 matter 'Vault Search' noextract
Command: /home/steve/bin/gamadv-xtd/gam download vaultexport exportly-abbe535b-0c2c-419b-9e1c-6596d8085ee1 matter >>>"Vault Search"<<< noextract

ERROR: Vault Matter: Vault Search(06cdd73a-e6e4-484f-9ce4-7e2ac4dee2c4), Vault Export: exportly-abbe535b-0c2c-419b-9e1c-6596d8085ee1, Does not exist

steve@gam:~$ gam download vaultexport exportly-abbe535b-0c2c-419b-9e1c-6596d8085ee1 matter 06cdd73a-e6e4-484f-9ce4-7e2ac4dee2c4 noextract
Command: /home/steve/bin/gamadv-xtd/gam download vaultexport exportly-abbe535b-0c2c-419b-9e1c-6596d8085ee1 matter >>>06cdd73a-e6e4-484f-9ce4-7e2ac4dee2c4<<< noextract

ERROR: Vault Matter: 06cdd73a-e6e4-484f-9ce4-7e2ac4dee2c4, Does not exist

steve@gam:~$ gam download vaultexport exportly-abbe535b-0c2c-419b-9e1c-6596d8085ee1 06cdd73a-e6e4-484f-9ce4-7e2ac4dee2c4 noextract
Command: /home/steve/bin/gamadv-xtd/gam download vaultexport >>>exportly-abbe535b-0c2c-419b-9e1c-6596d8085ee1<<< 06cdd73a-e6e4-484f-9ce4-7e2ac4dee2c4 noextract

ERROR: Vault Matter: exportly-abbe535b-0c2c-419b-9e1c-6596d8085ee1, Does not exist

steve@gam:~$ gam download vaultexport 06cdd73a-e6e4-484f-9ce4-7e2ac4dee2c4 exportly-abbe535b-0c2c-419b-9e1c-6596d8085ee1 noextract
Command: /home/steve/bin/gamadv-xtd/gam download vaultexport >>>06cdd73a-e6e4-484f-9ce4-7e2ac4dee2c4<<< exportly-abbe535b-0c2c-419b-9e1c-6596d8085ee1 noextract

ERROR: Vault Matter: 06cdd73a-e6e4-484f-9ce4-7e2ac4dee2c4, Does not exist

Steve - CB

unread,
May 7, 2019, 1:59:54 AM5/7/19
to GAM for G Suite
I have no idea why I keep getting these message rejected emails but the post gets saved to the group web page. This is the 3rd time for me today.

Screenshot 2019-05-07 at 00.59.20.png

Steve - DynTech

unread,
May 29, 2019, 7:59:59 PM5/29/19
to GAM for G Suite
Anyone familiar with how to use the Vault APIs with gam?



On Tuesday, 7 May 2019 00:54:24 UTC-5, Steve - DynTech wrote:

Steve - DynTech

unread,
May 29, 2019, 8:21:36 PM5/29/19
to GAM for G Suite
It also seems that a simple gam show vaultexports exceeds the default vault quotas quite quickly. Is there a way to better optimise this command (probably not)? if not, this seems to be a required step using gam and vaultexports: Google Vault API Quota Request

Ross Scroggs

unread,
May 29, 2019, 8:45:29 PM5/29/19
to google-ap...@googlegroups.com
Try: gam config api_calls_rate_check true api_calls_rate_limit = N blah blah
The api_calls_rate_limit is number of calls per 100 seconds, so you may need a fairly small value N = 50?


--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/286a3f61-e354-453d-b2f2-bd3d98b41213%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Steve - DynTech

unread,
May 29, 2019, 10:45:10 PM5/29/19
to GAM for G Suite
Nice trick on the api calls. Hopefully the request to double the api value from 120 to 240 is accepted.

btw, thanks to ross, the correct command would be

gam download vaultexport id:exportly-abbe535b-0c2c-419b-9e1c-6596d8085ee1 matter id:06cdd73a-e6e4-484f-9ce4-7e2ac4dee2c4 noextract

Another thing that threw me for a loop was the download went to the default which is usually drive_dir = $HOME in the gam.cfg file. I'm so used to > sending to the directory I'm in that took a few minutes to figure out.

Steve - DynTech

unread,
May 29, 2019, 10:56:06 PM5/29/19
to GAM for G Suite
I tried, but that makes sense why it doesn't accept it by default

steve@gam:~/gam-data$ gam download vaultexport id:exportly-dcf9f789-25ea-4734-afc1-9c66c5edbf95 matter id:06cdd73a-e6e4-484f-9ce4-7e2ac4dee2c4 ziptostdout | xargs -I '{}' gam user steve add drivefile localfile {} teamdriveparentid 0ANngrXBJ6CCeUk9PVA
Traceback (most recent call last):
  File "gam.py", line 40059, in ProcessGAMCommand
  File "gam.py", line 19587, in doDownloadVaultExport
  File "googleapiclient/_helpers.py", line 130, in positional_wrapper
  File "googleapiclient/http.py", line 692, in next_chunk
TypeError: write() argument must be str, not bytes

Ross Scroggs

unread,
May 30, 2019, 1:46:34 AM5/30/19
to google-ap...@googlegroups.com
It's the ziptostdout that's broken. Python 3 is whining. I'll get it.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

Ross Scroggs

unread,
May 30, 2019, 11:30:15 AM5/30/19
to google-ap...@googlegroups.com
4.83.11

From Wiki:

By default, the export file will be downloaded to the directory specified by `drive_dir` in gam.cfg.

* `targetfolder <FilePath>` - The export file will be downloaded to `<FilePath>`


By default, the export file has a long name made up of the matter name, export name and date.

This name is used for the top level Zip file, Zip files extracted from the top level Zip file will still have their long names.

* `targetname <FileName>` - Specify a name for the downloaded Zip file.

* `noextract` - Do not extract files from downloaded Zip file


gam download vaultexport id:exportly-dcf9f789-25ea-4734-afc1-9c66c5edbf95 matter id:06cdd73a-e6e4-484f-9ce4-7e2ac4dee2c4 targetname foo.zip noextract

gam user steve add drivefile localfile /path/foo.zip teamdriveparentid 0ANngrXBJ6CCeUk9PVA

Ross

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

For more options, visit https://groups.google.com/d/optout.


--

Phil Youngman-Jang

unread,
Oct 7, 2022, 3:00:27 AM10/7/22
to GAM for Google Workspace
Any chance we can explain how this works again for lil' ol' me ? 

Trying to get vault matters exported as zip directly to drive storage folder in same org. Will this work for this ? 

Can I see the full command, and is there any additional work i have do ? (ie. is it downloading to my computer first temporarily? )

David Neff

unread,
Jul 14, 2023, 5:46:34 PM7/14/23
to GAM for Google Workspace
Hey Phil, I'm hoping your now an expert at GAM and Vault. I just made a post a few minutes ago in a new thread... maybe you're the golden ticket now?
Hello, I'm really hoping to find a template to manage the following.

A user "accidentally" deleted around 15000 files a month ago just before break.
Audit log confirms above and provides filenames and ID's but Vault is rather crude and it seems will be returning some 250000 files to sort through. 

It's been a few years since I last used GAM so with some encouragement I may dive back in. First, how feasible is it that I could use GAM to export only the deleted files? And of course if you just happen to have a template...

Thanks for looking,
David

Reply all
Reply to author
Forward
0 new messages