Google Cloud Storage Component
Manage files in a Google Cloud Platform (GCP) Cloud Storage bucket
Component key: google-cloud-storageDescription
Google Cloud Storage is Google's cloud file/blob storage system. This component allows you to create, download, modify, list, and delete files stored in a Google Cloud Storage bucket.
Documentation for the Node.js client used in this component can be found at https://googleapis.dev/nodejs/storage/latest.
A common integration pattern involves listing files in a file store, and performing a series of actions on the array of files that are returned. See our looping over files quickstart for information about how to create a loop over an array of files.
Connections
Google OAuth 2.0
Google Cloud Storage Private Key
The Google Cloud Storage component requires a username / private key pair for authentication. To create a GCP service account, follow directions on https://cloud.google.com/docs/authentication/getting-started.
Be sure to assign the user you just created with the correct permissions. To access Google Cloud Storage resources, you will need to assign either a resource specific permission, or the Cloud Storage Admin role. After creating a service account, you will have an option to create a key for the account. If you are not greeted with this option, click on the service account you just created, and navigate to the 'keys' section. Here you can click 'Add Key' This will generate a .json file with type, project_id, and a dozen other fields. Use these fields along with your GCP Project Id to create a new connection.
Data Sources
Select Bucket
Select a Google Cloud Storage bucket from a dropdown menu | key: selectBucket | type: picklist
Actions
Complete Multipart Upload
Completes a multipart upload for a file in Google Cloud Storage | key: completeMultipartUpload
Output Example Payload
{
"data": {
"results": {
"CompleteMultipartUploadResult": {
"Location": {
"_text": "http://storage.googleapis.com/test/test-image.png"
},
"Bucket": {
"_text": "test"
},
"Key": {
"_text": "test-image"
},
"ETag": {
"_text": "\"f15d9a861dedbc078f1f53a90f9b429c-1\""
}
}
}
}
}
Copy Files
Copy a file from one Google Cloud Storage bucket to another | key: copyFile
Create Bucket
Create a new Bucket inside Google Cloud Storage | key: createBucket
Create Multipart Upload
Create a multipart upload for a file in Google Cloud Storage | key: createMultipartUpload
Output Example Payload
{
"data": {
"results": {
"InitiateMultipartUploadResult": {
"Bucket": {
"_text": "bucketName"
},
"Key": {
"_text": "your-image.png"
},
"UploadId": {
"_text": "ABPnzm5uCe3g2XLS5kkxHPDZYrE68x87DhmcnJM1kKZ8ECXTtWCtJYHATzeych__ZDfWWN8"
}
}
}
}
}
Delete Bucket
Delete an existing Bucket from the Google Cloud Storage | key: deleteBucket
Delete File
Delete a file from a Google Cloud Storage bucket | key: deleteFile
Download File
Download a file from Google Cloud Storage | key: downloadFile
Output Example Payload
{
"data": {
"type": "Buffer",
"data": [
70,
105,
108,
101,
32,
67,
111,
110,
116,
101,
110,
116,
115
]
},
"contentType": "text/plain"
}
Generate Presigned URL
Generate a presigned URL to upload a file in Google Cloud Storage | key: generatePresignedUrl
Get Bucket
Get the information and metadata of an existing Bucket from the Google Cloud Storage | key: getBucket
Get File
Get the information and metadata of a file from Google Cloud Storage | key: getFile
Output Example Payload
{
"data": {
"type": "Buffer",
"data": [
70,
105,
108,
101,
32,
67,
111,
110,
116,
101,
110,
116,
115
]
},
"contentType": "text/plain"
}
List Buckets
List buckets in a Google Cloud Storage bucket | key: listBuckets
List Files
List files in a Google Cloud Storage bucket | key: listFilesV2
Output Example Payload
{
"data": {
"files": [
"path/to/foo.yaml",
"path/to/bar.xml",
"path/to/myfile.json"
],
"pagination": {
"pageToken": "bXkvbGFzdC9wcm9jZXNzZWQvZmlsZS50eHQ=",
"maxResults": 1000,
"prefix": "path/to/"
}
}
}
Move File
Move a file from one Google Cloud Storage bucket to another | key: moveFile
Raw Request
Send raw HTTP request to Google Cloud Storage | key: rawRequest
Save File
Save a file to Google Cloud Storage | key: saveFile
File Contents can be a reference to a binary file (JavaScript Buffer
) from a previous step.
For example, if you have an HTTP Get action that pulls down a .png image, you can reference its step name to write the .png to Google Cloud Storage.
Or, File Contents can be simple text, like 'Hello World'
.
Upload Part of a Multipart Upload
Upload a part of a multipart upload to Google Cloud Storage | key: uploadPartOfAMultipartUpload
Output Example Payload
{
"data": {
"PartNumber": 1,
"ETag": "5fbd6b4faa5393f343d276457f3f7d9f"
}
}