Google Cloud
Upload to GCS from variable
Overview
This BLOCK uploads the contents of a variable as a file to GCS.
It converts the contents of the variable according to its file format property. The six available formats are as follows:
File format | Explanation |
---|---|
(none) |
Writes the contents of the variable as is to the file. The variable must contain a STRING, otherwise the BLOCK will fail. |
YAML |
Converts the contents of the variable to YAML and writes it to the file. |
JSON |
Converts the contents of the variable to JSON and writes it to the file. |
CSV |
Converts the contents of the file to CSV and writes it to the file.
The following example shows how to use the Construct object BLOCK to prepare an array of objects. (Click image to enlarge) Processing the Upload to GCS from variable BLOCK with a variable containing this data will write the following CSV file to GCS (Note: the input variable property would be set to Col1,Col2,Col3 abc,123,1.23 xyz,456,4.56 |
Newline delimited JSON |
Converts the contents of the variable to newline delimited JSON and writes it to the file.
|
Binary (Base64) |
Assuming the variable contains a Base64 encoded string, the decoded string will be written to the file. The variable must contain string data, otherwise the BLOCK will fail. |
Properties
Property | Explanation |
---|---|
BLOCK name |
Configure the name displayed on this BLOCK. |
GCP service account |
Select the GCP service account to use with this BLOCK. |
Destination GCS URL |
Designate the GCS URL that the file will be uploaded to (Example: gs://magellan-sample/sample.yaml). |
File format |
Designate the format of the file that will be uploaded. The contents of the variable will be converted according to this setting to create the file.
Refer to the explanation in the Overview section for more details on each file format. |
BLOCK memos |
Make notes about this BLOCK. |
Input variable |
Designate the variable whose contents will be uploaded as a file to GCS. |