<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>article Automate file processing from Google Storage with Talend Cloud in Official Support Articles</title>
    <link>https://community.qlik.com/t5/Official-Support-Articles/Automate-file-processing-from-Google-Storage-with-Talend-Cloud/ta-p/2150611</link>
    <description>&lt;DIV class="talend-tkb-migrated-content"&gt;&lt;P&gt; 
 &lt;/P&gt; 
&lt;DIV class="lia-message-template-content-zone"&gt; 
 &lt;H1&gt;Overview&lt;/H1&gt; 
 &lt;P&gt;Automate file processing from cloud storage is one of the most common use cases. This article explains how to integrate Google Storage with Talend Cloud for this case.&lt;/P&gt; 
 &lt;P&gt;&amp;nbsp;&lt;/P&gt; 
 &lt;H1&gt;Prerequisites&lt;/H1&gt; 
 &lt;UL&gt;&lt;LI&gt;Talend Cloud account: You can sign up for a free trial account here, &lt;A href="https://iam.us.cloud.talend.com/idp/trial-registration" target="_blank"&gt;https://iam.us.cloud.talend.com/idp/trial-registration&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Google Cloud account&lt;/LI&gt;&lt;LI&gt;Basic JavaScript knowledge&lt;/LI&gt;&lt;/UL&gt; 
 &lt;H1&gt;Scenario&lt;/H1&gt; 
 &lt;OL&gt;&lt;LI&gt;A file is pushed to a Google Storage bucket.&lt;/LI&gt;&lt;LI&gt;A trigger calls a Cloud function.&lt;/LI&gt;&lt;LI&gt;The Cloud function calls a Talend Flow.&lt;/LI&gt;&lt;LI&gt;The Talend Flow retrieves the file to process it based on the parameters sent by the Cloud function.&lt;/LI&gt;&lt;/OL&gt; 
 &lt;H1&gt;Google Cloud Storage&lt;/H1&gt; 
 &lt;P&gt;Google Cloud Storage is an object storage system on the Google Cloud Platform (GCP), if you are familiar with Amazon, the equivalent is S3.&lt;/P&gt; 
 &lt;P&gt;&amp;nbsp;&lt;/P&gt; 
 &lt;H2&gt;Creating a Bucket&lt;/H2&gt; 
 &lt;OL&gt;&lt;LI&gt; &lt;P&gt;Log in to your Google Cloud account, then go to the &lt;STRONG&gt;Storage&lt;/STRONG&gt; page.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 522px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uErFAAU.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124869i04BC254F606D8739/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uErFAAU.png" alt="0693p000008uErFAAU.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Click &lt;STRONG&gt;Create Bucket&lt;/STRONG&gt;.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 594px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEixAAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/122283iBF632B356D9C6B03/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEixAAE.png" alt="0693p000008uEixAAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Configure your bucket.&lt;/P&gt; 
   &lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Name&lt;/STRONG&gt;: Name your bucket.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Default storage class&lt;/STRONG&gt;: Define the type of storage: 
     &lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Multi-Regional&lt;/STRONG&gt;: This option replicates your bucket across multiple regions in an area (for example, Europe)&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Regional&lt;/STRONG&gt;: This option replicates your bucket across zones in a specific region&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Nearline&lt;/STRONG&gt; and &lt;STRONG&gt;Coldline&lt;/STRONG&gt;: These two options are more of an archive option&lt;/LI&gt;&lt;/UL&gt; &lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Location&lt;/STRONG&gt;: Specify the location of your bucket.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Labels&lt;/STRONG&gt;: Set the metadata for your bucket.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Encryption&lt;/STRONG&gt;: Select the type of encryption you want to use.&lt;/LI&gt;&lt;/UL&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 818px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEq8AAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124908i4427B0D49AE22B85/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEq8AAE.png" alt="0693p000008uEq8AAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Once your bucket is created, add a folder to classify your incoming files.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 932px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uDXkAAM.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/122116i9964D885861C03B1/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uDXkAAM.png" alt="0693p000008uDXkAAM.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEjWAAU.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124040iE8B6108A2590B124/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEjWAAU.png" alt="0693p000008uEjWAAU.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Create an access key for your application. In Google Cloud Storage, navigate to the &lt;STRONG&gt;Settings&lt;/STRONG&gt; section, and click &lt;STRONG&gt;Create a new key&lt;/STRONG&gt;.&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Retrieve and secure the keys in a safe place.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uErtAAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/121701i9E53E48B77499302/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uErtAAE.png" alt="0693p000008uErtAAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;/OL&gt; 
 &lt;H1&gt;Creating a Talend Job&lt;/H1&gt; 
 &lt;P&gt;&amp;nbsp;&lt;/P&gt; 
 &lt;P&gt;Create a Talend Job to retrieve a file from Google Cloud Storage and display data in the console. Of course in a real life example, a Job is more complex.&amp;nbsp;The demo Job&amp;nbsp;is available in the &lt;STRONG&gt;GSRead.zip&lt;/STRONG&gt; file attached to this article.&lt;/P&gt; 
 &lt;P&gt;&amp;nbsp;&lt;/P&gt; 
 &lt;P&gt;The Job is composed of the following steps:&lt;/P&gt; 
 &lt;OL&gt;&lt;LI&gt;Create a connection to Google Cloud Storage.&lt;/LI&gt;&lt;LI&gt;Retrieve the file from the Bucket.&lt;/LI&gt;&lt;LI&gt;Read the file and display to the console.&lt;/LI&gt;&lt;LI&gt;Close the connection to Google Cloud Storage. &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEGfAAM.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123288i98C064ED5C759F2E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEGfAAM.png" alt="0693p000008uEGfAAM.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Configure the context variables:&lt;/P&gt; 
   &lt;OL&gt;&lt;LI&gt; &lt;P&gt;&lt;STRONG&gt;tempFolder&lt;/STRONG&gt;: the folder used to store temporary data, on Talend Cloud Engine, it is &lt;STRONG&gt;/tmp&lt;/STRONG&gt;.&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;&lt;STRONG&gt;fileKey&lt;/STRONG&gt;: the file name from the GCP Bucket. It is composed of the folder and file name.&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;&lt;STRONG&gt;fileBucket&lt;/STRONG&gt;: the Google bucket you created.&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;&lt;STRONG&gt;gcpAccessKey&lt;/STRONG&gt;: the Google Storage access key you created.&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;&lt;STRONG&gt;gcpSecretKey&lt;/STRONG&gt;: the Google Storage secret key you created.&lt;/P&gt; &lt;/LI&gt;&lt;/OL&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEm1AAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123792i04C28743934FD313/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEm1AAE.png" alt="0693p000008uEm1AAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Configure the &lt;STRONG&gt;tGSConnection&lt;/STRONG&gt; component:&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEs3AAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124372i2B6764470386520E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEs3AAE.png" alt="0693p000008uEs3AAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Configure the &lt;STRONG&gt;tGSGet&lt;/STRONG&gt; component:&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEsDAAU.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/121991i2D30C3418DCD28F1/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEsDAAU.png" alt="0693p000008uEsDAAU.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;P&gt;This component uses a split because the fileKey looks like &lt;STRONG&gt;cloud-function/sample.csv&lt;/STRONG&gt; and you only need the &lt;STRONG&gt;sample.csv&lt;/STRONG&gt;.&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Configure the &lt;STRONG&gt;tFileInputRaw&lt;/STRONG&gt; component:&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEmkAAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124220i232F6EEC1583C205/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEmkAAE.png" alt="0693p000008uEmkAAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Now your Job is configured. You can test it by adding valid parameters to the context.&lt;/P&gt; &lt;/LI&gt;&lt;/OL&gt; 
 &lt;H2&gt;Publishing a Job to Talend Cloud&lt;/H2&gt; 
 &lt;P&gt;For more information on publishing a Job to Talend Cloud, see &lt;A href="https://help.talend.com/search/all?query=Connecting+Talend+Studio+to+Talend+Integration+Cloud&amp;amp;content-lang=en-US" target="_blank"&gt;Connecting Talend Studio to Talend Integration Cloud&lt;/A&gt;&lt;/P&gt; 
 &lt;OL&gt;&lt;LI&gt; &lt;P&gt;Right-click your Job, and select &lt;STRONG&gt;Publish to Cloud&lt;/STRONG&gt;.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 347px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEsSAAU.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123513iC49FCED3D467F0E7/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEsSAAU.png" alt="0693p000008uEsSAAU.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Configure your export as needed, then click &lt;STRONG&gt;Finish&lt;/STRONG&gt;.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEscAAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124358iE1022AE8D8C30770/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEscAAE.png" alt="0693p000008uEscAAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Once the Job is published, click &lt;STRONG&gt;Open Job Flow&lt;/STRONG&gt;.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEsmAAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/122765i42F2801545377513/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEsmAAE.png" alt="0693p000008uEsmAAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;P&gt;If you are logged in Talend Cloud, you should see your configuration.&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Configure the Job as appropriate.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEsrAAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123563iAB8516EB12B260D6/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEsrAAE.png" alt="0693p000008uEsrAAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uAMlAAM.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/122069i5DB39A83E2610474/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uAMlAAM.png" alt="0693p000008uAMlAAM.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;/OL&gt; 
 &lt;H1&gt;Google Cloud Function&lt;/H1&gt; 
 &lt;P&gt;A Google Cloud Function allows you to implement the following logic:&lt;/P&gt; 
 &lt;UL&gt;&lt;LI&gt;Each time you create a file in your bucket, the function will call your Talend Job.&lt;/LI&gt;&lt;/UL&gt; 
 &lt;P&gt;Google Cloud functions are written in JavaScript. The function and package code are available in the &lt;STRONG&gt;gcp-cloud-function.zip&lt;/STRONG&gt; file attached to this article.&lt;/P&gt; 
 &lt;P&gt;&amp;nbsp;&lt;/P&gt; 
 &lt;OL&gt;&lt;LI&gt; &lt;P&gt;Find your Flow Id. In Talend Cloud, select your flow and check the Flow Id:&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEt1AAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124346i49B0852732B7529F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEt1AAE.png" alt="0693p000008uEt1AAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;In your Google Cloud Platform console, go to &lt;STRONG&gt;Cloud Functions&lt;/STRONG&gt;.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEiOAAU.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123457i267C7CA8BDC6C8D4/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEiOAAU.png" alt="0693p000008uEiOAAU.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Create a function.&lt;/P&gt; 
   &lt;OL&gt;&lt;LI&gt; &lt;P&gt;&lt;STRONG&gt;Name&lt;/STRONG&gt;: Give your function a name.&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;&lt;STRONG&gt;Memory allocated&lt;/STRONG&gt;: Select the memory needed for your function.&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;&lt;STRONG&gt;Trigger&lt;/STRONG&gt;: In your case, use the Cloud Storage bucket.&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;&lt;STRONG&gt;Event Type&lt;/STRONG&gt;: For each file Finalized/Created.&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;&lt;STRONG&gt;Bucket&lt;/STRONG&gt;: The bucket you created.&lt;/P&gt; &lt;/LI&gt;&lt;/OL&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEtBAAU.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123870i30B2A2A15ECDC271/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEtBAAU.png" alt="0693p000008uEtBAAU.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;P&gt;You can use the inline editor to create the function.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 901px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEmTAAU.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/122906i14CAF6F863BFA759/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEmTAAU.png" alt="0693p000008uEmTAAU.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;PRE&gt;/**
 * Triggered from a message on a Cloud Storage bucket.
 *
 * @param {!Object} event The Cloud Functions event.
 * @param {!Function} The callback function.
 */

