Created
July 12, 2023 22:55
-
-
Save gowatana/a9a65fa41f8cf90f53ef8ce2120e24f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Author: @gowatana | |
# Usage: | |
# 1) create ./id_and_key.txt | |
# 2) $ bash ./get_vmc-on-aws_estimated-charges.sh | |
source ./id_and_key.txt | |
# Get Access token | |
ACCESS_TOKEN=$(curl -s \ | |
--url "https://console.cloud.vmware.com/csp/gateway/am/api/auth/api-tokens/authorize" \ | |
-X POST \ | |
-H "accept: application/json" \ | |
-d "refresh_token=$API_TOKEN" \ | |
| jq -r .access_token) | |
# Get Charges | |
curl -s \ | |
--url "https://console.cloud.vmware.com/csp/gateway/commerce/api/v1/orgs/$ORG_ID/estimated-charges" \ | |
-X GET \ | |
-H "Content-Type: application/json" \ | |
-H "csp-auth-token: $ACCESS_TOKEN" \ | |
| jq -r . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
下記の投稿むけ。
VMware Cloud on AWS のコストを情報を REST API で見てみる。(curl / Ansible)
https://vm.gowatana.jp/entry/2023/07/13/084828