Add ability to manually create a db (#6151) (#6154)

automerge
This commit is contained in:
mergify[bot]
2019-09-27 12:42:17 -07:00
committed by Grimes
parent 11bc11f0b7
commit 06e34ef1cf

View File

@ -12,11 +12,12 @@ usage() {
echo "Error: $*"
fi
cat <<EOF
usage: $0 [-e] [-d] [username]
usage: $0 [-e] [-d] [-c database_name] [username]
Creates a testnet dev metrics database
username InfluxDB user with access to create a new database
-c Manually specify a database to create, rather than read from config file
-d Delete the database instead of creating it
-e Assume database already exists and SOLANA_METRICS_CONFIG is
defined in the environment already
@ -25,17 +26,20 @@ EOF
exit $exitcode
}
loadConfigFile
useEnv=false
delete=false
createWithoutConfig=false
host="https://metrics.solana.com:8086"
while getopts "hde" opt; do
while getopts "hdec:" opt; do
case $opt in
h|\?)
usage
exit 0
;;
c)
createWithoutConfig=true
netBasename=$OPTARG
;;
d)
delete=true
;;
@ -62,6 +66,10 @@ else
password="$(urlencode "$password")"
if ! $createWithoutConfig; then
loadConfigFile
fi
query() {
echo "$*"
curl -XPOST \