Azure Samples


Overview

This is an API used to get overview of an Azure Account. It fetches stats related to subscriptions and their resources with corresponding objects and metrics.

Required Parameters:

account_id
Id of Azure account which can be retrieved by Accounts API

CURL Command, and variations:

curl -su <APIKEY>:U "https://api.copperegg.com/v2/azure/samples/overview.json?account_id=<AZURE_ACCOUNT_ID>"

curl -s "https://<APIKEY>:U@api.copperegg.com/v2/azure/samples/overview.json?account_id=<AZURE_ACCOUNT_ID>"

CURL Response:

{
"metrics": {
"resource_type_1": {
"objects": 100,
"metrics": 707
},
"resource_type_2": {
"objects": 1,
"metrics": 1
}
}
}

VM

This is an API used to get samples of one or more VM resources

VM Sample Keys

Key name           Valid combinations

Cpu c
Network n
Disk d

Fetch Samples from resources specified in idvs

Required Parameters:

idvs
It is a list of ids(unique for every vm resource)

*idv is a combination of azure| Azure Account Id | Subscription ID | Resource Group ID | VM Resource ID|

These IDs are unique IDs assigned by Uptime Cloud Monitor. Eg. azure | 1 | 13 | 221 | 942 |

CURL Command:

curl -XGET -s 'https://<APIKEY>:U@api.copperegg.com/v2/azure/samples/vm.json -H "Content-Type: application/json" -d '{"idvs":["idv1", "idv2"]}'

CURL Response:

{
"<IDV1>":{
"c":{
"1484810160":0.341,
"1484810460":0.328,
"1484810760":0.364,
"1484811060":0.348,
"1484811360":0.329
},
"n":{
"1484810160":[533795466,30448340],
"1484810220":[null,null],
"1484810280":[null,null],
"1484810340":[null,null],
"1484810400":[null,null],
"1484810460":[518838963,27407162],
"1484810520":[null,null],
"1484810580":[null,null],
"1484810640":[null,null],
"1484810700":[null,null]
},
"d":{
"1484810160":[0,0],
"1484810220":[0,0],
"1484810280":[0,0],
"1484810340":[0,0],
"1484810400":[0,0],
"1484810460":[0,0],
"1484810520":[0,0],
"1484810580":[0,0],
"1484810640":[0,0]
}
}
}

VM Details

This is an API used to get detailed samples of a vm resource

VM Sample Keys

Key name           Valid combinations

Cpu c
Network n
Disk R/W d
Disk Operations o

Fetch Samples from resource specified by idv

Required Parameters:

idv
unique id for a vm resource

*idv is a combination of azure| Azure Account Id | Subscription ID | Resource Group ID | VM Resource ID|

These IDs are unique IDs assigned by Uptime Cloud Monitor. Eg. azure | 1 | 13 | 221 | 942 |

Optional Parameters:

starttime
integer value corresponding start time of timeframe for which samples are being fetched
endtime
integer value corresponding end time of timeframe for which samples are being fetched

CURL Command:

curl -s 'https://<APIKEY>:U@api.copperegg.com/v2/azure/samples/vm_details.json?idv=<IDV1>&starttime=1484810160&endtime=1484811360'

CURL Response:

{
"<IDV1>":{
"c":{
"1484810160":0.341,
"1484810460":0.328,
"1484810760":0.364,
"1484811060":0.348,
"1484811360":0.329
},
"n":{
"1484810160":[533795466,30448340],
"1484810220":[null,null],
"1484810280":[null,null],
"1484810340":[null,null],
"1484810400":[null,null],
"1484810460":[518838963,27407162],
"1484810520":[null,null],
"1484810580":[null,null],
"1484810640":[null,null],
"1484810700":[null,null]
},
"d":{
"1484810160":[0,0],
"1484810220":[0,0],
"1484810280":[0,0],
"1484810340":[0,0],
"1484810400":[0,0],
"1484810460":[0,0],
"1484810520":[0,0],
"1484810580":[0,0],
"1484810640":[0,0]
},
"o":{
"1484810160":[0,0],
"1484810220":[0,0],
"1484810280":[0,0],
"1484810340":[0,0],
"1484810400":[0,0],
"1484810460":[0,0],
"1484810520":[0,0],
"1484810580":[0,0],
"1484810640":[0,0]
}
}
}

SQL

This is an API used to get samples of one or more SQL resources

SQL Sample Keys

