This page applies to Apigeeand Apigee hybrid.
API hub provides built-in plugins to connect and ingest API data from supported Google Cloud services into API hub. These plugins use an on-ramp model , where you don't need to create any plugins or plugin instances manually in API hub. Instead, you attach a Google Cloud runtime project to your API hub instance, and API hub automatically creates the required plugin instances for all supported services found in that project.
Supported Google Cloud plugins
The following table lists the currently supported Google Cloud plugins, and the ingested API data.
| Plugin | API data ingested |
|---|---|
| Apigee and Apigee hybrid | Proxy name, environment, organization, and deployment details. |
| API Gateway | API Gateway APIs including gateway definitions and managed service endpoints. |
Attach a runtime project to API hub
Attaching a runtime project to API hub establishes a project association between the Google Cloud runtime project and your API hub instance (host project). This association enables API hub to automatically ingest API data from the project and keep them synchronized.
Before you begin
Apigee/Apigee hybrid
To attach an Apigee or Apigee hybrid runtime project to API hub, ensure the following:
- Ensure that the data residency status (enabled or disabled) of the attached Apigee runtime project matches the data residency status of the Apigee organization associated with your API hub instance.
- Grant the Cloud API hub Runtime Project Attachment Editor (
roles/apihub.runTimeProjectAttachmentsEditor) IAM role to your principal account. - Ensure that the API proxy is deployed to an environment in the Apigee runtime project.
- Ensure that the OpenAPI specification is included as a resource in the API proxy.
API Gateway
To attach an API Gateway runtime project to API hub, ensure the following:
- Ensure that the APIs are active and deployed in the API Gateway runtime project.
- Grant the Cloud API hub Runtime Project Attachment Editor (
roles/apihub.runTimeProjectAttachmentsEditor) IAM role to your principal account. - Grant the Browser
(
roles/browser) role to your principal account.
Console
To attach an runtime project to API hub, do the following steps:
- In the Google Cloud console, go to the API hub page.
- Click Settings from the left navigation menu to open the Settings page.
- Go to the Project associations tab and click Attach runtime project . This displays the Select a resource pane.
- Click the Google Cloud project where your runtime is provisioned.
- In the Project association settings
pane, do the following:
- To ingest Apigee or Apigee hybrid API data, select Apigee X and Hybrid .
- To ingest Application Integration API data, select Application Integration .
- To ingest API Gateway API data, select API Gateway .
- To attach the runtime project to API hub without importing assets, clear all of the Assets to automatically import checkboxes.
- Click Attach .
REST
To attach a runtime project to API hub, use the create
method.
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" -d '{ "runtime_project": " RUNTIME_PROJECT_ID " }' "https://apihub.googleapis.com/v1/projects/ HUB_PROJECT_ID /locations/ LOCATION /runtimeProjectAttachments?runtime_project_attachment_id= RUNTIME_PROJECT_ID "
Replace the following:
- HUB_PROJECT_ID : The project ID of your API hub host project.
- LOCATION : The location of your API hub host project.
- RUNTIME_PROJECT_ID : The Google Cloud project name or ID that you want to attach to API hub.
Edit project association settings
You can edit the project association settings to update the API assets that are ingested into API hub.
Console
To edit the project association settings, do the following steps:
- In the Google Cloud console, go to the API hub page.
- Click Settings from the left navigation menu to open the Settings page.
- Go to the Project associations tab to view the list of attached projects.
- Click Edit settings for the desired project.
- In the Project association settings pane, edit the API assets to automatically import checkbox selection.
- Click Save to apply your changes.
Detach a runtime project from API hub
Console
To detach a runtime project from API hub, do the following steps:
- In the Google Cloud console, go to the API hub page.
- Click Settings from the left navigation menu to open the Settings page.
- Go to the Project associations tab to view the list of attached projects.
- Click Detach project for the project you want to detach.
REST
To detach a runtime project from API hub, use the delete
method.
curl -X DELETE -H "Authorization: Bearer $(gcloud auth print-access-token)" "https://apihub.googleapis.com/v1/projects/ HUB_PROJECT_ID /locations/ LOCATION /runtimeProjectAttachments/ RUNTIME_PROJECT_ID "
Replace the following:
- HUB_PROJECT_ID : The project ID of your API hub host project.
- LOCATION : The location of your API hub host project.
- RUNTIME_PROJECT_ID : The Google Cloud project name or ID that you want to detach from API hub.

