-
Notifications
You must be signed in to change notification settings - Fork 33
/
arm_api.azcli
17 lines (15 loc) · 918 Bytes
/
arm_api.azcli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# How to measure the remaining operations before throttling in the ARM API
# Variables
subscription_id=$(az account show --query id -o tsv)
testrg=blahblah123
# Writes
remaining_writes=$(az rest --method PUT --uri "/subscriptions/${subscription_id}/resourcegroups/${testrg}?api-version=2021-04-01" --body '{"location": "westeurope"}' --debug 2>&1 | grep remaining | cut -d"'" -f 4)
# Reads
remaining_reads=$(az rest --method GET --uri "/subscriptions/${subscription_id}/resourcegroups/${testrg}?api-version=2021-04-01" --debug 2>&1 | grep remaining | cut -d"'" -f 4)
# Deletes
remaining_deletes=$(az rest --method DELETE --uri "/subscriptions/${subscription_id}/resourcegroups/${testrg}?api-version=2021-04-01" --debug 2>&1 | grep remaining | cut -d"'" -f 4)
# Summary
echo "Remaining operations this hour:"
echo " * Writes: $remaining_writes"
echo " * Reads: $remaining_reads"
echo " * Deletes: $remaining_deletes"