Tuesday, July 21, 2020

Google TEAM Drive generate Service Accounts

markdown I believe everyone has read the article I wrote last time about transferring files between Google Cloud Disk team disks. The website that created SA cannot be opened, so I will show you how to create it here.[Last article](/2020/07/transfer-data-between-google-team-drive.html) 1. Go and download Python 3 [Portal](https://www.python.org/ftp/python/3.8.5/python-3.8.5.exe). 2. Go and download rclone(Windows, read official document to know how to install on linux [Portal](https://rclone.org/downloads/)) [Portal](https://downloads.rclone.org/v1.52.2/rclone-v1.52.2-windows-amd64.zip). 3. Go and download AutoRclone [Portal](https://github.com/xyou365/AutoRclone/archive/master.zip). 4. Go to that folder, and execute command: ```shell pip install -r requirements.txt ``` If you are Linux, use this: ```shell pip3 install -r requirements.txt ``` 5. Go and Enable Drive API.[Portal](https://developers.google.com/drive/api/v3/quickstart/python), use whatever name, Desktop app, then download the file, it should named __'credentials.json'__ 6. Create Service Account. Upload __credentials.json__ to your AutoRclone folder. Then divided into three cases If you haven't created a project before, just run ```shell python gen_sa_accounts.py --quick-setup 5 ``` Create 6 projects (Project 0 to Project 5) Turn on related services Create 600 service accounts (6 projects, 100 for each project) Download the authorization files of 600 service accounts to the accounts folder If you already have many projects, now you need to create a new project and create service accounts in the new project, run directly ```shell python gen_sa_accounts.py --quick-setup 2 --new-only ``` Create 2 additional projects (Project N+1 to Project N+2) Turn on related services Create 200 service accounts (2 projects, 100 for each project) Download the authorization file of 200 service accounts to the accounts folder If you want to use an existing project to create service accounts (do not create a new project), just run ```shell python gen_sa_accounts.py --quick-setup -1 ``` Note that this will overwrite the existing service accounts After successful completion, there will be many json files in the accounts folder under the AutoRclone file. Then you need to associate the SA file to your account. You need to know your team disk ID. If you don’t know it, open your team disk and check the string of characters after "folders/" in the address bar. The team disk ID will look like this: 0AIly3TxVb3jlUk9PVA Then enter the following command: ```shell python add_to_team_drive.py --credentials credentials.json --drive-id DRIVE-ID ``` Please replace DRIVE-ID with your DRIVE ID The final command will look like this: ```shell python add_to_team_drive.py --credentials credentials.json --drive-id 0AIly3TxVb3jlUk9PVA ``` That's all, your SA should be configured.

1 comment:

  1. Your post is very useful.Thanks.I have a question.How can i download my existing SA accounts in console.cloud.google?I look forward to getting your reply.

    ReplyDelete

Digital Sign your EXE, DLL or CAB.

markdown When you download an executable file from a **trusted website**, you will find that it has been digitally signed. However, digital...