VCF Fleet LCM Service APIs

VCF Fleet LCM Service APIs
# 1. Generate VCF Operations Token
OPS_TOKEN=$(curl --request POST \
  --url https://<ops-fqdn>/suite-api/api/auth/token/acquire \
  --header "Content-Type: application/json" \
  --data '{
    "username": "admin",
    "password": "<password>"
  }' | jq --raw-output '.token')

# 2. Exchange the VCF Operations Token to get the Fleet LCM Token
FLEET_LCM_TOKEN=$(curl --request POST \
  --url https://<ops-fqdn>/suite-api/api/auth/token/exchange \
  --header 'Accept: application/json' \
  --header "Authorization: OpsToken ${OPS_TOKEN}" \
  --header 'Content-Type: application/json' \
  --data '{
    "serviceKeys": [
      "fleet-lcm"
    ]
  }' | jq --raw-output '.jwtToken')

# 3. Use the Fleet LCM Token to invoke Fleet LCM APIs
curl --request GET \
  --url https://<fleet-lifecycle-fqdn>/fleet-lcm/v1/components \
  --header "Authorization: Bearer ${FLEET_LCM_TOKEN}" | jq