Key name           Valid combinations

Cpu c
I/O i
Database p
Throughput (DTU) t
Connection n
Workers w

Fetch Samples from resources specified in idvs

Required Parameters:

idvs
It is a list of ids(unique for every sql resource)

*idv is a combination of azure| Azure Account Id | Subscription ID | Resource Group ID | SQL Resource ID|

These IDs are unique IDs assigned by Uptime Cloud Monitor. Eg. azure | 1 | 13 | 221 | 942 |

CURL Command:

curl -XGET -s https://<APIKEY>:U@api.copperegg.com/v2/azure/samples/sql.json -H "Content-Type: application/json" -d '{"idvs":["idv1", "idv2"]}'

CURL Response:

{
"<IDV1>":{
"c":{
"1484810160":0.341,
"1484810460":0.328,
"1484810760":0.364,
"1484811060":0.348,
"1484811360":0.329
},
"i":{
"1484810160":0.341,
"1484810460":0.328,
"1484810760":0.364,
"1484811060":0.348,
"1484811360":0.329
},
"p":{
"1484810160":0.341,
"1484810460":0.328,
"1484810760":0.364,
"1484811060":0.348,
"1484811360":0.329
},
"t":{
"1484810160":0.441,
"1484810460":0.428,
"1484810760":0.464,
"1484811060":0.448,
"1484811360":0.429
},
"n":{
"1484810160":[0.841, 0.489, 0.814],
"1484810460":[0.628, 0.533, 0.384],
"1484810760":[0.464, 0.461, 0.282],
"1484811060":[0.248, 0.583, 0.584],
"1484811360":[0.629, 0.485, 0.734]
},
"w":{
"1484810160":0.541,
"1484810460":0.528,
"1484810760":0.564,
"1484811060":0.548,
"1484811360":0.529
}

}
}

SQL Details

This is an API used to get detailed samples of a sql resource

SQL Sample Keys

Key name           Valid combinations

Cpu c
I/O i
Log l
Throughput t
Database Size b
Connections n # successful, failed, blocked by firewall
Deadlocks d
Storage p
In Memory Storage o
Workers w
Sessions s
DTU Limit and Used dt

Fetch Samples from resource specified by idv

Required Parameters:

idv
unique id for a sql resource

*idv is a combination of azure| Azure Account Id | Subscription ID | Resource Group ID | SQL Resource ID|

These IDs are unique IDs assigned by Uptime Cloud Monitor. Eg. azure | 1 | 13 | 221 | 942 |

Optional Parameters:

starttime
integer value corresponding start time of timeframe for which samples are being fetched
endtime
integer value corresponding end time of timeframe for which samples are being fetched

CURL Command:

curl -s 'https://<APIKEY>:U@api.copperegg.com/v2/azure/samples/sql_details.json?idv=<IDV1>&starttime=1484810160&endtime=1484811360'

CURL Response:

{
"<IDV1>":{
"c":{
"1484810160":0.341,
"1484810460":0.328,
"1484810760":0.364,
"1484811060":0.348,
"1484811360":0.329
},
"i":{
"1484810160":0.341,
"1484810460":0.328,
"1484810760":0.364,
"1484811060":0.348,
"1484811360":0.329
},
"l":{
"1484810160":0.341,
"1484810460":0.328,
"1484810760":0.364,
"1484811060":0.348,
"1484811360":0.329
},
"t":{
"1484810160":0.341,
"1484810460":0.328,
"1484810760":0.364,
"1484811060":0.348,
"1484811360":0.329
},
"b":{
"1484810160":533795466,
"1484810460":30448340,
"1484810760":518838963,
"1484811060":27407162,
"1484811360":513468389
},
"n":{
"1484810160":[10,0,1],
"1484810460":[12,0,1],
"1484810760":[15,0,1],
"1484811060":[10,0,0]
},
"d":{
"1484810160":1,
"1484810460":0,
"1484810760":4,
"1484811060":0,
"1484811360":0
},
"p":{
"1484810160":0.341,
"1484810460":0.328,
"1484810760":0.364,
"1484811060":0.348,
"1484811360":0.329
},
"o":{
"1484810160":0.341,
"1484810460":0.328,
"1484810760":0.364,
"1484811060":0.348,
"1484811360":0.329
},
"w":{
"1484810160":0.341,
"1484810460":0.328,
"1484810760":0.364,
"1484811060":0.348,
"1484811360":0.329
},
"s":{
"1484810160":0.341,
"1484810460":0.328,
"1484810760":0.364,
"1484811060":0.348,
"1484811360":0.329
}
}
}

