blob: 9365265ed53d9ea9fa4a5d864ee50acd630bc31f [file] [log] [blame]
Alexb00fee12022-02-17 14:20:04 -06001#!/bin/bash
2if [[ -z ${token+x} ]]; then
3 export token=$(openstack token issue -c id -f value)
4 echo "# Exported token: ${token}"
5fi
6if [[ -z ${project_id+x} ]]; then
7 export project_id=$(openstack project list -c ID -c Name -f value | grep ${OS_PROJECT_NAME} | cut -d' ' -f1)
8 echo "# Exported project_id: ${project_id}"
9fi
10poke_uri=$(echo ${1/project_id/$project_id})
11
12function ppoke {
13rr=$(curl --insecure -sH "X-Auth-Token: ${token}" $1)
14if [[ $? != 0 ]]; then
15 echo "[$(date +'%H:%M:%S')] Error: $rr"
16else
17 echo "[$(date +'%H:%M:%S')] -> '$1', $(echo $rr | wc -c) bytes"
18fi
19}
20
21cc=50;
22while [[ $cc -gt 0 ]]; do
23 cat $1 | while read svc; do
24 ppoke $svc | grep "Error";
25 done
26 (( cc -= 1 ));
27 echo "$cc to go";
28 sleep 0.1;
29done