Getting started

This page walks you through the setup steps required to use the Cloud Life Sciences API.

(If you've completed the Quickstart, you've already done some of these steps. Review this page to make sure you're ready to use the Cloud Life Sciences API).

Before you begin

  1. Sign in to your Google Account.

    If you don't already have one, sign up for a new account.

  2. In the Cloud Console, on the project selector page, select or create a Cloud project.

    Go to the project selector page

  3. Make sure that billing is enabled for your Google Cloud project. Learn how to confirm billing is enabled for your project.

  4. Enable the Cloud Life Sciences API.

    Enable the API

When you first enable the Cloud Life Sciences API for a project, a new service account for the project is automatically assigned a role (lifesciences.workflowsRunner) that enables starting and stopping Compute Engine instances inside your project.

If you later remove this default role from the relevant project service account, you might encounter errors. In particular, attempts to run pipelines using the API will result in permission errors. The API will also be unable to shut down running instances when pipelines complete and you will continue to be billed for these resources. For details on how to fix this issue, see Troubleshooting.

Set up Cloud SDK and the gcloud command-line tool

Install Cloud SDK to use the tools and libraries in Cloud Life Sciences, Compute Engine, Cloud Storage, and BigQuery. The SDK includes the gcloud, gsutil, and bq command-line tools.

  1. Download and install Cloud SDK.

  2. Initialize Cloud SDK.

  3. After you've initialized the SDK, install the Cloud Life Sciences commands:

    gcloud components update beta
    

    If you're using a Compute Engine VM with the default installation of gcloud tool, you won't be able to update the components. To enable the Cloud Life Sciences API on a Compute Engine VM, reinstall gcloud command-line tool by running the following commands:

    sudo apt-get remove google-cloud-sdk
        curl https://sdk.cloud.google.com | bash
        exec -l $SHELL
        gcloud init
    

Download credentials for API access

If you are using a code sample from the Cloud Life Sciences GitHub repository or a tool other than gcloud command-line tool that accesses the Cloud Life Sciences API directly, complete the following steps to download a client_secrets.json file for your project.

  1. Sign in to your Google Account.

    If you don't already have one, sign up for a new account.

  2. In the Cloud Console, on the project selector page, select or create a Cloud project.

    Go to the project selector page

  3. Make sure that billing is enabled for your Google Cloud project. Learn how to confirm billing is enabled for your project.

  4. Enable the Cloud Life Sciences and Cloud Storage JSON APIs.

    Enable the APIs

  5. Open the Credentials page in the API console.
  6. Click Create credentials > Oauth Client ID.
  7. Set the application type to Other and complete the form.

After creating your credentials, download the client_secret.json file by going to the Credentials page in the Cloud Console and clicking Download JSON file_download. Securely store the file in a location that only your application can access.

The first time you query the Cloud Life Sciences API you will be authenticated using the values in the client secrets file you downloaded. After this initial authentication, the Cloud Life Sciences tools save a token to use during subsequent API requests.

What's next