Manage API observations in API hub

This page applies to Apigee and Apigee hybrid.

This page describes how to view, analyze, and stop collecting API observations and API operations data in API hub

Before you begin

To manage API observations in API hub, make sure that you have the required IAM roles and permissions. For more information, see IAM roles and permissions.

View discovered API observations in API hub

You can view or list all the discovered API observations using the Google Cloud console or the APIM API.

Console

To view discovered API observations, do the following:

  1. In the Google Cloud console, go to the API hub page.

    Go to API hub

  2. Click API observations from the left navigation menu to open the API observations page.
  3. The API observations page displays all the discovered API observations in your API ecosystem.

REST

To list all the discovered API observations using the DiscoveredApiObservations API, use the following API call:

curl -X GET \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://apihub.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/discoveredApiObservations"

Replace the following:

  • PROJECT_ID: The name of your API hub host project. The host project was selected when API hub was provisioned.
  • LOCATION: The location of the host project. The location was chosen when API hub was provisioned.

Analyze discovered API observations in API hub

You can analyze a specific discovered API observation to examine the individual API operations and associated metadata of the observation.

Console

To analyze a specific discovered API observation, do the following:

  1. In the Google Cloud console, go to the API hub page.

    Go to API hub

  2. Click API observations from the left navigation menu to open the API observations page.
  3. Click the Host name of the discovered API observation that you want to analyze.

    The observation details page appears displaying the associated API metadata and API operations collected by API hub.

API operation details

The API operation details section displays the following information:

  • Path: the HTTP request path for the API operation.
  • Method: the HTTP request method string.
  • Count: the total number of times API observations in API hub observed this operation.
  • Observation: indicates if the API is Known or Unknown. You can click the observation to view its complete resource definition in API hub.
  • Transaction Request: lists the key value pairs of the request headers and their count.
  • Transaction Response Headers: lists the key value pairs of response headers and their count.
  • Transaction Response Codes: lists the key value pairs of response codes and their count.
  • First Seen: the timestamp when the API operation was first observed.
  • Last Seen: The timestamp when this API operation was last .

REST

To analyze a specific discovered API observation, do the following:

  • To retrieve detailed information for a specific discovered API observation, use the following API call:
        curl -X GET \
          -H "Authorization: Bearer $(gcloud auth print-access-token)" \
        "https://apihub.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/discoveredApiObservations/OBSERVATION_ID
        

    Replace the following:

    • PROJECT_ID: The name of your API hub host project. The host project was selected when API hub was provisioned.
    • LOCATION: The location of the host project. The location was chosen when API hub was provisioned.
    • OBSERVATION_ID: The ID of the discovered API observation.
  • To retrieve a list of all the API operations in a specific discovered API observation, use the following API call:
          curl -X GET \
            -H "Authorization: Bearer $(gcloud auth print-access-token)" \
          "https://apihub.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/discoveredApiObservations/OBSERVATION_ID/discoveredApiOperations"
          

    Replace the following:

    • PROJECT_ID: The name of your API hub host project. The host project was selected when API hub was provisioned.
    • LOCATION: The location of the host project. The location was chosen when API hub was provisioned.
    • OBSERVATION_ID: The ID of the discovered API observation.
  • To retrieve detailed information for a specific API operation, use the following API call:
          curl -X GET \
            -H "Authorization: Bearer $(gcloud auth print-access-token)" \
          "https://apihub.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/discoveredApiObservations/OBSERVATION_ID/discoveredApiOperations/OPERATION_ID"
          

    Replace the following:

    • PROJECT_ID: The name of your API hub host project. The host project was selected when API hub was provisioned.
    • LOCATION: The location of the host project. The location was chosen when API hub was provisioned.
    • OBSERVATION_ID: The ID of the discovered API observation.
    • OPERATION_ID: The ID of the API operation.

Stop collecting API observations in API hub

Stopping the collection of API observations in API hub temporarily stops the ingestion of new data. This operation doesn't delete the existing data that is already ingested in API hub. You can stop collecting API observations data in API hub using any of the following methods:

  • Detach runtime project from API hub.
  • Edit project association settings to deselect the Apigee API Observation import configuration.
  • Delete the associated plugin instance from API hub.

Considerations

The following considerations apply when managing API observation data in API hub:

  • When you stop collecting API observations in API hub, the data that has already been collected is not deleted.