We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cd429a5 commit b2e004eCopy full SHA for b2e004e
shell/download_draas_swagger_json.sh
@@ -0,0 +1,16 @@
1
+#!/bin/bash
2
+
3
+if [ ${#} -ne 1 ]; then
4
+ echo -e "Usage: \n\t$0 [REFRESH_TOKEN]\n"
5
+ exit 1
6
+fi
7
8
+REFRESH_TOKEN=$1
9
10
+CSP_URL="console.cloud.vmware.com"
11
+DRAAS_SWAGGER_URL="https://vmc.vmware.com/vmc/draas/swagger/swagger.json"
12
13
+RESULTS=$(curl -s -X POST -H "application/x-www-form-urlencoded" "https://${CSP_URL}/csp/gateway/am/api/auth/api-tokens/authorize" -d "refresh_token=${REFRESH_TOKEN}")
14
+CSP_ACCESS_TOKEN=$(echo $RESULTS | jq -r .access_token)
15
16
+curl -X GET -H "Content-Type: application/json" -H "csp-auth-token: ${CSP_ACCESS_TOKEN}" ${DRAAS_SWAGGER_URL} -o draas.json
0 commit comments