# Google Drive Plugin
This tutorial explains how to create Google Drive-based read/write storage backend for Wildland containers.
# Obtaining user credentials
Create a new project on the developer console via: https://console.cloud.google.com/projectcreate (opens new window).
Select
SELECT PROJECT
.On the project page, select
Go to APIs overview
.Click
ENABLE APIS AND SERVICES
.Search for
Google Drive API
, select it and pressEnable
.When API is enabled, you will see a warning message on the dashboard, which will say:
To use this API, you may need credentials. Click 'Create credentials' to get started.
. Click theCREATE CREDENTIALS
next to it.There will be a wizard asking for the credential type. Select
Google Drive API
andUser Data
and pressNEXT
.The second Wizard screen is
OAuth consent screen
, fill in the necessary parts and ClickSAVE AND CONTINUE
.The third Wizard screen is
Scopes
, skip this screen by simply pressingSAVE AND CONTINUE
.The fourth screen is
OAuth Client ID
. Select Desktop App asApplication type
and theName
field can remain as it is, then click theCREATE
button.On the final screen, Google will show your Client ID and give an option to download application credentials in JSON format, which is what we are looking for. Press
DOWNLOAD
. We don’t need the Client ID itself.This is an example of what you will find in the downloaded JSON file.
{ "installed": { "client_id": "{CLIENT_ID}.apps.googleusercontent.com", "project_id": "{PROJECT_ID}", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://oauth2.googleapis.com/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_secret": "{CLIENT_SECRET}", "redirect_uris": ["urn:ietf:wg:oauth:2.0:oob", "http://localhost"] } }
After downloading the file, press
OK
, this will take you back to the project's credentials page. SelectOAuth consent screen
from the side menu and under thePublishing status
section, press thePUBLISH APP
button. We’re done here.
# Creating Google Drive storage
$ wl c create YOUR_CONTAINER_NAME
$ wl storage create googledrive --inline --container YOUR_CONTAINER_NAME --credentials 'CONTENT_OF_CLIENT_CONFIG_JSON_IN_BETWEEN_SINGLE_QUOTE'
# Mounting
$ wl start
$ wl c mount YOUR_CONTAINER_NAME