tGoogleDriveConnection - 6.1

Talend Components Reference Guide

EnrichVersion
6.1
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for Data Quality
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

tGoogleDriveConnection properties

Component family

Cloud / Google Drive

 

Function

This component opens a connection to access a Google Drive account.

Purpose

This component allows you to open a Google Drive connection that can be reused by other Google Drive components.

Basic settings

Application Name

Enter the application name required by Google Drive to get access to its APIs.

 

Access Token

Enter the access token required by Google Drive to access a Google Drive account and operate it. For how to get the access token, see Obtaining an access token for Google Drive.

 

Use HTTP Proxy

Select this check box if you are working behind an HTTP proxy.

 

Proxy Host

Enter the IP address of the HTTP proxy server.

This field is available only when the Use HTTP Proxy check box is selected.

 

Proxy Port

Enter the port number of the HTTP proxy server.

This field is available only when the Use HTTP Proxy check box is selected.

 

Use SSL

Select this check box if an SSL connection is used to access Google Drive.

 

Algorithm

Enter the name of the SSL cryptography algorithm.

This field is available only when the Use SSL check box is selected.

 

TrustStore File

Browse to or enter the path to the certificate TrustStore file that contains the list of certificates the client trusts.

This field is available only when the Use SSL check box is selected.

 

Password

Enter the password used to check the integrity of the TrustStore data.

This field is available only when the Use SSL check box is selected.

Advanced settings

tStatCatcher Statistics

Select this check box to gather the Job processing metadata at the Job level as well as at each component level.

Global Variables

ERROR_MESSAGE: the error message generated by the component when an error occurs. This is an After variable and it returns a string. This variable functions only if the Die on error check box is cleared, if the component has this check box.

A Flow variable functions during the execution of a component while an After variable functions after the execution of the component.

To fill up a field or expression with a variable, press Ctrl + Space to access the variable list and choose the variable to use from it.

For further information about variables, see Talend Studio User Guide.

Usage

This component is more commonly used with other Google Drive components. In a Job design, it is usually used to open a Google Drive connection that can be reused by other Google Drive components.

Limitation

n/a

Obtaining an access token for Google Drive

To use Google Drive APIs, you need first to obtain the access token by completing the following steps using Google Chrome with the REST Console extension installed:

  1. Go to the Google Developers Console and select an existing project or create a new one. In this example, we create a new project TalendProject.

  2. Select the newly created project, click APIs under APIs & auth and enable both the Drive API and Drive SDK APIs by setting their status to ON.

  3. Click Consent screen under APIs & auth and create a new product. In this example, it is TalendProduct.

  4. Click Credentials under APIs & auth, create a new client ID with APPLICATION TYPE set as Installed application and INSTALLED APPLICATION TYPE set as Other.

    The created CLIENT ID, CLIENT SECRET, and REDIRECT URIS will be used for obtaining the access token.

  5. Generate the authentication code by performing an HTTP GET request using a web browser. To do this, copy and paste the request URL https://accounts.google.com/o/oauth2/auth with the following query string parameters into your web browser's address bar, press Enter and accept the access request.

    • client_id: the value of CLIENT ID from the Credentials view.

    • redirect_uri: the value of REDIRECT URIS from the Credentials view.

    • response_type: the value is code.

    • scope: the range of permissions you request users to authorize for your app. For more information, see https://developers.google.com/drive/web/scopes.

    • access_type: the value is online.

    Note that the request URL and the query string parameters are concatenated with a question mark ?, and every two query string parameters are concatenated with an ampersand &. An example URL is shown below, with line breaks for readability. You need to join all these lines into one line before copying and pasting the URL into your web browser's address bar. The scope used in this example has full, permissive scope to access all of the user's files. Request this scope only when it is strictly necessary.

    https://accounts.google.com/o/oauth2/auth?
    client_id=1061335238805-gmctuidvid0lsrdf66nvit0g7j5gnrck.apps.googleusercontent.com&
    redirect_uri=urn:ietf:wg:oauth:2.0:oob&
    response_type=code&
    scope=https://www.googleapis.com/auth/drive&
    access_type=online

    The response returned contains an authorization code that will be used to generate the access token in the next step.

  6. Generate the access token by performing an HTTP POST request using Google REST Console. To do this, copy and paste the request URL https://www.googleapis.com/oauth2/v3/token with the following query string parameters into the Request URI field in the Target area, select the Content-Type check box and set its value to application/x-www-form-urlencoded, then click the POST button.

    • code: the authorization code generated in the previous step.

    • client_id: the value of CLIENT ID from the Credentials view.

    • client_secret: the value of CLIENT SECRET from the Credentials view.

    • redirect_uri: the value of REDIRECT URIS from the Credentials view.

    • grant_type: the value is authorization_code.

    Note that the request URL and the query string parameters are concatenated with a question mark ?, and every two query string parameters are concatenated with an ampersand &. An example URL is shown below, with line breaks for readability. You need to join all these lines into one line before copying and pasting the URL into the Request URI field.

    https://www.googleapis.com/oauth2/v3/token?
    code=4/fwRIPH2a8XQRCs2JicTs4zWTprKjyJ7KbwkY46fE1O0.sj6y9PmBGe8ZeFc0ZRONyF4NK_eblwI&
    client_id=1061335238805-gmctuidvid0lsrdf66nvit0g7j5gnrck.apps.googleusercontent.com&
    client_secret=x6Jis-fzAzBfCfrLlokuPopn&
    redirect_uri=urn:ietf:wg:oauth:2.0:oob&
    grant_type=authorization_code

    The response returned contains the access token. Note that the access token expires in every 3600 seconds.

Related scenario

For a related scenario, see Managing files with Google Drive.