-
Notifications
You must be signed in to change notification settings - Fork 473
Users Drive Revisions
- API documentation
- Query documentation
- Definitions
- Delete file revisions
- Manage file revisions publishing
- Display file revisions
<DomainName> ::= <String>(.<String>)+
<EmailAddress> ::= <String>@<DomainName>
<UniqueID> ::= id:<String>
<UserItem> ::= <EmailAddress>|<UniqueID>|<String>
<DriveFileRevisionID> ::= <String>
<DriveFileRevisionIDList> ::= "<DriveFileRevisionID>(,<DriveFileRevisionID>)*"
<DriveFileRevisionIDEntity> ::=
(<DriveFileRevisionID>)|
(id <DriveFileRevisionID>)|(id:<DriveFileRevisionID>)|
(ids <DriveFileRevisionIDList>)|(ids:<DriveFileRevisionIDList>)|
(first|last|allexceptfirst|allexceptlast <Number>)|
(before|after <Time>)|(range <Time> <Time>)
<RevisionsFieldName> ::=
filesize|
id|
keepforever|
lastmodifyinguser|
lastmodifyingusername|
md5checksum|
mimetype|
modifieddate|
modifiedtime|
originalfilename|
pinned|
publishauto|
published|
publishedoutsidedomain|
size
<RevisionsFieldNameList> ::= "<RevisionsFieldName>(,<RevisionsFieldName>)*"
<DriveFileRevisionIDEntity>
can select specific revisions by ID or can select revisions by position in the list or by modification date.
-
first <Number>
- process the first<Number>
revisions. -
last <Number>
- process the last<Number>
revisions. -
allexceptfirst <Number>
- process all revisions except the first<Number>
revisions. -
allexceptlast <Number>
- process all revisions except the last<Number>
revisions. -
before <Time>
- process all revisions with a modification date before<Time>
. -
after <Time>
- process all revisions with a modification date equal to or after<Time>
. -
range <Time> <Time>
- process all revisions with a modification date equal to or after the first<Time>
and before the second<Time>
.
gam <UserTypeEntity> delete filerevisions <DriveFileEntity> select <DriveFileRevisionIDEntity>
[previewdelete] [showtitles] [doit] [max_to_delete <Number>]
-
showtitles
- output file title as well as file id in messages; this requires an additional API call per file. -
previewdelete
- output revisions to be deleted but do not delete them -
doit
- no revisions are deleted unless doit is specified -
max_to_delete <Number>
- no revisions are deleted if the number of revisions to delete exceeds<Number>
; the default value is one. Set<Number>
to 0 for no limit.
When deleting revisions, the last remaining revision can not be deleted. If the <Number>
or <Time>
selections identify all of the revisions for a file,
the following adjustments are made:
-
first <Number>
- leave the latest revision -
last <Number>
- leave the earliest revision -
allexceptfirst <Number>
- not applicable, can't select all revisions -
allexceptlast <Number>
- not applicable, can't select all revisions -
before <Time>
- leave the latest revision -
after <Time>
- leave the earleist revision -
range <Time> <Time>
- leave the earliest revision
If you publish a revision, Google doesn't return the Web link, so setting published true
is of little
value at the moment.
gam <UserTypeEntity> update filerevisions <DriveFileEntity> select <DriveFileRevisionIDEntity>
[published [<Boolean>]] [publishauto [<Boolean>]] [publishedoutsidedomain [<Boolean>]]
[previewupdate] [showtitles] [doit] [max_to_update <Number>]
When select <DriveFileRevisionIDEntity>
is omitted, all revisions are updated.
-
keepforever true
- Keep revision forever, even if it is no longer the head revision -
keepforever false
- Do not keep revision forever -
published true
- Publish these revision to the web -
published false
- Do not publish these revision to the web -
publishauto true
- Automaticaly publish subsequent revisions to the web -
publishauto false
- Do not automaticaly publish subsequent revisions to the web -
publishedoutsidedomain true
- Publish these revisions outside the domain -
publishedoutsidedomain false
- Do not publish these revisions outside the domain -
showtitles
- output file title as well as file id in messages; this requires an additional API call per file. -
previewupdate
- output revisions to be updated but do not update them -
doit
- no revisions are updated unless doit is specified -
max_to_update <Number>
- no revisions are updated if the number of revisions to update exceeds<Number>
; the default value is one. Set<Number>
to 0 for no limit.
gam <UserTypeEntity> show filerevisions <DriveFileEntity>
[select <DriveFileRevisionIDEntity>]
[previewdelete] [showtitles]
[<RevisionsFieldName>*|(fields <RevisionsFieldNameList>)]
(orderby <DriveFileOrderByFieldName> [ascending|descending])*
[stripcrsfromname]
gam <UserTypeEntity> print filerevisions <DriveFileEntity> [todrive <ToDriveAttribute>*]
[select <DriveFileRevisionIDEntity>]
[previewdelete] [showtitles] [oneitemperrow]
[<RevisionsFieldName>*|(fields <RevisionsFieldNameList>)]
(orderby <DriveFileOrderByFieldName> [ascending|descending])*
[stripcrsfromname]
When select <DriveFileRevisionIDEntity>
is omitted, all revisions are displayed. When select <DriveFileRevisionIDEntity>
is specified,
previewdelete
will make the list of revisions displayed match the list that would be processed by delete filerevisions
due to the fact
that the last remaining revision can not be deleted.
-
showtitles
- output file title as well as file id in output; this requires an additional API call per file.
With print filerevisions
, by default the revisions selected for display are all output on one line as a repeating item with the matching file id.
When oneitemperrow
is specified, each revision is output on a separate row with the matching file id. This simplifies processing the CSV file with subsequent Gam commands.
The stripcrsfromname
option strips nulls, carriage returns and linefeeds from drive file names.
This option is special purpose and will not generally be used.
Need more help? Ask on the GAM Discussion Group
Update History
Installation
- How to Install GAM7
- How to Upgrade GAMADV-XTD3 to GAM7
- How to Upgrade Legacy GAM to GAM7
- How to Update GAM7
- Verifying a GAM7 Build is Legitimate and Official
- Install GAM as Python Library
- GAM7 on Chrome OS Devices
- GAM7 on Android Devices
- Google Network Addresses
- HTTPS Proxy
- SSL Root CA Certificates
- How to Uninstall GAM7
Configuration
- Authorization
- GAM Configuration
- Running GAM7 securely on a Google Compute Engine
- Using GAM7 with a delegated admin service account
- Using GAM7 with a YubiKey
- GAM with minimal GCP rights
Notes and Information
- Upgrade Benefits
- Questions? Visit the GAM Discussion Forum
- GAM Public Chat Room
- Scripts
- Other Resources
- Drive REST API v3
- BNF Syntax
- GAM Return Codes
- Python Regular Expressions
- Rclone
Definitions
Command Processing
- Bulk Processing
- Command Line Parsing
- Command Logging and Progress
- Command data from Google Docs/Sheets/Storage
- CSV Special Characters
- CSV Input Filtering
- CSV Output Filtering
- Meta Commands and File Redirection
- Permission matches
- Tag Replace
- Todrive
Collections
Client Access
- Addresses
- Administrators
- Alert Center
- Aliases
- Calendars
- Calendars - Access
- Calendars - Events
- Chrome Auto Update Expiration Counts
- Chrome Browser Cloud Management
- Chrome Device Needs Attention Counts
- Chrome Installed Apps
- Chrome Policies
- Chrome Printers
- Chrome Profile Management
- Chrome Version Counts
- Chrome Version History
- ChromeOS Devices
- Classroom - Courses
- Classroom - Guardians
- Classroom - Invitations
- Classroom - Membership
- Cloud Channel
- Cloud Identity Devices
- Cloud Identity Groups
- Cloud Identity Groups - Membership
- Cloud Identity Policies
- Cloud Storage
- Context Aware Access Levels
- Customer
- Domains
- Domains - Verification
- Domain People - Contacts & Profiles
- Domain Shared Contacts - Global Address List
- Email Audit Monitor
- Find File Owner
- Google Data Transfers
- Groups
- Groups - Membership
- Inbound SSO
- Licenses
- Mobile Devices
- Organizational Units
- Reports
- Reseller
- Resources
- Send Email
- Schemas
- Shared Drives
- Sites
- Users
- Unmanaged Accounts
- Users - Signout and Turn off 2-Step Verification
- Vault - Takeout
- Version and Help
Special Service Account Access
Service Account Access
- Users - Analytics Admin
- Users - Application Specific Passwords
- Users - Backup Verification Codes
- Users - Calendars
- Users - Calendars - Access
- Users - Calendars - Events
- Users - Chat
- Users - Classification Labels
- Users - Classroom - Profile
- Users - Deprovision
- Users - Contacts
- Users - Contacts - Delegates
- Users - Drive - File Selection
- Users - Drive - Activity/Settings
- Users - Drive - Cleanup
- Users - Drive - Comments
- Users - Drive - Copy/Move
- Users - Drive - Files-Display
- Users - Drive - Files-Manage
- Users - Drive - Orphans
- Users - Drive - Ownership
- Users - Drive - Permissions
- Users - Drive - Query
- Users - Drive - Revisions
- Users - Drive - Shortcuts
- Users - Drive - Transfer
- Users - Forms
- Users - Gmail - Client Side Encryption
- Users - Gmail - Delegates
- Users - Gmail - Filters
- Users - Gmail - Forwarding
- Users - Gmail - Labels
- Users - Gmail - Messages/Threads
- Users - Gmail - Profile
- Users - Gmail - S/MIME
- Users - Gmail - SendAs/Signature/Vacation
- Users - Gmail - Settings
- Users - Group Membership
- Users - Keep
- Users - Looker Studio
- Users - Meet
- Users - Classroom - Profile
- Users - People - Contacts & Profiles
- Users - Photo
- Users - Profile Sharing
- Users - Shared Drives
- Users - Spreadsheets
- Users - Tasks
- Users - Tokens
- Users - YouTube
GAM Tutorials
- Account Auditing
- Calendar Settings
- Chat Bot commands
- Chrome Browser Management
- Chrome Policy Settings
- Context Aware Access levels
- Data Transfers
- Domain Verification
- Google Drive Management
- Group Settings
- Inbound SSO Settings
- Managing Admins
- Managing Classroom
- Managing Custom User Schemas
- Managing Devices
- Managing Organizations
- Managing Product Licenses
- Managing Users, Groups, Aliases, Domains, Mobile and Chrome Devices, and Resource Calendars
- OAuth Authentication Related Commands
- Print Users, Groups, Aliases, Mobile and Chrome OS devices, OUs, Licenses and Reports
- Printers
- Unmanaged Users and Invitations
- User Email Settings
- User Security Settings