Usage of Catalog Ingestion APIs
Introduction
In this tutorial we will be using the catalog metadata ingestion APIs to add additional metadata for the software components in the catalog, display them in the component overview page using additional info card.
Pre-requisites
- You must have components registered in your software catalog. If you don't have any components registered, follow this tutorial to register one. We recommend you to register this software component for this tutorial.
Add a new metadata
- Now using the following cURL command add a new metadata
onShoreTeamLead
to theboutique-service
component.
curl \
--location 'https://app.harness.io/gateway/v1/catalog/custom-properties/entity' \
--header 'Harness-Account: ADD_YOUR_ACCOUNT_ID' \
--header 'Content-Type: application/json' \
--header 'x-api-key: ADD_YOUR_API_KEY' \
--data '{
"entity_ref": "boutique-service",
"property": "metadata.additionalInfo.onShoreTeamLead",
"value": "John Doe"
}'
- Additional Info Card
In case you want to display the same information you have ingested on your Overview page as an additional card, follow the steps below.
- Go to the Layout Page and under Admin and add the following for Services and Save it.
- component: EntityAdditionalInfoCard
specs:
props:
title: Additional Info Card
items:
- label: On-Shore Team Lead
value: <+metadata.additionalInfo.onShoreTeamLead>
type: string
style:
bold: true
- label: Off-Shore Team Lead
value: <+metadata.additionalInfo.offShoreTeamLead>
type: string
style:
bold: true
gridProps:
md: 6
We had already added the offShoreTeamLead
in the catalog-info.yaml
as we have recommended above under the pre-requisites, if you haven't used the same, you'll get a data not found error for the field.
- Now go to the FoodService Software Component in the Catalog and you'll find an additional info card populated with information we ingested using the API above. You can read more about additional info card
Conclusion
Using the Catalog Metadata Ingestion API, you can source information into your catalog from internal systems such as cost trackers, service health checkers, security scans, or even from simple spreadsheets tracking personnel details and use them to just display the information to users as wells as use them as an input for workflows.
Check out other examples of the Catalog Ingestion API.