Google Cloud Storage is a highly reliable and secure data storage for organizations of all sizes. DronaHQ provides you with the Google Cloud Storage connector that enables you to easily build apps while using the capabilities of the Cloud Storage to optimize response times, customize data storage, build disaster recovery plans, and so on.
Authentication Requirements: Before establishing a connection with Google Cloud Storage, ensure you have the necessary authentication credentials, including:
- Google Cloud Project ID.
- Service Account Key File: Create a Service Account on the Google Cloud Console and generate a JSON key file. This key file contains the credentials required for authentication.
Enable Google Cloud Storage API: In the Google Cloud Console, make sure that the Google Cloud API is enabled for your project. This API allows your application to interact with Google Cloud.
Service Account Access: Grant the Service Account associated with your application the necessary permissions to access Google Cloud. Assign the appropriate roles, such as
Google Cloud Useror
Google Cloud Viewer,to the Service Account.
Download and Secure Key: Download the JSON key file generated for the Service Account. Safeguard this key file as it contains essential credentials for authenticating your application's access to Google Cloud.
Configuring API Connector in DronaHQ
Account name. Then add the
Service Account JSON for the connector account. Once all details are added, click
Save. Your connector configuration is now done.
Create a Service Account as that is all that you need for your Connector. You can refer to this article here to know how to get started by creating a Service account.
After successfully configuring and saving the connector settings, you can easily access your newly connected account by navigating to the
connected accounts list. You can find this option from the
Connector -> Manage Account section. This centralized location allows you to conveniently monitor and manage your connected accounts.
Using Google Cloud Storage Connector
Retrieve Buckets and Files
Utilizing the Google Cloud Storage connector, you can easily interact with your storage resources. To retrieve information about buckets and files, follow these steps:
Include the necessary controls in your application interface, such as buttons or input fields, to trigger actions related to Google Cloud Storage.
Bind Data Option -> Quick Select -> Connector Library.
Choose the desired endpoint, such as
GetFiles, based on your requirements, and select the appropriate environment.
Configure any required parameters or inputs for the chosen endpoint. For example, if using
GetFiles, you might specify a bucket name to fetch files from that bucket.
Perform a Refresh Response to populate the response fields from the connector.
Bind the response fields to the relevant controls in your app's interface for displaying the retrieved data.
Click on Test & Finish to finalize the connector configuration.
Uploading Files to Google Cloud Storage Bucket
The Google Cloud Storage connector provides a convenient way to upload files to your storage buckets. This feature can be especially useful for scenarios such as archiving supporting documents, storing images or PDFs, or creating backups.
Set up your application interface with relevant controls, such as a dropdown for selecting the bucket name (and optionally, a folder name) and a file upload control to facilitate file uploading.
Create an action button in your app that triggers the upload process when clicked. Configure the
button_clickevent to initiate a Server-side action.
Within the Server-side action, select the Google Cloud Storage connector and choose the
UploadFileaction. Proceed by clicking
Select the connected Google Cloud Storage account associated with your application and proceed by clicking
dropdowncontrol to obtain the Bucket name from the appropriate keyword. Optionally, provide the folder name for more organized file storage.
Utilize the file upload control's name from the keyword to provide the files you intend to upload. Additionally, you can configure file permissions if required.
Add a suitable action name and specify the variable to capture the returned URL after the upload is complete.NOTE
The Media link accessibility may vary based on access rights. You can also consider using the GetPre-signed URL action for access. :::
If desired, you can display the URL in a text control for better understanding and visibility of the uploaded file's location within the selected bucket.