Ingesting services using the FireHydrant API
With a populated Service Catalog, you have details on all of your services stored in a central location. You can import services into your FireHydrant service catalog manually; you can also ingest them using FireHydrant's API.
Creating bot tokens for API service ingestion
To access the FireHydrant API, you must authenticate with a bot token. (You must have owner permissions on your organization to see bot tokens.) Bot users allow you to interact with the FireHydrant API by using token-based authentication. To create bot tokens, log in to your organization and refer to the Bot users page.
Every request to the API is authenticated unless specified otherwise.
After creating your bot token, you can set up service ingestion with the API.
To get started:
- In the FireHydrant left nav, expand Service Catalog. From the subsections, select Services. This opens a list of your existing services.
- Click Catalog Settings, then Create catalog setting.
- Enter a name and description of the service.
- In the Provider field, choose API Only.
- In the format field, select the format of the .yaml file (Backstage or OpsLevel) you want to send with your cURL request.
- Click Create setting.
- Next, you are returned to the Catalog settings page. The catalog you just added will appear in the list on this page. Click the name of your new catalog; this returns you to the Edit catalog settings page. for the API endpoint where you can post your data.
Example cURL request
You can base your cURL request for service ingestion on the following example. Note that this example is using a Backstage Component definition. To send OpsLevel, be sure to change your request format accordingly.
curl --location --request POST 'https://api.firehydrant.io/v1/catalogs/<CATALOG ID>/ingest' \
--header 'Authorization: Bearer <YOUR BEARER TOKEN>' \
--header 'Content-Type: application/json' \
"name": "Component Service",
"description": "I am a Backstage service component",
"title": "Admin Dashboard",