Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
tthvo committed Aug 6, 2024
1 parent c14db6d commit d71861f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions scripts/generate_datapoints.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/local/env bash

set -xe

CRYOSTAT_URL="$1"

if [ -z $CRYOSTAT_URL ]; then
echo "Cryostat URL is expected as an argument. Found none"; exit 2
fi

# Get datasource UID

DATASOURCE_UID=$(curl -kLs ${CRYOSTAT_URL}/grafana/api/datasources/name/jfr-datasource | jq .uid)

echo $DATASOURCE_UID


BODY="$(curl -ksL https://localhost:8080/grafana/api/dashboards/uid/main | jq .dashboard.panels[0].targets[0].url_options.data | sed -e 's/${__timeTo:date}/2024-08-28T20:23:35.127Z/' -e 's/${__timeFrom:date}/2024-05-01T20:23:35.127Z/')"


curl -kL --data $BODY ${CRYOSTAT_URL}/grafana/api/datasources/proxy/uid/$DATASOURCE_UID

0 comments on commit d71861f

Please sign in to comment.