Getting Started with Google Cloud Platform

This page introduces you to Cisco Cloud Observability Connections API resources and provides instructions to make your first API request. You'll learn how to create and manage a Google Cloud Platform (GCP) connection. Examples will be shown using the command line with cURL commands.

Standard REST methods are supported on the Cisco Cloud Observability Connections API, which include POST, GET, PATCH, and DELETE operations through HTTPS. All payloads to and from the REST interface must be in JSON format.

Base URI

Every API request begins with this base URI:

https://{tenant_name}.observe.appdynamics.com/cloud/v2

1. Create a Service Account and Enable Google APIs

To start creating and managing GCP connections, you'll first need to:

  1. Create a Service Account in the Google Cloud Console
  2. Enable the Google Cloud API for Your Service

You'll need to provide the project ID, private key, and client email from the service account key file in the following steps.

2. Create a Connection

To create a connection, provide the connection display name, description, project ID, private key, and client email in the following request.

Request

curl --location -g --request POST 'https://{tenant_name}.observe.appdynamics.com/cloud/v2/connections' \
--data-raw '{
"type": "gcp",
"displayName": "<display_name>",
"description": "<description>",
"details": {
  "accessType": "service_account_key",
  "projectId": "<project_id>",
  "privateKey": "<private_key>",
  "clientEmail": "<client_email>"
}
}'

The response returns the connection id. Save this value. You'll need to provide it in the following steps.

Example Response

Expand
{
  "id": "d865c210-42ea-43f3-969f-a05a2c9838e5",
  "createdAt": "2023-08-02T18:31:03.925Z",
  "updatedAt": "2023-08-02T18:31:03.925Z",
  "displayName": "TestGcpConn",
  "description": "Testing GCP Connection provisioning",
  "type": "gcp",
  "state": "PENDING CONFIGURATION",
  "stateMessage": "Finish configuring your connection.",
  "details": {
      "projectId": "gcp-cloudcollectors-nprd-67766",
      "clientEmail": "cloudmon01@gcp-cloudcollectors-nprd-67766.iam.gserviceaccount.com",
      "privateKey": "*******************",
      "accessType": "service_account_key"
  },
  "configurationId": ""
}

3. Create a Configuration

To create a configuration, you'll first need to obtain a list of the supported GCP hosting regions and services that you want to monitor.

3a. Get GCP Regions

Request

Obtain the list of supported GCP hosting regions using the following request:

curl --location --request GET 'https://{tenant_name}.observe.appdynamics.com/cloud/v2/regions?type=gcp' \
--header 'Authorization: Bearer token-generated in auth step'

Example Response

