Skip to content
This repository has been archived by the owner on Dec 26, 2024. It is now read-only.

Commit

Permalink
#23: Finished demo for GetInfluxDatabaseRecord_2
Browse files Browse the repository at this point in the history
  • Loading branch information
bednar committed Jul 29, 2019
1 parent 10281ec commit a071a11
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 381 deletions.
41 changes: 41 additions & 0 deletions scripts/end-to-end.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,45 @@ if [[ ${GetInfluxDatabase_2} == 200 ]]; then
else
echo "> check: fail..." "${GetInfluxDatabase_2}"
exit 1
fi

echo
echo "Flux Query to CSV:"
echo

FluxToCSV=$(curl -L -G http://localhost:8234 -o /dev/null -w '%{http_code}\n' -s --data-urlencode 'query=from(bucket: "my-bucket")
|> range(start: 0) |> filter(fn: (r) => r._measurement == "docker_container_status")
|> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
|> limit(n:10, offset: 0)')

if [[ ${FluxToCSV} == 200 ]]; then
echo "> check: success"
else
echo "> check: fail..." "${FluxToCSV}"
exit 1
fi

echo
echo "Flux Query to XML:"
echo

FluxToXML=$(curl -L -G http://localhost:8234 -o /dev/null -w '%{http_code}\n' -s --data-urlencode 'accept=xml' --data-urlencode 'query=from(bucket: "my-bucket")
|> range(start: 0) |> filter(fn: (r) => r._measurement == "docker_container_status")
|> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
|> limit(n:10, offset: 0)')

echo
echo "Flux Query to JSON:"
echo

FluxToJSON=$(curl -L -G http://localhost:8234 -o /dev/null -w '%{http_code}\n' -s --data-urlencode 'accept=json' --data-urlencode 'query=from(bucket: "my-bucket")
|> range(start: 0) |> filter(fn: (r) => r._measurement == "docker_container_status")
|> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
|> limit(n:10, offset: 0)')

if [[ ${FluxToXML} == 200 ]]; then
echo "> check: success"
else
echo "> check: fail..." "${FluxToJSON}"
exit 1
fi
Loading

0 comments on commit a071a11

Please sign in to comment.