function responseCall(error, response, body) {
    console.log(JSON.stringify(body));
    console.log(response);   
}


exports.processFile = (event, callback) =&amp;gt; {
console.log('Processing file: ' + event.data.name);

// Body 
var parameters = new Object();
parameters.fileBucket = event.data.bucket;
parameters.fileKey  = event.data.name;
var body = new Object();
body.executable = "&lt;STRONG&gt;&amp;lt;Talend Flow ID&amp;gt;&lt;/STRONG&gt;";
body.parameters = parameters;

var jsonString= JSON.stringify(body);
console.log(jsonString);

// Call Executions
// Include the request library for Node.js   
var request = require('request');
//  Basic Authentication credentials   
var username = "&lt;STRONG&gt;&amp;lt;Talend Cloud user&amp;gt;&lt;/STRONG&gt;"; 
var password = "&lt;STRONG&gt;&amp;lt;Talend Cloud Password&amp;gt;&lt;/STRONG&gt;";
var authenticationHeader = "Basic " + new Buffer(username + ":" + password).toString("base64");

//Request
var options ={
     method: 'POST',
     url : "&lt;STRONG&gt;https://ipaas.us.cloud.talend.com/api/v1.1/executions&lt;/STRONG&gt;",
     body: jsonString,
     headers : { 
         "Content-Type": "application/json",
         "Accept": "application/json",
         "Authorization" : authenticationHeader }  
  };  

request(options, responseCall);
console.log("Done!")

callback();
};
&lt;/PRE&gt; &lt;P&gt;This function is rather simple:&lt;/P&gt; 
   &lt;UL&gt;&lt;LI&gt;Create a JSON body to send to Talend Cloud, as shown below:&lt;/LI&gt;&lt;/UL&gt; &lt;PRE&gt;{
  "executable": "57f64991e4b0b689a64feed0",
  "parameters": {
    "fileKey": "cloud-function/sample.csv",
    "fileBucket": "mgainhao-demo"
  }
}&lt;/PRE&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;You can test your API on the API documentation page, &lt;A href="https://ipaas.us.cloud.talend.com/api/swagger/swagger-ui.html#!/executions/execute" target="_self"&gt;Talend Cloud API-Executions&lt;/A&gt;, of Talend Cloud.&lt;/P&gt; 
   &lt;OL&gt;&lt;LI&gt; &lt;P&gt;Add basic authentication for connection to Talend Cloud.&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Create a request.&lt;/P&gt; &lt;/LI&gt;&lt;/OL&gt; &lt;P&gt;Because you are using the module &lt;STRONG&gt;request&lt;/STRONG&gt;, you need to update the &lt;STRONG&gt;package.json&lt;/STRONG&gt; to add dependencies.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEnJAAU.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/122003i30B61495A0462D7A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEnJAAU.png" alt="0693p000008uEnJAAU.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Click &lt;STRONG&gt;Create&lt;/STRONG&gt;. The function is created.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEo8AAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124734i1094B9F0F0614C63/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEo8AAE.png" alt="0693p000008uEo8AAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEtQAAU.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/121845iF573B66CDB35D3EE/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEtQAAU.png" alt="0693p000008uEtQAAU.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;You can access the dashboard by clicking the name of the function.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEsiAAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124944iB1C13B3648E93232/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEsiAAE.png" alt="0693p000008uEsiAAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Test your function. Create a new file in the Google Cloud bucket.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEtfAAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123432i6B713D99C2516354/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEtfAAE.png" alt="0693p000008uEtfAAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Your function is called.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEtpAAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/122005i6C3F61D0CB6C686A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEtpAAE.png" alt="0693p000008uEtpAAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;In Talend Cloud, verify that there are new executions of your Job.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEtzAAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123932i1BF834DCB777DB17/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEtzAAE.png" alt="0693p000008uEtzAAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;In the logs, you should be able to see the content of the file in the &lt;STRONG&gt;tLogRow_1&lt;/STRONG&gt; section.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEu4AAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123564iE715CE354F532087/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEu4AAE.png" alt="0693p000008uEu4AAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;/OL&gt; 
 &lt;H1&gt;Conclusion&lt;/H1&gt; 
 &lt;P&gt;Using Talend Cloud to process a file from cloud storage is easier with the ability to call Talend API within a Cloud Function.&lt;/P&gt; 
