forked from TrueCloudLab/rclone
drive: refer to Shared Drives instead of Team Drives
This commit is contained in:
parent
fea4b753b2
commit
e32f08f37b
2 changed files with 28 additions and 27 deletions
|
@ -207,7 +207,7 @@ func init() {
|
||||||
}
|
}
|
||||||
err = configTeamDrive(ctx, opt, m, name)
|
err = configTeamDrive(ctx, opt, m, name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Failed to configure team drive: %v", err)
|
log.Fatalf("Failed to configure Shared Drive: %v", err)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Options: append(driveOAuthOptions(), []fs.Option{{
|
Options: append(driveOAuthOptions(), []fs.Option{{
|
||||||
|
@ -247,7 +247,7 @@ a non root folder as its starting point.
|
||||||
Advanced: true,
|
Advanced: true,
|
||||||
}, {
|
}, {
|
||||||
Name: "team_drive",
|
Name: "team_drive",
|
||||||
Help: "ID of the Team Drive",
|
Help: "ID of the Shared Drive (Team Drive)",
|
||||||
Hide: fs.OptionHideConfigurator,
|
Hide: fs.OptionHideConfigurator,
|
||||||
Advanced: true,
|
Advanced: true,
|
||||||
}, {
|
}, {
|
||||||
|
@ -666,7 +666,7 @@ func (f *Fs) shouldRetry(err error) (bool, error) {
|
||||||
fs.Errorf(f, "Received download limit error: %v", err)
|
fs.Errorf(f, "Received download limit error: %v", err)
|
||||||
return false, fserrors.FatalError(err)
|
return false, fserrors.FatalError(err)
|
||||||
} else if f.opt.StopOnUploadLimit && reason == "teamDriveFileLimitExceeded" {
|
} else if f.opt.StopOnUploadLimit && reason == "teamDriveFileLimitExceeded" {
|
||||||
fs.Errorf(f, "Received team drive file limit error: %v", err)
|
fs.Errorf(f, "Received Shared Drive file limit error: %v", err)
|
||||||
return false, fserrors.FatalError(err)
|
return false, fserrors.FatalError(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -955,24 +955,24 @@ func configTeamDrive(ctx context.Context, opt *Options, m configmap.Mapper, name
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if opt.TeamDriveID == "" {
|
if opt.TeamDriveID == "" {
|
||||||
fmt.Printf("Configure this as a team drive?\n")
|
fmt.Printf("Configure this as a Shared Drive (Team Drive)?\n")
|
||||||
} else {
|
} else {
|
||||||
fmt.Printf("Change current team drive ID %q?\n", opt.TeamDriveID)
|
fmt.Printf("Change current Shared Drive (Team Drive) ID %q?\n", opt.TeamDriveID)
|
||||||
}
|
}
|
||||||
if !config.Confirm(false) {
|
if !config.Confirm(false) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
f, err := newFs(ctx, name, "", m)
|
f, err := newFs(ctx, name, "", m)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "failed to make Fs to list teamdrives")
|
return errors.Wrap(err, "failed to make Fs to list Shared Drives")
|
||||||
}
|
}
|
||||||
fmt.Printf("Fetching team drive list...\n")
|
fmt.Printf("Fetching Shared Drive list...\n")
|
||||||
teamDrives, err := f.listTeamDrives(ctx)
|
teamDrives, err := f.listTeamDrives(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if len(teamDrives) == 0 {
|
if len(teamDrives) == 0 {
|
||||||
fmt.Printf("No team drives found in your account")
|
fmt.Printf("No Shared Drives found in your account")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
var driveIDs, driveNames []string
|
var driveIDs, driveNames []string
|
||||||
|
@ -980,7 +980,7 @@ func configTeamDrive(ctx context.Context, opt *Options, m configmap.Mapper, name
|
||||||
driveIDs = append(driveIDs, teamDrive.Id)
|
driveIDs = append(driveIDs, teamDrive.Id)
|
||||||
driveNames = append(driveNames, teamDrive.Name)
|
driveNames = append(driveNames, teamDrive.Name)
|
||||||
}
|
}
|
||||||
driveID := config.Choose("Enter a Team Drive ID", driveIDs, driveNames, true)
|
driveID := config.Choose("Enter a Shared Drive ID", driveIDs, driveNames, true)
|
||||||
m.Set("team_drive", driveID)
|
m.Set("team_drive", driveID)
|
||||||
m.Set("root_folder_id", "")
|
m.Set("root_folder_id", "")
|
||||||
opt.TeamDriveID = driveID
|
opt.TeamDriveID = driveID
|
||||||
|
@ -2475,9 +2475,9 @@ func (f *Fs) teamDriveOK(ctx context.Context) (err error) {
|
||||||
return f.shouldRetry(err)
|
return f.shouldRetry(err)
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "failed to get Team/Shared Drive info")
|
return errors.Wrap(err, "failed to get Shared Drive info")
|
||||||
}
|
}
|
||||||
fs.Debugf(f, "read info from team drive %q", td.Name)
|
fs.Debugf(f, "read info from Shared Drive %q", td.Name)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2963,7 +2963,7 @@ func (f *Fs) listTeamDrives(ctx context.Context) (drives []*drive.TeamDrive, err
|
||||||
return defaultFs.shouldRetry(err)
|
return defaultFs.shouldRetry(err)
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return drives, errors.Wrap(err, "listing team drives failed")
|
return drives, errors.Wrap(err, "listing Team Drives failed")
|
||||||
}
|
}
|
||||||
drives = append(drives, teamDrives.TeamDrives...)
|
drives = append(drives, teamDrives.TeamDrives...)
|
||||||
if teamDrives.NextPageToken == "" {
|
if teamDrives.NextPageToken == "" {
|
||||||
|
@ -3131,8 +3131,8 @@ authenticated with "drive2:" can't read files from "drive:".
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
Name: "drives",
|
Name: "drives",
|
||||||
Short: "List the shared drives available to this account",
|
Short: "List the Shared Drives available to this account",
|
||||||
Long: `This command lists the shared drives (teamdrives) available to this
|
Long: `This command lists the Shared Drives (Team Drives) available to this
|
||||||
account.
|
account.
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
|
|
|
@ -72,7 +72,7 @@ If your browser doesn't open automatically go to the following link: http://127.
|
||||||
Log in and authorize rclone for access
|
Log in and authorize rclone for access
|
||||||
Waiting for code...
|
Waiting for code...
|
||||||
Got code
|
Got code
|
||||||
Configure this as a team drive?
|
Configure this as a Shared Drive (Team Drive)?
|
||||||
y) Yes
|
y) Yes
|
||||||
n) No
|
n) No
|
||||||
y/n> n
|
y/n> n
|
||||||
|
@ -279,23 +279,24 @@ Note: in case you configured a specific root folder on gdrive and rclone is unab
|
||||||
`rclone -v foo@example.com lsf gdrive:backup`
|
`rclone -v foo@example.com lsf gdrive:backup`
|
||||||
|
|
||||||
|
|
||||||
### Team drives ###
|
### Shared drives (team drives) ###
|
||||||
|
|
||||||
If you want to configure the remote to point to a Google Team Drive
|
If you want to configure the remote to point to a Google Shared Drive
|
||||||
then answer `y` to the question `Configure this as a team drive?`.
|
(previously known as Team Drives) then answer `y` to the question
|
||||||
|
`Configure this as a Shared Drive (Team Drive)?`.
|
||||||
|
|
||||||
This will fetch the list of Team Drives from google and allow you to
|
This will fetch the list of Shared Drives from google and allow you to
|
||||||
configure which one you want to use. You can also type in a team
|
configure which one you want to use. You can also type in a Shared
|
||||||
drive ID if you prefer.
|
Drive ID if you prefer.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
```
|
```
|
||||||
Configure this as a team drive?
|
Configure this as a Shared Drive (Team Drive)?
|
||||||
y) Yes
|
y) Yes
|
||||||
n) No
|
n) No
|
||||||
y/n> y
|
y/n> y
|
||||||
Fetching team drive list...
|
Fetching Shared Drive list...
|
||||||
Choose a number from below, or type in your own value
|
Choose a number from below, or type in your own value
|
||||||
1 / Rclone Test
|
1 / Rclone Test
|
||||||
\ "xxxxxxxxxxxxxxxxxxxx"
|
\ "xxxxxxxxxxxxxxxxxxxx"
|
||||||
|
@ -303,7 +304,7 @@ Choose a number from below, or type in your own value
|
||||||
\ "yyyyyyyyyyyyyyyyyyyy"
|
\ "yyyyyyyyyyyyyyyyyyyy"
|
||||||
3 / Rclone Test 3
|
3 / Rclone Test 3
|
||||||
\ "zzzzzzzzzzzzzzzzzzzz"
|
\ "zzzzzzzzzzzzzzzzzzzz"
|
||||||
Enter a Team Drive ID> 1
|
Enter a Shared Drive ID> 1
|
||||||
--------------------
|
--------------------
|
||||||
[remote]
|
[remote]
|
||||||
client_id =
|
client_id =
|
||||||
|
@ -674,7 +675,7 @@ Needed only if you want use SA instead of interactive login.
|
||||||
|
|
||||||
#### --drive-team-drive
|
#### --drive-team-drive
|
||||||
|
|
||||||
ID of the Team Drive
|
ID of the Shared Drive (Team Drive)
|
||||||
|
|
||||||
- Config: team_drive
|
- Config: team_drive
|
||||||
- Env Var: RCLONE_DRIVE_TEAM_DRIVE
|
- Env Var: RCLONE_DRIVE_TEAM_DRIVE
|
||||||
|
@ -1137,11 +1138,11 @@ Options:
|
||||||
|
|
||||||
#### drives
|
#### drives
|
||||||
|
|
||||||
List the shared drives available to this account
|
List the Shared Drives available to this account
|
||||||
|
|
||||||
rclone backend drives remote: [options] [<arguments>+]
|
rclone backend drives remote: [options] [<arguments>+]
|
||||||
|
|
||||||
This command lists the shared drives (teamdrives) available to this
|
This command lists the Shared Drives (Team Drives) available to this
|
||||||
account.
|
account.
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
|
|
Loading…
Add table
Reference in a new issue