Expand
  {
    "items": [
        {
            "id": "us-west1",
            "displayName": "US West (Oregon)"
        },
        {
            "id": "us-west2",
            "displayName": "US West (Los Angeles)"
        },
        {
            "id": "us-west3",
            "displayName": "US West (Salt Lake City)"
        },
        {
            "id": "us-west4",
            "displayName": "US West (Las Vegas)"
        },
        {
            "id": "us-central1",
            "displayName": "US Central (Iowa)"
        },
        {
            "id": "us-east1",
            "displayName": "US East (South Carolina)"
        },
        {
            "id": "us-east4",
            "displayName": "US East (N. Virginia)"
        },
        {
            "id": "us-east5",
            "displayName": "US East (Columbus)"
        },
        {
            "id": "us-south1",
            "displayName": "US South (Dallas)"
        },
        {
            "id": "northamerica-northeast1",
            "displayName": "North America North East (Montréal)"
        },
        {
            "id": "northamerica-northeast2",
            "displayName": "North America North East (Toronto)"
        },
        {
            "id": "southamerica-west1",
            "displayName": "South America West (Santiago)"
        },
        {
            "id": "southamerica-east1",
            "displayName": "South America East (São Paulo)"
        },
        {
            "id": "europe-west1",
            "displayName": "Europe West (Belgium)"
        },
        {
            "id": "europe-west2",
            "displayName": "Europe West (London)"
        },
        {
            "id": "europe-west3",
            "displayName": "Europe West (Frankfurt)"
        },
        {
            "id": "europe-west4",
            "displayName": "Europe West (Netherlands)"
        },
        {
            "id": "europe-west6",
            "displayName": "Europe West (Zurich)"
        },
        {
            "id": "europe-west8",
            "displayName": "Europe West (Milan)"
        },
        {
            "id": "europe-west9",
            "displayName": "Europe West (Paris)"
        },
        {
            "id": "europe-west12",
            "displayName": "Europe West (Turin)"
        },
        {
            "id": "europe-central2",
            "displayName": "Europe Central (Warsaw)"
        },
        {
            "id": "europe-north1",
            "displayName": "Europe North (Finland)"
        },
        {
            "id": "europe-southwest1",
            "displayName": "Europe South West (Madrid)"
        },
        {
            "id": "asia-south1",
            "displayName": "Asia South (Mumbai)"
        },
        {
            "id": "asia-south2",
            "displayName": "Asia South (Delhi)"
        },
        {
            "id": "asia-southeast1",
            "displayName": "Asia South East (Singapore)"
        },
        {
            "id": "asia-southeast2",
            "displayName": "Asia South East (Jakarta)"
        },
        {
            "id": "asia-east1",
            "displayName": "Asia East (Taiwan)"
        },
        {
            "id": "asia-east2",
            "displayName": "Asia East (Hong Kong)"
        },
        {
            "id": "asia-northeast1",
            "displayName": "Asia North East (Tokyo)"
        },
        {
            "id": "asia-northeast2",
            "displayName": "Asia North East (Osaka)"
        },
        {
            "id": "asia-northeast3",
            "displayName": "Asia North East (Seoul)"
        },
        {
            "id": "australia-southeast1",
            "displayName": "Australia South East (Sydney)"
        },
        {
            "id": "australia-southeast2",
            "displayName": "Australia South East (Melbourne)"
        },
        {
            "id": "me-west1",
            "displayName": "Middle East (Tel Aviv)"
        },
        {
            "id": "me-central1",
            "displayName": "Middle East (Doha)"
        }
    ]
}

3b. Get GCP Services

Request

Obtain the list of supported GCP services using the following request:

curl --location --request GET 'https://{tenant_name}.observe.appdynamics.com/cloud/v2/services?type=gcp' \
--header 'Authorization: Bearer token-generated in auth step'

Example Response

Expand
{
  "items": [
      {
          "id": "vm",
          "displayName": "Compute Engine",
          "description": "Google Cloud's flexible virtual machine offering, provides computing infrastructure in the form of predefined and customizable VMs. It's designed to accelerate cloud transformation."
      },
      {
          "id": "disk",
          "displayName": "Persistent Disk",
          "description": "Google Cloud's reliable, high-performance block storage for virtual machine instances. Enterprise scale, limitless flexibility, and competitive price for performance."
      },
      {
          "id": "pubsub",
          "displayName": "Pub Sub",
          "description": "Pub/Sub is an asynchronous and scalable messaging service that decouples services producing messages from services processing those messages. Pub/Sub allows services to communicate asynchronously, with latencies on the order of 100 milliseconds."
      },
      {
          "id": "function",
          "displayName": "Cloud Function",
          "description": "GCP Cloud Function is an event-driven, serverless computing platform provided by Google as a part of Google Cloud Platform. It is a computing service that runs code in response to events and automatically manages the computing resources required by that code."
      }
  ]
}

3c. Create a Configuration

Note: The default polling interval is 5 minutes. This interval is currently not configurable.

Create a configuration by providing the supported GCP hosting regions and services that you want to monitor in the following request.

Request

curl --location -g --request POST 'https://{tenant_name}.observe.appdynamics.com/cloud/v2/configurations' \
--header 'Content-Type: application/json' \
--data-raw '{
"displayName": "<display_name>",
"description": "<description>",
"type": "gcp",
"details": {
  "regions": [
    "<region_1>",
    "<region_2>"
  ],
  "polling": {
    "interval": <interval_number>,
    "unit": "<unit>"
  },
  "services": [
    {
      "name": "<service_name>",
      "polling": {
        "interval": <interval_number>,
        "unit": "<unit>"
      }
    }
  ]
}

The response returns the configuration id. Save this value. You'll need to provide it in the following steps.

Example Request

Expand
curl --location -g --request POST 'https://{tenantName}.observe.appdynamics.com/cloud/v2/configurations' \
--header 'Content-Type: application/json' \
--data-raw '{
"displayName": "GCP Configuration",
"description": "GCP Configuration",
"type": "gcp",
"details": {
  "regions": [
    "us-east1",
    "us-west1"
  ],
  "polling": {
    "interval": 5,
    "unit": "minute"
  },
  "services": [
    {
      "name": "vm",
      "polling": {
        "interval": 5,
        "unit": "minute"
      }
    }
  ]
}

