Query the usage data (sparse)
1 min
POST
https://app.amberflo.io/usage/sparse
Body Parameters
- bodyusage.MeterAggregationMetadata.in
- meterApiNamestringrequiredDescription
- aggregationusage.AggregationType.inDescription
- timeRangecommon.TimeRange.inrequiredDescription
- startTimeInSecondsinteger<int64>requiredDescription
- endTimeInSecondsinteger<int64>Description
- filtermap<string, string[]>Description
- groupBystring[]Description
- takeusage.MeterAggregationMetadata.Take.in
- limitinteger<int32>required
- isAscendingboolean
- timeGroupingIntervalcom.amberflo.service.common.aggregation.AggregationInterval.inDescription
- valuesTimeGroupingIntervalcom.amberflo.service.common.aggregation.AggregationInterval.in
- rescaleFunctioncom.amberflo.service.common.aggregation.RescaleFunction.in
- functioncom.amberflo.service.common.aggregation.RescaleFunctionType.in
- coefficientnumber
Responses
200
- usage.MeterAggregation.out
- metadatausage.MeterAggregationMetadata.out
- accountstring
- meterApiNamestringrequiredDescription
- aggregationusage.AggregationType.outDescription
- timeRangecommon.TimeRange.outrequiredDescription
- startTimeInSecondsinteger<int64>requiredDescription
- endTimeInSecondsinteger<int64>Description
- filtermap<string, string[]>Description
- groupBystring[]Description
- takeusage.MeterAggregationMetadata.Take.out
- limitinteger<int32>required
- isAscendingboolean
- timeGroupingIntervalcom.amberflo.service.common.aggregation.AggregationInterval.outDescription
- valuesTimeGroupingIntervalcom.amberflo.service.common.aggregation.AggregationInterval.out
- rescaleFunctioncom.amberflo.service.common.aggregation.RescaleFunction.out
- functioncom.amberflo.service.common.aggregation.RescaleFunctionType.out
- coefficientnumber
- clientMetersusage.MeterAggregation.MeterAggregationGroup.out[]
- groupusage.MeterAggregation.GroupInfo.out
- groupInfomap<string, string>
- groupValuenumber
- valuesusage.MeterAggregation.AggregationValue.out[]
- valuenumber
- secondsSinceEpochUtcinteger<int64>
curl
curl --request POST \
--url https://app.amberflo.io/usage/sparse \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"meterApiName": "",
"timeRange": {
"startTimeInSeconds": 0
},
"take": {
"limit": 0
}
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"meterApiName": "",
"timeRange": {
"startTimeInSeconds": 0
},
"take": {
"limit": 0
}
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://app.amberflo.io/usage/sparse", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://app.amberflo.io/usage/sparse")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"meterApiName": "",
"timeRange": {
"startTimeInSeconds": 0
},
"take": {
"limit": 0
}
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://app.amberflo.io/usage/sparse"
payload = json.dumps({
"meterApiName": "",
"timeRange": {
"startTimeInSeconds": 0
},
"take": {
"limit": 0
}
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// Successful request
{
"metadata": {
"account": "",
"meterApiName": "",
"aggregation": "",
"timeRange": {
"startTimeInSeconds": "",
"endTimeInSeconds": ""
},
"filter": "",
"groupBy": [
""
],
"take": {
"limit": "",
"isAscending": false
},
"timeGroupingInterval": "",
"valuesTimeGroupingInterval": "",
"rescaleFunction": {
"function": "",
"coefficient": 0
}
},
"clientMeters": [
{
"group": {
"groupInfo": ""
},
"groupValue": 0,
"values": [
{
"value": 0,
"secondsSinceEpochUtc": ""
}
]
}
]
}This API is a generic statistical query tool which can allow you to fetch the usage or usage-rate (scale of usage) over time.
Differently from the usage endpoint, this one does not fill the gaps in the time series when no usage happened.