MySQL

This is an API used to get samples of one or more MySQL resources

MySQL Sample Keys

Key name           Valid combinations

Cpu c
I/O i
Storage s
Memory m
Connection n
Storage Percent sp

Fetch Samples from resources specified in idvs

Required Parameters:

idvs
It is a list of ids(unique for every sql resource)

*idv is a combination of azure| Azure Account Id | Subscription ID | Resource Group ID | MySQL Resource ID|

These IDs are unique IDs assigned by Uptime Cloud Monitor. Eg. azure | 1 | 13 | 221 | 942 |

CURL Command:

curl -XGET -s https://<APIKEY>:U@api.copperegg.com/v2/azure/samples/mysql.json -H "Content-Type: application/json" -d '{"idvs":["idv1", "idv2"]}'

CURL Response:

{
"<IDV1>":{
"c":{
"1484810160":0.341,
"1484810460":0.328,
"1484810760":0.364,
"1484811060":0.348,
"1484811360":0.329
},
"i":{
"1484810160":0.341,
"1484810460":0.328,
"1484810760":0.364,
"1484811060":0.348,
"1484811360":0.329
},
"s":{
"1484810160":[30448340,533795466],
"1484810460":[30449340,533795466],
"1484810760":[41448340,533795466],
"1484811060":[41448340,533795466],
"1484811360":[41478340,533795466]
},
"m":{
"1484810160":0.441,
"1484810460":0.538,
"1484810760":0.263,
"1484811060":0.544,
"1484811360":0.623
},
"n":{
"1484810160":[30448340,533795466],
"1484810460":[30449340,533795466],
"1484810760":[41448340,533795466],
"1484811060":[41448340,533795466],
"1484811360":[41478340,533795466]
},
"sp":{
"1484810160":0.241,
"1484810460":0.358,
"1484810760":0.364,
"1484811060":0.248,
"1484811360":0.359
}
}
}

MySQL Details

This is an API used to get detailed samples of a mysql resource

MySQL Sample Keys

Key name           Valid combinations

Cpu c
Compute Unit l # limit
Compute Unit p # percentage
Memory m
I/O i
Storage Percentage sp
Storage sl # used and limit
Connections n # active and failed

Fetch Samples from resource specified by idv

Required Parameters:

idv
unique id for a mysql resource

*idv is a combination of azure| Azure Account Id | Subscription ID | Resource Group ID | MySQL Resource ID|

These IDs are unique IDs assigned by Uptime Cloud Monitor. Eg. azure | 1 | 13 | 221 | 942 |

Optional Parameters:

starttime
integer value corresponding start time of timeframe for which samples are being fetched
endtime
integer value corresponding end time of timeframe for which samples are being fetched

CURL Command:

curl -s 'https://<APIKEY>:U@api.copperegg.com/v2/azure/samples/mysql_details.json?idv=<IDV1>&starttime=1484810160&endtime=1484811360'

CURL Response:

{
"<IDV1>":{
"c":{
"1484810160":0.341,
"1484810460":0.328,
"1484810760":0.364,
"1484811060":0.348,
"1484811360":0.329
},
"l":{
"1484810160":0,
"1484810460":0,
"1484810760":0,
"1484811060":0,
"1484811360":0
},
"p":{
"1484810160":0.341,
"1484810460":0.328,
"1484810760":0.364,
"1484811060":0.348,
"1484811360":0.329
},
"m":{
"1484810160":0.341,
"1484810460":0.328,
"1484810760":0.364,
"1484811060":0.348,
"1484811360":0.329
},
"i":{
"1484810160":0.341,
"1484810460":0.328,
"1484810760":0.364,
"1484811060":0.348,
"1484811360":0.329
},
"sp":{
"1484810160":0.341,
"1484810460":0.328,
"1484810760":0.364,
"1484811060":0.348,
"1484811360":0.329
},
"sl":{
"1484810160":[30448340,533795466],
"1484810460":[30449340,533795466],
"1484810760":[41448340,533795466],
"1484811060":[41448340,533795466],
"1484811360":[41478340,533795466]
},
"n":{
"1484810160":[533795466,30448340],
"1484810220":[null,null],
"1484810280":[null,null],
"1484810340":[null,null],
"1484810400":[null,null],
"1484810460":[518838963,27407162]
}
}
}

