Created
March 7, 2023 17:47
-
-
Save raindev/73f805d5d32fe9862a03371dd99aae28 to your computer and use it in GitHub Desktop.
Retrieve cost history for the services that participate in iHAC
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 | |
set -euo pipefail | |
services=( | |
fashion-store-api | |
fjord | |
cliff | |
coast-cart-service | |
quote-service | |
coast-checkout-service | |
) | |
for service in "${services[@]}"; do | |
echo -e "\n>$service" | |
echo 'Aug' | |
curl -H "Authorization: Bearer $(ztoken)" "https://kube-cost-allocator-kube-cost-api.cloud-cost-efficiency.zalan.do/costs/applications/$service?start=01-08-2022%2000:00:00&end=31-08-2022%2023:59:59&group_by=component" | |
echo 'Sep' | |
curl -H "Authorization: Bearer $(ztoken)" "https://kube-cost-allocator-kube-cost-api.cloud-cost-efficiency.zalan.do/costs/applications/$service?start=01-09-2022%2000:00:00&end=30-09-2022%2023:59:59&group_by=component" | |
echo 'Dec' | |
curl -H "Authorization: Bearer $(ztoken)" "https://kube-cost-allocator-kube-cost-api.cloud-cost-efficiency.zalan.do/costs/applications/$service?start=01-12-2022%2000:00:00&end=31-12-2022%2023:59:59&group_by=component" | |
echo 'Jan' | |
curl -H "Authorization: Bearer $(ztoken)" "https://kube-cost-allocator-kube-cost-api.cloud-cost-efficiency.zalan.do/costs/applications/$service?start=01-01-2023%2000:00:00&end=31-01-2023%2023:59:59&group_by=component" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment