Each of the API commands described here relate to retrieving and updating one or more Azure Resource Groups being monitored at your site. Each Azure Resource Group is completely described by a Hash.
An example JSON-encoded Azure Resource Group Hash is shown below:
{
"id":1, # Azure resource ID (Assigned by Uptime Cloud Monitor)
"azure_subscription_id": 10, # Azure subscription ID (Assigned by Uptime Cloud Monitor)
"azure_account_id": 4, # Azure account ID (Assigned by Uptime Cloud Monitor)
"name":"dummy_name", # Name of the Azure Resource Group
"location":"dummy_location", # Location of the resource group
"reading_enabled":true, # If monitoring is enabled for the resource group
"attrs":{...}, # Attributes related to this azure resource group
"unique_id":"/subscriptions/sub_id/resourceGroups/rg_id" # A unique identifier for the resource group
}
Retrieve a list of all of your Azure Resource Groups for an Azure Subscription with their resources.
curl -su <APIKEY>:U https://api.copperegg.com/v2/azure/accounts/<Azure_Account_ID>/subscriptions/<Azure_Subscription_ID>/resource_groups.json
curl -s https://<APIKEY>:U@api.copperegg.com/v2/azure/accounts/<Azure_Account_ID>/subscriptions/<Azure_Subscription_ID>/resource_groups.json
Response is a JSON-encoded list of Azure Resource Group Hashes and stats(contains total no of resource groups for the subscription).
{
"resource_groups":[
{
"id":1,
"azure_subscription_id":10,
"azure_account_id": 4,
"name":"dummy_name",
"unique_id":"/subscriptions/sub_id/resourceGroups/dummy_rg_id",
"location":"dummy_location",
"reading_enabled":true,
"attrs":{...},
"resources":[
{...}
]
}
],
"stats":{
"total":1
}
}
curl -s -XPUT -H "Content-Type: application/json" https://<APIKEY>:U@api.copperegg.com/v2/azure/accounts/<Azure_Account_ID>/subscriptions/<Azure_Subscription_ID>/resource_groups/<Azure_Resource_Group_ID>.json -d '{ "reading_enabled":"false" }'
{
"id":1,
"azure_subscription_id":10,
"azure_account_id": 4,
"name":"dummy_name",
"unique_id":"/subscriptions/sub_id/resourceGroups/rg_id",
"location":"dummy_location",
"reading_enabled":false,
"attrs":{...}
}