Each of the API commands described here relate to retrieving and updating one or more Azure Subscriptions being monitored at your site. Each Azure Subscription is completely described by a Hash.
An example JSON-encoded Azure Subscription Hash is shown below:
{
"id":1, # Azure Subscription ID (Assigned by Uptime Cloud Monitor)
"azure_account_id":1, # Azure account id of the subscription
"unique_id":"/subscriptions/dummy_unique_id", # A unique identifier for a subscription
"name":"dummy_name", # Name of the Azure Subscription
"reading_enabled":true, # If monitoring is enabled for the subscription
"state":"dummy_state", # State of the Azure Subscription
"attrs":{...} # Attributes related to this azure subscription
}
Retrieve a list of all of your Azure Subscriptions for an Azure Account.
curl -su <APIKEY>:U https://api.copperegg.com/v2/azure/accounts/<Azure_Account_ID>/subscriptions.json
curl -s https://<APIKEY>:U@api.copperegg.com/v2/azure/accounts/<Azure_Account_ID>/subscriptions.json
Response is a JSON-encoded list of Azure Subscription Hashes and stats (contains total no of subscriptions for the account).
{
"subscriptions":[
{
"id":1,
"azure_account_id":1,
"unique_id":"dummy_unique_id",
"name":"dummy_name",
"reading_enabled":true,
"state":"dummy_state",
"attrs":{...}
}
],
"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>.json -d '{ "reading_enabled":"false" }'
{
"id":1,
"azure_account_id":1,
"unique_id":"dummy_unique_id",
"name":"dummy_name",
"reading_enabled":false,
"state":"dummy_state",
"attrs":{...}
}