Add ability to manually create a db (#6151)
This commit is contained in:
parent
bf199a2ebc
commit
db18611c86
|
@ -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 \
|
||||
|
|
Loading…
Reference in New Issue