Map Konnect Analytics reports in Catalog
Create a Catalog service and associate it with your Konnect Analytics resources to visualize Analytics Reports.
Prerequisites
Kong Konnect
If you don’t have a Konnect account, you can get started quickly with our onboarding wizard.
- The following Konnect items are required to complete this tutorial:
    - Personal access token (PAT): Create a new personal access token by opening the Konnect PAT page and selecting Generate Token.
 
- 
    Set the personal access token as an environment variable: export KONNECT_TOKEN='YOUR KONNECT TOKEN'Copied!
Konnect Analytics reports
You’ll need a Konnect Analytics report to ingest in Catalog as resources.
Create a service in Catalog
In this tutorial, you’ll map Reports from Konnect Analytics to a service in Catalog. Because the Konnect Analytics integration is built-in, you don’t need to install or authorize it like other Catalog integrations.
Create a service that you’ll map to your Konnect Analytics resources:
 curl -X POST "https://us.api.konghq.com/v1/catalog-services" \
     -H "Authorization: Bearer $KONNECT_TOKEN" \
     --json '{
       "name": "billing",
       "display_name": "Billing Service"
     }'
Export the Catalog service ID:
export SERVICE_ID='YOUR-SERVICE-ID'
List Konnect Analytics resources
Before you can map a resource to Catalog, you first need to find the resources that are pulled in from Konnect Analytics:
 curl -X GET "https://us.api.konghq.com/v1/resources?filter%5Bintegration.name%5D=analytics" \
     -H "Authorization: Bearer $KONNECT_TOKEN"
Export the resource ID you want to map to the service:
export ANALYTICS_RESOURCE_ID='YOUR-RESOURCE-ID'
Map resources to a Catalog service
Now, you can map the Konnect Analytics resource to the service:
 curl -X POST "https://us.api.konghq.com/v1/resource-mappings" \
     -H "Authorization: Bearer $KONNECT_TOKEN" \
     --json '{
       "service": "'$SERVICE_ID'",
       "resource": "'$ANALYTICS_RESOURCE_ID'"
     }'
Validate the mapping
To confirm that the Konnect Analytics resource is now mapped to the intended service, list the service’s mapped resources:
 curl -X GET "https://global.api.konghq.com/v1/catalog-services/$SERVICE_ID/resources" \
     -H "Authorization: Bearer $KONNECT_TOKEN"