Skip to content

Commit d71861f

Browse files
committed
tmp
1 parent c14db6d commit d71861f

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

scripts/generate_datapoints.bash

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/local/env bash
2+
3+
set -xe
4+
5+
CRYOSTAT_URL="$1"
6+
7+
if [ -z $CRYOSTAT_URL ]; then
8+
echo "Cryostat URL is expected as an argument. Found none"; exit 2
9+
fi
10+
11+
# Get datasource UID
12+
13+
DATASOURCE_UID=$(curl -kLs ${CRYOSTAT_URL}/grafana/api/datasources/name/jfr-datasource | jq .uid)
14+
15+
echo $DATASOURCE_UID
16+
17+
18+
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/')"
19+
20+
21+
curl -kL --data $BODY ${CRYOSTAT_URL}/grafana/api/datasources/proxy/uid/$DATASOURCE_UID

0 commit comments

Comments
 (0)