Overview
Sources
Libraries
Images API

Google Cloud Storage Sources

Sources of type Google Cloud Storage allows imglab to access resources on a specific bucket on your Google Cloud Storage account.

To explore how Images API URLs are used for Google Cloud Storage Sources please take a look to the serving images documentation section.

To generate a Google Cloud Storage source follow these steps:

  1. On imglab go to Sources section and click on Add Source.
  2. Set a valid Name.
  3. On Security section select if the source will use secured requests or not.
  4. On Type section select Google Cloud Storage type.

Google Cloud Storage Source Settings

Under Google Cloud Storage Settings you will see some attributes specific to this type of source:

  • Bucket (required): the name of your bucket on Google Cloud Storage.
  • Service Account Key (required): a JSON Service Account Key with permissions to access the bucket and its objects (please follow the section How to generate a Service Account Key for further instructions).
  • Prefix (optional): a path prefix that will be added to access objects in the bucket, useful if you want to scope the source to a specific prefix in the bucket.

Once you have set all the necessary values you can click on Create Source to finish the creation of your Google Cloud Storage Source.

How to generate a Service Account Key

Once you have your Google Cloud Storage bucket up and working you need to generate a valid Service Account Key to be used with imglab.

Create a Service Account

The first step is to create a valid Service Account with access to your Google Cloud Storage bucket. Please follow these steps:

  1. On Google Cloud Platform go to IAM & Admin -> Service Accounts section.
  2. Click on Create Service Account.
  3. Assign a name and click on Create and Continue.
  4. Assign the role Storage Object Viewer.
  5. Click on Add condition, set Condition Type to be Name, Operator to Starts with and value to projects/_/buckets/your-bucket-name (replace your-bucket-name with your actual bucket name).
  6. Click on Continue once the role and condition are successfully assigned.
  7. Click on Done.

Generate a Service Account Key

After finishing the creation of the Service Account we will focus into generating a JSON key for it.

  1. On Google Cloud Platform go to IAM & Admin -> Service Accounts section.
  2. Click on the Service Account created in the previous section.
  3. Once inside the Service Account details click on the Keys section.
  4. Click on Add Key -> Create new key.
  5. Set Key type to JSON and click on Create. A JSON file will be downloaded to your computer.
  6. Copy and paste the content of that file into the Service Account Key input form on imglab.

How to use Google Cloud Storage with Interoperability API

If you prefer to use Google Cloud Storage with Interoperability API on imglab instead of Service Account Keys you can follow these steps:

  1. Create a new source on imglab with the type S3 instead of Google Cloud Storage.
  2. Set Bucket to the name of your Google Cloud Storage bucket.
  3. Set Region value to auto.
  4. Set the Access Key ID and Secret Access Key values generated from the Interoperability settings page of your Google Cloud Storage account.
  5. Set the optional value Endpoint to use https://storage.googleapis.com