How to find the Product Slug for Tanzu Products using PivNet API
search cancel

How to find the Product Slug for Tanzu Products using PivNet API

book

Article ID: 403470

calendar_today

Updated On:

Products

VMware Tanzu Data Services VMware Tanzu for Postgres

Issue/Introduction

This article describes how to find the product slug for Tanzu product using PivNet API. Product slugs are used when programmatically interacting with PivNet APIs for downloading releases, automating deployments or integrating with CI/CD pipelines.

Resolution

Prerequisite: We can browse to https://support.broadcom.com/group/ecx/tanzu-token to get our $API_TOKEN value. Specifically, we need the Legacy API Token as seen in the screenshot below: 

1. Take note of the Token, and export it: 

export API_TOKEN="yourtokengoeshere"

 

2. We can curl the PivNet API to get a list of all products and corresponding product slugs. Note that the $API_TOKEN value is the token we grabbed from the Prerequisite step above. 

curl -L -H "Authorization: Token $API_TOKEN" "https://network.tanzu.vmware.com/api/v2/products" | jq '.products[] | {slug, name}'

 

3. As an example, say we want to find the product slug for the Postgres. We can grep for the string "postgres" in the products.json file that we generated from step 2. As seen in the image below, we see that the product slug that corresponds to Postgres.