&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 23 Jan 2024 02:35:30 GMT</pubDate>
    <dc:creator>TalendSolutionExpert</dc:creator>
    <dc:date>2024-01-23T02:35:30Z</dc:date>
    <item>
      <title>Automate file processing from Google Storage with Talend Cloud</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Automate-file-processing-from-Google-Storage-with-Talend-Cloud/ta-p/2150611</link>
      <description>&lt;DIV class="talend-tkb-migrated-content"&gt;&lt;P&gt; 
 &lt;/P&gt; 
&lt;DIV class="lia-message-template-content-zone"&gt; 
 &lt;H1&gt;Overview&lt;/H1&gt; 
 &lt;P&gt;Automate file processing from cloud storage is one of the most common use cases. This article explains how to integrate Google Storage with Talend Cloud for this case.&lt;/P&gt; 
 &lt;P&gt;&amp;nbsp;&lt;/P&gt; 
 &lt;H1&gt;Prerequisites&lt;/H1&gt; 
 &lt;UL&gt;&lt;LI&gt;Talend Cloud account: You can sign up for a free trial account here, &lt;A href="https://iam.us.cloud.talend.com/idp/trial-registration" target="_blank"&gt;https://iam.us.cloud.talend.com/idp/trial-registration&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Google Cloud account&lt;/LI&gt;&lt;LI&gt;Basic JavaScript knowledge&lt;/LI&gt;&lt;/UL&gt; 
 &lt;H1&gt;Scenario&lt;/H1&gt; 
 &lt;OL&gt;&lt;LI&gt;A file is pushed to a Google Storage bucket.&lt;/LI&gt;&lt;LI&gt;A trigger calls a Cloud function.&lt;/LI&gt;&lt;LI&gt;The Cloud function calls a Talend Flow.&lt;/LI&gt;&lt;LI&gt;The Talend Flow retrieves the file to process it based on the parameters sent by the Cloud function.&lt;/LI&gt;&lt;/OL&gt; 
 &lt;H1&gt;Google Cloud Storage&lt;/H1&gt; 
 &lt;P&gt;Google Cloud Storage is an object storage system on the Google Cloud Platform (GCP), if you are familiar with Amazon, the equivalent is S3.&lt;/P&gt; 
 &lt;P&gt;&amp;nbsp;&lt;/P&gt; 
 &lt;H2&gt;Creating a Bucket&lt;/H2&gt; 
 &lt;OL&gt;&lt;LI&gt; &lt;P&gt;Log in to your Google Cloud account, then go to the &lt;STRONG&gt;Storage&lt;/STRONG&gt; page.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 522px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uErFAAU.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124869i04BC254F606D8739/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uErFAAU.png" alt="0693p000008uErFAAU.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Click &lt;STRONG&gt;Create Bucket&lt;/STRONG&gt;.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 594px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEixAAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/122283iBF632B356D9C6B03/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEixAAE.png" alt="0693p000008uEixAAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Configure your bucket.&lt;/P&gt; 
   &lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Name&lt;/STRONG&gt;: Name your bucket.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Default storage class&lt;/STRONG&gt;: Define the type of storage: 
     &lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Multi-Regional&lt;/STRONG&gt;: This option replicates your bucket across multiple regions in an area (for example, Europe)&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Regional&lt;/STRONG&gt;: This option replicates your bucket across zones in a specific region&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Nearline&lt;/STRONG&gt; and &lt;STRONG&gt;Coldline&lt;/STRONG&gt;: These two options are more of an archive option&lt;/LI&gt;&lt;/UL&gt; &lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Location&lt;/STRONG&gt;: Specify the location of your bucket.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Labels&lt;/STRONG&gt;: Set the metadata for your bucket.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Encryption&lt;/STRONG&gt;: Select the type of encryption you want to use.&lt;/LI&gt;&lt;/UL&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 818px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEq8AAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124908i4427B0D49AE22B85/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEq8AAE.png" alt="0693p000008uEq8AAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Once your bucket is created, add a folder to classify your incoming files.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 932px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uDXkAAM.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/122116i9964D885861C03B1/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uDXkAAM.png" alt="0693p000008uDXkAAM.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEjWAAU.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124040iE8B6108A2590B124/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEjWAAU.png" alt="0693p000008uEjWAAU.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Create an access key for your application. In Google Cloud Storage, navigate to the &lt;STRONG&gt;Settings&lt;/STRONG&gt; section, and click &lt;STRONG&gt;Create a new key&lt;/STRONG&gt;.&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Retrieve and secure the keys in a safe place.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uErtAAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/121701i9E53E48B77499302/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uErtAAE.png" alt="0693p000008uErtAAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;/OL&gt; 
 &lt;H1&gt;Creating a Talend Job&lt;/H1&gt; 
 &lt;P&gt;&amp;nbsp;&lt;/P&gt; 
 &lt;P&gt;Create a Talend Job to retrieve a file from Google Cloud Storage and display data in the console. Of course in a real life example, a Job is more complex.&amp;nbsp;The demo Job&amp;nbsp;is available in the &lt;STRONG&gt;GSRead.zip&lt;/STRONG&gt; file attached to this article.&lt;/P&gt; 
 &lt;P&gt;&amp;nbsp;&lt;/P&gt; 
 &lt;P&gt;The Job is composed of the following steps:&lt;/P&gt; 
 &lt;OL&gt;&lt;LI&gt;Create a connection to Google Cloud Storage.&lt;/LI&gt;&lt;LI&gt;Retrieve the file from the Bucket.&lt;/LI&gt;&lt;LI&gt;Read the file and display to the console.&lt;/LI&gt;&lt;LI&gt;Close the connection to Google Cloud Storage. &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEGfAAM.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123288i98C064ED5C759F2E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEGfAAM.png" alt="0693p000008uEGfAAM.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Configure the context variables:&lt;/P&gt; 
   &lt;OL&gt;&lt;LI&gt; &lt;P&gt;&lt;STRONG&gt;tempFolder&lt;/STRONG&gt;: the folder used to store temporary data, on Talend Cloud Engine, it is &lt;STRONG&gt;/tmp&lt;/STRONG&gt;.&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;&lt;STRONG&gt;fileKey&lt;/STRONG&gt;: the file name from the GCP Bucket. It is composed of the folder and file name.&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;&lt;STRONG&gt;fileBucket&lt;/STRONG&gt;: the Google bucket you created.&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;&lt;STRONG&gt;gcpAccessKey&lt;/STRONG&gt;: the Google Storage access key you created.&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;&lt;STRONG&gt;gcpSecretKey&lt;/STRONG&gt;: the Google Storage secret key you created.&lt;/P&gt; &lt;/LI&gt;&lt;/OL&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEm1AAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123792i04C28743934FD313/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEm1AAE.png" alt="0693p000008uEm1AAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Configure the &lt;STRONG&gt;tGSConnection&lt;/STRONG&gt; component:&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEs3AAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124372i2B6764470386520E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEs3AAE.png" alt="0693p000008uEs3AAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Configure the &lt;STRONG&gt;tGSGet&lt;/STRONG&gt; component:&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEsDAAU.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/121991i2D30C3418DCD28F1/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEsDAAU.png" alt="0693p000008uEsDAAU.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;P&gt;This component uses a split because the fileKey looks like &lt;STRONG&gt;cloud-function/sample.csv&lt;/STRONG&gt; and you only need the &lt;STRONG&gt;sample.csv&lt;/STRONG&gt;.&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Configure the &lt;STRONG&gt;tFileInputRaw&lt;/STRONG&gt; component:&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEmkAAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124220i232F6EEC1583C205/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEmkAAE.png" alt="0693p000008uEmkAAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Now your Job is configured. You can test it by adding valid parameters to the context.&lt;/P&gt; &lt;/LI&gt;&lt;/OL&gt; 
 &lt;H2&gt;Publishing a Job to Talend Cloud&lt;/H2&gt; 
 &lt;P&gt;For more information on publishing a Job to Talend Cloud, see &lt;A href="https://help.talend.com/search/all?query=Connecting+Talend+Studio+to+Talend+Integration+Cloud&amp;amp;content-lang=en-US" target="_blank"&gt;Connecting Talend Studio to Talend Integration Cloud&lt;/A&gt;&lt;/P&gt; 
 &lt;OL&gt;&lt;LI&gt; &lt;P&gt;Right-click your Job, and select &lt;STRONG&gt;Publish to Cloud&lt;/STRONG&gt;.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 347px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEsSAAU.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123513iC49FCED3D467F0E7/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEsSAAU.png" alt="0693p000008uEsSAAU.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Configure your export as needed, then click &lt;STRONG&gt;Finish&lt;/STRONG&gt;.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEscAAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124358iE1022AE8D8C30770/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEscAAE.png" alt="0693p000008uEscAAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Once the Job is published, click &lt;STRONG&gt;Open Job Flow&lt;/STRONG&gt;.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEsmAAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/122765i42F2801545377513/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEsmAAE.png" alt="0693p000008uEsmAAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;P&gt;If you are logged in Talend Cloud, you should see your configuration.&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Configure the Job as appropriate.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEsrAAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123563iAB8516EB12B260D6/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEsrAAE.png" alt="0693p000008uEsrAAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uAMlAAM.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/122069i5DB39A83E2610474/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uAMlAAM.png" alt="0693p000008uAMlAAM.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;/OL&gt; 
 &lt;H1&gt;Google Cloud Function&lt;/H1&gt; 
 &lt;P&gt;A Google Cloud Function allows you to implement the following logic:&lt;/P&gt; 
 &lt;UL&gt;&lt;LI&gt;Each time you create a file in your bucket, the function will call your Talend Job.&lt;/LI&gt;&lt;/UL&gt; 
 &lt;P&gt;Google Cloud functions are written in JavaScript. The function and package code are available in the &lt;STRONG&gt;gcp-cloud-function.zip&lt;/STRONG&gt; file attached to this article.&lt;/P&gt; 
 &lt;P&gt;&amp;nbsp;&lt;/P&gt; 
 &lt;OL&gt;&lt;LI&gt; &lt;P&gt;Find your Flow Id. In Talend Cloud, select your flow and check the Flow Id:&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEt1AAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124346i49B0852732B7529F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEt1AAE.png" alt="0693p000008uEt1AAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;In your Google Cloud Platform console, go to &lt;STRONG&gt;Cloud Functions&lt;/STRONG&gt;.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEiOAAU.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123457i267C7CA8BDC6C8D4/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEiOAAU.png" alt="0693p000008uEiOAAU.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Create a function.&lt;/P&gt; 
   &lt;OL&gt;&lt;LI&gt; &lt;P&gt;&lt;STRONG&gt;Name&lt;/STRONG&gt;: Give your function a name.&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;&lt;STRONG&gt;Memory allocated&lt;/STRONG&gt;: Select the memory needed for your function.&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;&lt;STRONG&gt;Trigger&lt;/STRONG&gt;: In your case, use the Cloud Storage bucket.&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;&lt;STRONG&gt;Event Type&lt;/STRONG&gt;: For each file Finalized/Created.&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;&lt;STRONG&gt;Bucket&lt;/STRONG&gt;: The bucket you created.&lt;/P&gt; &lt;/LI&gt;&lt;/OL&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEtBAAU.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123870i30B2A2A15ECDC271/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEtBAAU.png" alt="0693p000008uEtBAAU.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;P&gt;You can use the inline editor to create the function.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 901px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEmTAAU.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/122906i14CAF6F863BFA759/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEmTAAU.png" alt="0693p000008uEmTAAU.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;PRE&gt;/**
 * Triggered from a message on a Cloud Storage bucket.
 *
 * @param {!Object} event The Cloud Functions event.
 * @param {!Function} The callback function.
 */

