#!/bin/bash

if [ -z "$1" ] || [ -z "$2" ]; then
  echo "Usage: es-curl.sh VERB COMMAND"
  exit 1
fi

VERB=$1
COMMAND=$2

shift
shift

curl -X $VERB -k -u "admin:$LOGSDB_ADMIN_PASSWORD" "http://localhost:9200/$COMMAND" -H 'Content-Type: application/json' "$@"