Each of the API commands described here relate to retrieving, adding and deleting one or more Azure Accounts being monitored at your site. Each Azure Account is completely described by a Hash.
An example JSON-encoded Azure Account Hash is shown below:
{
"id":1, # Azure Account ID (Assigned by Uptime Cloud Monitor)
"tenant_id":"dummy_tenant_id", # Azure account tenant id
"client_id":"dummy_client_id", # Azure account client id
"client_secret":"dummy_client_secret", # Azure account client secret
"label":"Azure", # Label of Azure Account to show on Uptime Cloud Monitor UI
"tags":[], # Tags associated with this Azure account
"reading_enabled":true # If account monitoring is enabled
}
Retrieve a list of all of your Azure Accounts.
curl -su <APIKEY>:U https://api.copperegg.com/v2/azure/accounts.json
curl -s https://<APIKEY>:U@api.copperegg.com/v2/azure/accounts.json
Response is a JSON-encoded list of AWS Account Hashes and stats (contains total no of accounts).
{
"accounts":[
{
"id":1,
"tenant_id":"dummy_tenant_id",
"client_id":"dummy_client_id",
"client_secret":"dummy_client_secret",
"label":"Azure",
"tags":[],
"reading_enabled":true
}
],
"stats":{
"total":1
}
}
Add a new AWS Account.
curl -s -XPOST -H "Content-Type: application/json" https://<APIKEY>:U@api.copperegg.com/v2/azure/accounts.json -d '{ "tenant_id":"<Tenant ID>","client_id":"<Client ID>","client_secret":"<Client Secret>","label":"<LABEL>","tags":["<tag1>", "<tag2>"] }'
{
"id":1,
"tenant_id":<Tenant ID>,
"client_id":<Client ID>,
"client_secret":<Client Secret>,
"label":"Azure",
"tags":["<tag1>","<tag2>"],
"reading_enabled":true
}
Update specified Azure Account Hash
*All params are same as create, required only params those need to modify.
curl -s -XPUT -H "Content-Type: application/json" https://<APIKEY>:U@api.copperegg.com/v2/azure/accounts/<Azure_Account_id>.json -d '{ "tenant_id":"<Tenant ID>","client_id":"<Client ID>","client_secret":"<Client Secret>","label":"<LABEL>","tags":["<tag1>", "<tag3>"] }'
{
"id":1,
"tenant_id":<Tenant ID>,
"client_id":<Client ID>,
"client_secret":<Client Secret>,
"label":"Azure",
"tags":["<tag1>","<tag3>"],
"reading_enabled":true
}
Delete the specified Azure Account Hash
curl -s -XDELETE -H "Content-Type: application/json" https://<APIKEY>:U@api.copperegg.com/v2/azure/accounts/<Azure_Account_id>.json
{}