Date : april 2017
The WarpScript data manipulation environment allows the retrieval and analysis of data stored in the Warp 10 storage platform. It's a stack oriented language.
API endpoints
API need an X-Warp10-Token header set with a READ or WRITE token.
Send data to the platform
POST /api/v0/update
Executing a WarpScript
POST /api/v0/exec
Get raw GeoTimeSeries® data
GET /api/v0/fetch
Get GeoTimeSeries® identifier (class name and labels)
GET /api/v0/find
Remove data from the platform
GET /api/v0/delete
For setting GeoTimeSeries® attributes
POST /api/v0/meta
Fetch some metrics
During the last hour, any metric which contains os.cpu
[ 'READ_TOKEN' '~os.cpu.*' { } NOW 1 h ] FETCH
The last 10 datapoints of metric which name is exactly fuel.station
[ 'READ_TOKEN' '=fuel.station' { 'tag' 'value' } NOW -10 ] FETCH
Bucketizer
.sum | .max |
.min | .count |
.mean | .first |
.mean.circular | .and |
.mean.circular.exclude-nulls | .join |
.last | .or |
.median |
Syntaxe: [ [GTS] bucketizer lastbucket bucketspan bucketcount ] BUCKETIZE
Ex: return 100 meaning datapoints from the previous GeoTimeSeries®
[ SWAP bucketizer.mean 0 0 100 ] BUCKETIZE
Reducer
.argmax | .argmin |
.count.exclude-nulls | .count |
.count.include-nulls | .join |
.join.forbid-nulls | .max |
.max.forbid-nulls | .mean |
.mean.exclude-nulls | .mean.circular |
.mean.circular.exclude-nulls | .median |
.min | .min.forbid-nulls |
.and | .and.exclude-nulls |
.or.exclude-nulls | .or |
.shannonentropy.0 | .sd |
.shannonentropy.1 | .sum |
.sum.forbid-nulls | .var |
Syntaxe: [ [GTS]...[GTS] [labels] reducer ] REDUCE
Ex: return a sum of aggregated GeoTimeSerie® from the previous GeoTimeSerie®
[ SWAP [ 'label1'] reducer.sum ] REDUCE