Created
April 30, 2016 05:56
-
-
Save holmesconan/ae95e4971721d5f8552c4cb1bae7d3a0 to your computer and use it in GitHub Desktop.
ElasticSearch bash client.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
action=$1; uri=$2; shift; shift; | |
case "$action" in | |
GET) | |
curl -XGET "localhost:9200/$uri?pretty=1" "$@" | |
;; | |
PUT) | |
curl -XPUT "localhost:9200/$uri?pretty=1" "$@" | |
;; | |
POST) | |
curl -XPOST "localhost:9200/$uri?pretty=1" "$@" | |
;; | |
DELETE) | |
curl -XDELETE "localhost:9200/$uri?pretty=1" | |
;; | |
*) | |
echo "Unknown action: $action" | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment