Google Cloud Storage Integration

Number of APIs: 3

Introduction

This collection is intended to create buckets and upload files to buckets on the Google Cloud Storage platform.

Prerequisites

This collection requires that you have Google OAuth2 set up for your project ([learn more about Google OAuth2 here]

Automation

To automate retrieval of the OAuth2 token, here are some resources that will allow you to create this functionality: - [ - https://allenheltondev.medium.com/how-to-automate-oauth2-token-renewal-in-Qodex-864420d381a0

Forking Collections

In order to use this integration, you will need to fork this collection. You can do this by left clicking on a collection and pressing create a fork. You will also need to fork the environment named Google Cloud Storage ([learn more about forking collections and environments here]

Monitors

In the integration, a monitor is used to automatically check to update the changes made to a collection once a day.

In order to make this monitor, input the desired Monitor Name, select the Google Cloud Storage Integration collection as the Collection. Select the Google Cloud Storage environment as the environment and select how often you want it to be run to check if your collection has been updated (we recommend once a day). Then, your monitor should be created ([learn more about creating a monitor here]

Mocks

If you would like to see example responses and run and interact with the collection without having to input valid credentials, you will need to create a mock server. You can do this by left clicking on your forked version of this integration and selecting Mock Collection ([learn more about creating a mock server here]

Then you will also need to fork the [MOCK] Google Cloud Storage environment. Copy the mock server url and assign it to the environment variable mockUrl. If you run the collection with the mock environment selected, it will show you what a successful request looks so long as you fill out the environment variables with the correct variable type.

Workflow Diagram

Workflow Diagram

Environment Setup

To use this collection, the following environment variables must be defined:

KeyDescription
clientIdYour OAuth2 client ID (learn more about creating a client ID and client secret here)
clientSecretYour OAuth2 client secret (learn more about creating a client ID and client secret here)
projectIdYour project ID (learn more about creating and managing projects here)
apiKeyYour Google Cloud API key (learn more about creating a Google Cloud API key here)
bucketNameThe name of the bucket you would like to create or upload files to
fileNameThe name you would like your uploaded file to have
  1. Get Buckets GET {{baseUrl}}/storage/v1/b/{{bucketName}}?project={{projectId}}&key={{apiKey}}

  2. Create Bucket POST {{baseUrl}}/storage/v1/b?project={{projectId}}&key={{apiKey}}

  3. Upload Object POST {{baseUrl}}/upload/storage/v1/b/{{bucketName}}/o?name={{fileName}}&uploadType=media