Getting Started with the Service Management API

Stay organized with collections Save and categorize content based on your preferences.

This page describes how to set up your development environment to work with the Service Management API. The simplest approach to using the Service Management API (other than just using the Google Cloud console web UI), and our recommendation for most operational use cases, is via the gcloud command line interface. If you need to program against the Service Management API, we recommend that you use one of our provided client libraries. To experiment with the API, you can follow the alternative setup instructions below and use the curl command to play with the API without setting up a full application development environment.

Setup using gcloud

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  3. Enable the Service Management API.

    Enable the API

  4. Install and initialize the Google Cloud CLI.
  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  6. Enable the Service Management API.

    Enable the API

  7. Install and initialize the Google Cloud CLI.

Setup to call the API directly

This section describes the basic steps necessary to set up your local environment to experiment with the Service Management API using the curl command. It is aimed at developers who need to program against the Service Management API.

Initial setup

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. Install and initialize the Google Cloud CLI.
  3. Create or select a Google Cloud project.

    • Create a Cloud project:

      gcloud projects create PROJECT_ID
    • Select the Cloud project that you created:

      gcloud config set project PROJECT_ID
  4. Enable the Service Management API:

    gcloud services enable servicemanagement.googleapis.com
  5. Grant roles to your Google Account. Run the following command once for each of the following IAM roles: roles/servicemanagement.admin

    gcloud projects add-iam-policy-binding PROJECT_ID --member="user:EMAIL_ADDRESS" --role=ROLE
    • Replace PROJECT_ID with your project ID.
    • Replace EMAIL_ADDRESS with your email address.
    • Replace ROLE with each individual role.
  6. Install and initialize the Google Cloud CLI.
  7. Create or select a Google Cloud project.

    • Create a Cloud project:

      gcloud projects create PROJECT_ID
    • Select the Cloud project that you created:

      gcloud config set project PROJECT_ID
  8. Enable the Service Management API:

    gcloud services enable servicemanagement.googleapis.com
  9. Grant roles to your Google Account. Run the following command once for each of the following IAM roles: roles/servicemanagement.admin

    gcloud projects add-iam-policy-binding PROJECT_ID --member="user:EMAIL_ADDRESS" --role=ROLE
    • Replace PROJECT_ID with your project ID.
    • Replace EMAIL_ADDRESS with your email address.
    • Replace ROLE with each individual role.

Test with curl

  1. Define a convenient shell alias for calling Google REST APIs:

    $ alias gcurl='curl -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json"'
    
  2. Try listing publicly accessible services:

    $ gcurl https://servicemanagement.googleapis.com/v1/services
    

    If you see a list of services, the setup is successful.

Next steps

If you are creating a managed service and you are not using Cloud Endpoints:

  1. Follow Creating and Deleting Services to create managed services. This will create a top level managed service resource.
  2. Follow Managing Service Configurations to submit service configurations to describe features used by the service.

  3. Follow Rolling Out Service Configurations to roll out your service configurations.