-
Notifications
You must be signed in to change notification settings - Fork 0
REST API
Returns a list of available metrics that match one or more filtering options by using the query parameters. The REST API returns the results in the JSON or CSV format. For the CSV format, each row is located on a separate line, delimited by a line break (LF) and its fields, separated by commas, never contain line breaks (LF), double quotes and commas.
https://papi.giraffi.jp/metrics.:format
GET
Request with CSV
Content-Type: text/csv
Request with JSON
Content-Type: application/json
metrics.json and metrics.csv are available.
The following query parameters are available for authenticating, ordering, limiting and filtering the results when retrieving metrics. All parameters are optional except apikey.
- apikey: Specifies the authentication token to access to the API resources.
- src: Specifies the source, e.g., virtualized server instance where the metrics have been collected.
-
tags: Array parameter that selects the metrics corresponding to
tags. - since: Limits the metrics collected after the given date. Date should be formatted as the Unix epoch time.
- until: Limits the metrics collected before the given date. Date should be formatted as the Unix epoch time.
- limit: Specifies the number of results to return. Defaults to 10.
- offset: Specifies the number of results to skip.
-
order: Orders the results by its
timefield.ascanddescare available. -
fields: Array parameter that specifies the fields to return. The available field names are
val,time,srcandtags.
All available metrics for the specified source:
https://papi.giraffi.jp/metrics.csv?apikey=sTyBGlV-LsQcI8mhMYI3nvqtkYvVoERMb-mz8yhhgCU&4src=cld257-0.m.xenzai.com&fields=val,time
All available metrics corresponding to tags for the specified source:
https://papi.giraffi.jp/metrics.csv?apikey=sTyBGlV-LsQcI8mhMYI3nvqtkYvVoERMb-mz8yhhgCU&src=cld257-0.m.xenzai.com&tags=cpu,7,user&fields=val,time,tags
200 OK
** Not Applicable **
Request with CSV
https://papi.giraffi.jp/metrics.csv?apikey=sTyBGlV-LsQcI8mhMYI3nvqtkYvVoERMb-mz8yhhgCU&src=cld257-0.m.xenzai.com&tags=cpu,7,user&fields=val,time,tags
Response
5246016,1341810982.941,cpu,7,cpu,user,derive,value
5246016,1341810982.946,cpu,7,cpu,user,derive,value
5246016,1341810983.031,cpu,7,cpu,user,derive,value
5246016,1341810983.236,cpu,7,cpu,user,derive,value
5246017,1341810983.384,cpu,7,cpu,user,derive,value
# snip..
Request with JSON
https://papi.giraffi.jp/metrics.json?apikey=sTyBGlV-LsQcI8mhMYI3nvqtkYvVoERMb-mz8yhhgCU&src=cld257-0.m.xenzai.com&tags=cpu,7,user&fields=val,time,tags&order=asc&limit=5
Response
[
{
"time": 1341810982.941,
"val": 5246016,
"tags": [
"cpu",
"7",
"cpu",
"user",
"derive",
"value"
]
},
{
"time": 1341810982.946,
"val": 5246016,
"tags": [
"cpu",
"7",
"cpu",
"user",
"derive",
"value"
]
},
{
"time": 1341810983.031,
"val": 5246016,
"tags": [
"cpu",
"7",
"cpu",
"user",
"derive",
"value"
]
},
{
"time": 1341810983.236,
"val": 5246016,
"tags": [
"cpu",
"7",
"cpu",
"user",
"derive",
"value"
]
},
{
"time": 1341810983.384,
"val": 5246017,
"tags": [
"cpu",
"7",
"cpu",
"user",
"derive",
"value"
]
}
]