Downloads files from a server using the Google Cloud Storage protocol.
The Google Cloud Storage nodes enable you to access data from Google Cloud Storage buckets, so that you can integrate your data flows with Google. See:
Downloading a single file from Google Cloud Storage
- In the Bucket property, specify the name of a Google Cloud Storage bucket that contains the file that you want to download.
- In the Object property, specify the name of the Google Cloud Storage file that you want to download.
- In the Directory property, specify where to store the file that is downloaded.
Downloading multiple files from Google Cloud Storage
- Drag a Google Cloud Storage List node onto the canvas and connect it to a Google Cloud Storage Get node.
- In the Bucket property of the Google Cloud Storage List node, type the name of the Google Cloud Storage bucket that contains the files that you want to download. Run the Google Cloud Storage List node to generate a list of files in the specified bucket.
- On the Google Cloud Storage Get node, select the (from Field) variant of the Bucket property and specify the name of the input field that contains the Google Cloud Storage bucket name.
- Select the (from Field) variant of the Object property, then specify the name of the input field that references the files that you want to download.
- In the Directory property, specify where to store the downloaded files.
Example
You want to download all files with the "Product" prefix from a Google Cloud Storage bucket:
- Drag a Google Cloud Storage List node onto the canvas.
- In the Bucket property, type the name of the Google Cloud Storage bucket for which you want to list files, e.g.
my-example-bucket
- In the ObjectPrefix property, type
Product
. - Run the Google Cloud Storage List node and connect it to a Google Cloud Storage Get node.
The output of the Google Cloud Storage List node is as follows:
Bucket
unicode
Object
unicode
Size
long
IsDirectory
boolean
Owner
unicode
Modified
datetime
StorageClass
unicode
Md5
unicode
my-example-bucket Product_A.txt 25 NULL owner@account 2017-10-27T08:04:58-0400 STANDARD md5 my-example-bucket Product_B.txt 25 NULL owner@account 2017-10-27T08:04:58-0400 STANDARD md5 my-example-bucket Product_C.txt 25 NULL owner@account 2017-10-27T08:04:58-0400 STANDARD md5 my-example-bucket Product_D.txt 25 NULL owner@account 2017-10-27T08:04:58-0400 STANDARD md5 - On the Google Cloud Storage Get node, select the (fromField) variant of the Bucket property and type the name of the input field that contains the Google Cloud Storage bucket name, in this case
Bucket
. - Select the (from Field) variant of the Object property, then specify the name of the input field that references the files that you want to download, in this case
Object
. - In the Directory property, specify where to store the downloaded files, e.g.
C:\Users\<username>\Documents\Google Cloud Storage download
. - Run the Google Cloud Storage Get node to download the files from Google Cloud Storage.
Properties
Bucket
Specify the name of the Google Cloud Storage Bucket. Choose the (from Field) variant of this property to look up the value from an input field with the name specified.
A value is required for this property.
Object
Specify the name of the Google Cloud Storage Object. Choose the (from Field) variant of this property to look up the value from an input field with the name specified.
A value is required for this property.
Credentials
Optionally specify the file containing the Google Cloud Storage credentials. If the Credentials are not set then the Google Cloud Storage default strategy will be used.
Directory
Specify the location of a directory as the root to store all retrieved objects. A value is required for this property.
FileName
Optionally specify the location of the file to store the retrieved object. Choose the (from Field) variant of this property to look up the value from an input field with the name specified.
The default value is the name of the object.
FailureBehavior
Optionally specify what to do when a file fails to download. Choose from:
- Error - Report error and stop further processing.
- Log - Log a warning message and skip the file.
- Ignore - Skip the file.
The default value is Log.
Inputs and outputs
Inputs: 1 optional.
Outputs: downloaded files, errors.