This repository has been archived by the owner on Jun 12, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Thibault Richard <thibault.richard@corp.ovh.com>
- Loading branch information
Thibault Richard
committed
Jan 2, 2017
1 parent
b2ee32b
commit 932f56f
Showing
9 changed files
with
65 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,67 @@ | ||
## IoT PAAS API put/query/utils bash functions. | ||
## Bash functions for the Metrics data platform API. | ||
|
||
Create a [`creds`](creds.example) file with your tokens info. | ||
|
||
Source [lib/iot.lib.sh](lib/iot-lib.sh) and write some Bash: | ||
Source [lib/metrics-functions.sh](lib/metrics-functions.sh) and write some Bash: | ||
|
||
#!/bin/bash | ||
set -euo pipefail | ||
``` | ||
#!/bin/bash | ||
set -euo pipefail | ||
source lib/iot-lib.sh | ||
source lib/metrics-functions.sh | ||
``` | ||
|
||
### Put | ||
|
||
echo '{ | ||
"metric":"foo", | ||
"timestamp":'$(date +%s)', | ||
"value":'0.$RANDOM', | ||
"tags":{} | ||
}' | put | ||
``` | ||
echo '{ | ||
"metric":"foo", | ||
"timestamp":'$(date +%s)', | ||
"value":'0.$RANDOM', | ||
"tags":{} | ||
}' | put | ||
``` | ||
|
||
Or send key:value list with `kv_to_put_json` function: | ||
|
||
echo '\ | ||
foo:42 | ||
bar:123' \ | ||
| kv_to_put_json \ | ||
| put | ||
``` | ||
echo '\ | ||
foo:42 | ||
bar:123' \ | ||
| kv_to_put_json \ | ||
| put | ||
``` | ||
|
||
### Query | ||
|
||
echo '{ | ||
"start":0, | ||
"queries":[{ | ||
"metric":"foo", | ||
"aggregator":"avg", | ||
"downsample":"10s-avg", | ||
"tags":{} | ||
}] | ||
}' | query | ||
``` | ||
echo '{ | ||
"start":0, | ||
"queries":[{ | ||
"metric":"foo", | ||
"aggregator":"avg", | ||
"downsample":"10s-avg", | ||
"tags":{} | ||
}] | ||
}' | query | ||
``` | ||
|
||
### Delete | ||
|
||
echo '{ | ||
"start":0, | ||
"queries":[{ | ||
"metric":"foo", | ||
"aggregator":"avg", | ||
"downsample":"10s-avg", | ||
"tags":{} | ||
}] | ||
}' | delete | ||
``` | ||
echo '{ | ||
"start":0, | ||
"queries":[{ | ||
"metric":"foo", | ||
"aggregator":"avg", | ||
"downsample":"10s-avg", | ||
"tags":{} | ||
}] | ||
}' | delete | ||
``` | ||
|
||
### List Metrics | ||
|
||
``` | ||
listMetrics | ||
|
||
returns all metrics for the current application | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
source lib/iot-lib.sh | ||
source lib/metrics-functions.sh | ||
|
||
# Put and Query | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
This repository contains examples of how to push data to the Runabove IoT metrics storage in different languages. | ||
|
||
The metrics storage uses the OpenTSDB API, and read-made libraries already exist in most languages. | ||
This repository contains examples of how to push data to the OVH Metrics Data platform in different languages. |