Example Response

Expand
{
  "id": "b6718929-c4e3-4195-932d-47603e969efe",
  "type": "gcp",
  "displayName": "TestGCPConfig2",
  "description": "",
  "details": {
      "polling": {
          "interval": 5,
          "unit": "minute"
      },
      "services": [
          {
              "name": "vm",
              "polling": {
                  "interval": 5,
                  "unit": "minute"
              },
              "tagFilter": ""
          }
      ],
      "importTags": {
          "enabled": true,
          "excludedKeys": []
      },
      "regions": [],
      "tagFilter": ""
  },
  "createdAt": "2023-08-02T18:38:00.864Z",
  "updatedAt": "2023-08-02T18:38:00.864Z"
}

4. Update a Connection

To start data collection, you'll need to update the connection to add the configuration ID.

You can also update the following editable and immutable fields during this step:

Connection Type Field Editable? Notes
GCP Service Account Key Connection Name YES
Description YES
Project ID NO AuthN
Client Email YES AuthN
Private Key YES AuthN
Type NO

Any combination of editable fields can be given in the PATCH request.

Request

Provide the connection ID and configuration ID in the following request:

curl --location -g --request PATCH 'https://{tenant_name}.observe.appdynamics.com/cloud/v2/connections/<connection_Id>' \
--header 'Content-Type: application/json'
--data-raw '{
"displayName": "<display_name>"
"description": "<description>",
"details": {       
  "privateKey": "<private_key>",
  "clientEmail": "<client_email>" 
},
"configurationId": "<configuration_id>"
}'

Example Response

Expand
{
  "id": "d865c210-42ea-43f3-969f-a05a2c9838e5",
  "createdAt": "2023-08-02T18:31:03.925Z",
  "updatedAt": "2023-08-02T18:39:43.658Z",
  "displayName": "TestGcpConn",
  "description": "Testing GCP Connection provisioning",
  "type": "gcp",
  "state": "CONFIGURED",
  "stateMessage": "Start the connection to begin collecting data.",
  "details": {
      "projectId": "gcp-cloudcollectors-nprd-67766",
      "clientEmail": "cloudmon01@gcp-cloudcollectors-nprd-67766.iam.gserviceaccount.com",
      "privateKey": "*******************",
      "accessType": "service_account_key"
  },
  "configurationId": "b6718929-c4e3-4195-932d-47603e969efe"
}

5. List Your Connections

Next, list your connections to obtain the connection ID of a connection that you want to delete.

Request

curl --location -g --request GET 'https://{tenant_name}.observe.appdynamics.com/cloud/v2/connections'

Example Response

Expand
{
  "items": [
      {
          "id": "81593858-2c12-4775-9e77-7e5e79c9868b",
          "createdAt": "2023-07-24T17:53:06.506Z",
          "updatedAt": "2023-07-24T17:54:26.843Z",
          "displayName": "TestGcpConn",
          "description": "Testing GCP Connection provisioning",
          "type": "gcp",
          "state": "INACTIVE",
          "stateMessage": "Connection is disabled by the user.",
          "details": {
              "projectId": "gcp-cloudcollectors-nprd-67766",
              "clientEmail": "cloudmon01@gcp-cloudcollectors-nprd-67766.iam.gserviceaccount.com",
              "privateKey": "*******************",
              "accessType": "service_account_key"
          },
          "configurationId": "eee4123d-cf13-4433-ade3-50600db818ef"
      }
  ]
}

6. Delete a Connection

Use the connection id from the previous response to delete the connection using the following request.

Note: When you delete a connection, the corresponding configuration is also deleted if it is not used by any other connection.

curl --location -g --request DELETE 'https://{tenant_name}.observe.appdynamics.com/cloud/v2/connections/<connection_id>' \
--header 'Content-Type: application/json'

7. Verify that Connection is Deleted

To verify that the connection is deleted, list your connections again:

curl --location -g --request GET 'https://{tenant_name}.observe.appdynamics.com/cloud/v2/connections'

If the connection does not appear in the list of connections, it has been successfully deleted.