Lumen help

Exploring the Tanzu Mission Control API

To view setup steps for the VMware Tanzu Mission Control API:

                export CSP_TOKEN="<insert_token_here>"
            
                export ACCESS_TOKEN=$(curl -s -X POST https://console.cloud.vmware.com/csp/gateway/am/api/auth/api-tokens/authorize\?refresh_token\=$CSP_TOKEN | jq -r '.access_token')
            
                curl -s -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" "https://<YOUR_ORG>.tmc.cloud.vmware.com/v1alpha1/clusters" | jq
            

                #!/bin/sh
 
# Get your refresh token from console.cloud.vmware.com
API_TOKEN="<YOUR_API_TOKEN>"
  
# Your API endpoint, if you are logged into the TMC UI it is the URL shown in your browser
API_ENDPOINT=https://<YOUR_ORG>.tmc.cloud.vmware.com
  
# Find the CSP endpoint
CSP_ENDPOINT=https://console.cloud.vmware.com
  
# Aquire access token from CSP
CSP_ACCESS_TOKEN=$(curl -sSX POST ${CSP_ENDPOINT}/csp/gateway/am/api/auth/api-tokens/authorize\?refresh_token\=${API_TOKEN} | jq -r .access_token)
 
# verify the token is working by listing all attached clusters
 
echo List of cluster groups
curl -sSX GET -H "Authorization: Bearer ${CSP_ACCESS_TOKEN}" ${API_ENDPOINT}/v1alpha1/clustergroups?searchScope.name=* | jq -r .clusterGroups[].fullName.name
echo
 
echo List of clusters
curl -sSX GET -H "Authorization: Bearer ${CSP_ACCESS_TOKEN}" ${API_ENDPOINT}/v1alpha1/clusters | jq -r .clusters[].fullName.name
echo
 
# Find name of first cluster
cluster_full_name=`curl -sSX GET -H "Authorization: Bearer ${CSP_ACCESS_TOKEN}" ${API_ENDPOINT}/v1alpha1/clusters | jq -r .clusters[0].fullName`
echo First cluster is: $cluster_full_name
echo
 
cluster_name=$(echo $cluster_full_name | jq -r .name)
cluster_management_cluster_name=$(echo $cluster_full_name | jq -r .managementClusterName)
cluster_provisioner_name=$(echo $cluster_full_name | jq -r .provisionerName)
 
# Show details of first cluster
curl -sSX GET -H "Authorization: Bearer ${CSP_ACCESS_TOKEN}" "${API_ENDPOINT}/v1alpha1/clusters/${cluster_name}?full_name.managementClusterName=${cluster_management_cluster_name}&full_name.provisionerName=${cluster_provisioner_name}" | jq .
echo
 
# Show IAM policies for first cluster
curl -sSX GET -H "Authorization: Bearer ${CSP_ACCESS_TOKEN}" "${API_ENDPOINT}/v1alpha1/clusters:iam/${cluster_name}?full_name.managementClusterName=${cluster_management_cluster_name}&full_name.provisionerName=${cluster_provisioner_name}" | jq .