Remove an API Gateway connection from API hub

This page describes how to remove an API Gateway connection from API hub.

Overview

To remove an API Gateway connection from API hub, do one of the following:

Remove API Gateway assets from API hub without detaching the runtime project

Remove API Gateway assets from API hub without detaching the runtime project as described below.

Google Cloud console

To remove API Gateway assets from the runtime project association settings, do the following:

  1. In the Google Cloud console, select your host project.
  2. Go to the API hub page.

    Go to API hub

  3. Click Settings from the left navigation menu to open the Settings page.
  4. Go to the Project associations tab.
  5. Click Edit settings associated with the API Gateway project.
  6. In the Project association settings pane, deselect API Gateway Plugin and any other API assets you want to automatically import.
  7. Click Save.

REST

To remove API Gateway assets from the runtime project, use the delete plugin instance API.

For example:

curl "https://apihub.googleapis.com/v1/projects/HUB_PROJECT_ID/locations/HUB_LOCATION/plugins/PLUGIN_TYPE/instances/PLUGIN_INSTANCE_ID" \
  -X DELETE \
  -H "Authorization: Bearer $(gcloud auth print-access-token)"

Replace the following:

  • HUB_PROJECT_ID: The name of your API hub host project. The host project was selected when API hub was provisioned.
  • HUB_LOCATION: The location of the host project. The location was chosen when API hub was provisioned.
  • PLUGIN_TYPE: Type of plugin. Set to system-api-gateway.
  • PLUGIN_INSTANCE_ID: ID of the API Gateway plugin instance. Use the list plugin instances API to get the plugin instance ID.

If successful, an Operation JSON object is returned.

Detach the API Gateway project from API hub

Detach the runtime project from API hub as described below.

Google Cloud console

To detach the API Gateway project from API hub, do the following:

  1. In the Google Cloud console, select your host project.
  2. Go to the API hub page.

    Go to API hub

  3. Click Settings from the left navigation menu to open the Settings page.
  4. Go to the Project associations tab.
  5. Click Detach runtime project associated with the API Gateway project.
  6. Click Confirm.

REST

To detach the runtime project from API hub, use the delete runtime project attachments API.

For example:

curl 'https://apihub.googleapis.com/v1/projects/HUB_PROJECT_ID/locations/HUB_LOCATION/runtimeProjectAttachments/RUNTIME_PROJECT_ID' \
  -X DELETE \
  -H "Authorization: Bearer $(gcloud auth print-access-token)"

Replace the following:

  • HUB_PROJECT: The name of your API hub host project. The host project was selected when API hub was provisioned.
  • HUB_LOCATION: The location of the host project. The location was chosen when API hub was provisioned.
  • RUNTIME_PROJECT_ID: ID of the runtime project. Use the list runtime project attachments API to get the runtime project ID.

If successful, an empty JSON object is returned.