This page applies to Apigee and Apigee hybrid.
When you register an API with API hub, you create and store an entity that represents the API. We call this entity an API resource. API resources stored in API hub are searchable and provide detailed operational and descriptive information about the API. Either at the time you register an API or afterwards, you can add and edit API resource attributes to build a rich description of the API.
Console
To register an API:
In the Google Cloud console, go to the APIs page in API hub.
Go to API hub- Click Register API.
Under General details, optionally specify a unique ID for the API. If you do not supply an ID, the system will generate one for you. If you wish to enter an ID, click Specify Unique ID.
- (Required) Provide a display name for the API resource.
- Optionally add additional attributes that describe the API. You can return to the API at any time
to add or change API attributes. See Edit an API resource.
- Owner information: (Optional) The name and email address of the API owner.
- Additional details: (Optional) Specify attributes to help define your API and make it more easily searchable. You can define default values for some of these attributes in Settings. For details, see Manage attributes.
- User defined attributes: (Optional) These are attributes that you define in Settings. For details, see Manage attributes.
- Click Register.
REST
To register an API, use the Create API REST API.
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" -d '{
"display_name": "DISPLAY_NAME", # Required attribute
"description": "DESCRIPTION" # description is an optional attribute
}
'https://apihub.googleapis.com/v1/projects/HUB_PROJECT/locations/HUB_LOCATION/apis?api_id=API_IDReplace 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.
- API_ID: (Optional) Enter a unique ID for the API. If you do not supply this query parameter, the system will generate a unique ID for you.
- DISPLAY_NAME: (Required) The display name of the API resource. You can use any name you wish.
- DESCRIPTION: (Optional) You can add a number of optional attributes to describe the API resource, including a description, an owner, a link to the API documentation, and more. These optional attributes are listed and described in the API resource definition.
What's next
- Learn how to View API resource insights.
- Learn how to Manage API versions.
- Learn about API insights in API hub.