function responseCall(error, response, body) {
    console.log(JSON.stringify(body));
    console.log(response);   
}


exports.processFile = (event, callback) =&amp;gt; {
console.log('Processing file: ' + event.data.name);

// Body 
var parameters = new Object();
parameters.fileBucket = event.data.bucket;
parameters.fileKey  = event.data.name;
var body = new Object();
body.executable = "&lt;STRONG&gt;&amp;lt;Talend Flow ID&amp;gt;&lt;/STRONG&gt;";
body.parameters = parameters;

var jsonString= JSON.stringify(body);
console.log(jsonString);

// Call Executions
// Include the request library for Node.js   
var request = require('request');
//  Basic Authentication credentials   
var username = "&lt;STRONG&gt;&amp;lt;Talend Cloud user&amp;gt;&lt;/STRONG&gt;"; 
var password = "&lt;STRONG&gt;&amp;lt;Talend Cloud Password&amp;gt;&lt;/STRONG&gt;";
var authenticationHeader = "Basic " + new Buffer(username + ":" + password).toString("base64");

//Request
var options ={
     method: 'POST',
     url : "&lt;STRONG&gt;https://ipaas.us.cloud.talend.com/api/v1.1/executions&lt;/STRONG&gt;",
     body: jsonString,
     headers : { 
         "Content-Type": "application/json",
         "Accept": "application/json",
         "Authorization" : authenticationHeader }  
  };  

request(options, responseCall);
console.log("Done!")

callback();
};
&lt;/PRE&gt; &lt;P&gt;This function is rather simple:&lt;/P&gt; 
   &lt;UL&gt;&lt;LI&gt;Create a JSON body to send to Talend Cloud, as shown below:&lt;/LI&gt;&lt;/UL&gt; &lt;PRE&gt;{
  "executable": "57f64991e4b0b689a64feed0",
  "parameters": {
    "fileKey": "cloud-function/sample.csv",
    "fileBucket": "mgainhao-demo"
  }
}&lt;/PRE&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;You can test your API on the API documentation page, &lt;A href="https://ipaas.us.cloud.talend.com/api/swagger/swagger-ui.html#!/executions/execute" target="_self"&gt;Talend Cloud API-Executions&lt;/A&gt;, of Talend Cloud.&lt;/P&gt; 
   &lt;OL&gt;&lt;LI&gt; &lt;P&gt;Add basic authentication for connection to Talend Cloud.&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Create a request.&lt;/P&gt; &lt;/LI&gt;&lt;/OL&gt; &lt;P&gt;Because you are using the module &lt;STRONG&gt;request&lt;/STRONG&gt;, you need to update the &lt;STRONG&gt;package.json&lt;/STRONG&gt; to add dependencies.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEnJAAU.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/122003i30B61495A0462D7A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEnJAAU.png" alt="0693p000008uEnJAAU.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Click &lt;STRONG&gt;Create&lt;/STRONG&gt;. The function is created.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEo8AAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124734i1094B9F0F0614C63/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEo8AAE.png" alt="0693p000008uEo8AAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEtQAAU.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/121845iF573B66CDB35D3EE/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEtQAAU.png" alt="0693p000008uEtQAAU.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;You can access the dashboard by clicking the name of the function.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEsiAAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124944iB1C13B3648E93232/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEsiAAE.png" alt="0693p000008uEsiAAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Test your function. Create a new file in the Google Cloud bucket.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEtfAAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123432i6B713D99C2516354/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEtfAAE.png" alt="0693p000008uEtfAAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;Your function is called.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEtpAAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/122005i6C3F61D0CB6C686A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEtpAAE.png" alt="0693p000008uEtpAAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;In Talend Cloud, verify that there are new executions of your Job.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEtzAAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123932i1BF834DCB777DB17/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEtzAAE.png" alt="0693p000008uEtzAAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;LI&gt; &lt;P&gt;In the logs, you should be able to see the content of the file in the &lt;STRONG&gt;tLogRow_1&lt;/STRONG&gt; section.&lt;/P&gt; &lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000008uEu4AAE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123564iE715CE354F532087/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uEu4AAE.png" alt="0693p000008uEu4AAE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt; &lt;/LI&gt;&lt;/OL&gt; 
 &lt;H1&gt;Conclusion&lt;/H1&gt; 
 &lt;P&gt;Using Talend Cloud to process a file from cloud storage is easier with the ability to call Talend API within a Cloud Function.&lt;/P&gt; 
&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 23 Jan 2024 02:35:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Automate-file-processing-from-Google-Storage-with-Talend-Cloud/ta-p/2150611</guid>
      <dc:creator>TalendSolutionExpert</dc:creator>
      <dc:date>2024-01-23T02:35:30Z</dc:date>
    </item>
  </channel>
</rss>