Postgres

This is an API used to get samples of one or more Postgres resources

Postgres Sample Keys

Key name           Valid combinations

Cpu c
I/O i
Storage s
Memory m
Connection n
Storage Percent sp

Fetch Samples from resources specified in idvs

Required Parameters:

idvs
It is a list of ids(unique for every postgres resource)

*idv is a combination of azure| Azure Account Id | Subscription ID | Resource Group ID | Postgres Resource ID|

These IDs are unique IDs assigned by Uptime Cloud Monitor. Eg. azure | 1 | 13 | 221 | 942 |

CURL Command:

curl -XGET -s https://<APIKEY>:U@api.copperegg.com/v2/azure/samples/postgres.json -H "Content-Type: application/json" -d '{"idvs":["idv1", "idv2"]}'

CURL Response:

{
"<IDV1>":{
"c":{
"1484810160":0.341,
"1484810460":0.328,
"1484810760":0.364,
"1484811060":0.348,
"1484811360":0.329
},
"i":{
"1484810160":0.341,
"1484810460":0.328,
"1484810760":0.364,
"1484811060":0.348,
"1484811360":0.329
},
"s":{
"1484810160":[30448340,533795466],
"1484810460":[30449340,533795466],
"1484810760":[41448340,533795466],
"1484811060":[41448340,533795466],
"1484811360":[41478340,533795466]
},
"m":{
"1484810160":0.441,
"1484810460":0.538,
"1484810760":0.263,
"1484811060":0.544,
"1484811360":0.623
},
"n":{
"1484810160":[30448340,533795466],
"1484810460":[30449340,533795466],
"1484810760":[41448340,533795466],
"1484811060":[41448340,533795466],
"1484811360":[41478340,533795466]
},
"sp":{
"1484810160":0.241,
"1484810460":0.358,
"1484810760":0.364,
"1484811060":0.248,
"1484811360":0.359
}
}
}

Postgres Details

This is an API used to get detailed samples of a postgres resource

Postgres Sample Keys

Key name           Valid combinations

Cpu c
Compute Unit l # limit
Compute Unit p # percentage
Memory m
I/O i
Storage Percentage sp
Storage sl # used and limit
Connections n # active and failed

Fetch Samples from resource specified by idv

Required Parameters:

idv
unique id for a postgres resource

*idv is a combination of azure| Azure Account Id | Subscription ID | Resource Group ID | Postgres Resource ID|

These IDs are unique IDs assigned by Uptime Cloud Monitor. Eg. azure | 1 | 13 | 221 | 942 |

Optional Parameters:

starttime
integer value corresponding start time of timeframe for which samples are being fetched
endtime
integer value corresponding end time of timeframe for which samples are being fetched

CURL Command:

curl -s 'https://<APIKEY>:U@api.copperegg.com/v2/azure/samples/postgres_details.json?idv=<IDV1>&starttime=1484810160&endtime=1484811360'

CURL Response:

{
"<IDV1>":{
"c":{
"1484810160":0.341,
"1484810460":0.328,
"1484810760":0.364,
"1484811060":0.348,
"1484811360":0.329
},
"l":{
"1484810160":0,
"1484810460":0,
"1484810760":0,
"1484811060":0,
"1484811360":0
},
"p":{
"1484810160":0.341,
"1484810460":0.328,
"1484810760":0.364,
"1484811060":0.348,
"1484811360":0.329
},
"m":{
"1484810160":0.341,
"1484810460":0.328,
"1484810760":0.364,
"1484811060":0.348,
"1484811360":0.329
},
"i":{
"1484810160":0.341,
"1484810460":0.328,
"1484810760":0.364,
"1484811060":0.348,
"1484811360":0.329
},
"sp":{
"1484810160":0.341,
"1484810460":0.328,
"1484810760":0.364,
"1484811060":0.348,
"1484811360":0.329
},
"sl":{
"1484810160":[30448340,533795466],
"1484810460":[30449340,533795466],
"1484810760":[41448340,533795466],
"1484811060":[41448340,533795466],
"1484811360":[41478340,533795466]
},
"n":{
"1484810160":[533795466,30448340],
"1484810220":[null,null],
"1484810280":[null,null],
"1484810340":[null,null],
"1484810400":[null,null],
"1484810460":[518838963,27407162]
}
}
}