https://github.com/rerost/es-cli
Elasticsearch's operation wrapper tool
https://github.com/rerost/es-cli
cli elasticsearch go golang
Last synced: 11 months ago
JSON representation
Elasticsearch's operation wrapper tool
- Host: GitHub
- URL: https://github.com/rerost/es-cli
- Owner: rerost
- Created: 2018-11-08T15:11:28.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-02-25T00:12:54.000Z (over 3 years ago)
- Last Synced: 2024-11-30T17:50:55.725Z (over 1 year ago)
- Topics: cli, elasticsearch, go, golang
- Language: Go
- Homepage:
- Size: 175 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# es-cli
[](https://circleci.com/gh/rerost/es-cli/tree/master)
This tool is **still under development**.
It's high useage elasticsearch's operation wrapper tool.
For example, creating index and add/remove alias operations is frequently performed, but JSON API is too complicated(I can not remember).
So I create this tool
## Term
I said `details` is for `mappings`, `settings`, and `aliases`.
Its for creating indecies.
https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html
## Installation
`go get -u github.com/rerost/es-cli`
## Usage
### Format
```
$ es-cli args...
$ es-cli [--host=HOST] [--user=BASIC_AUTH_USER] [--pass=BASIC_AUTH_PASSWORD] [--type=ELASTICSEARCH_DOCUMENT_TYPE] args...
```
### Index API
```
$ es-cli list index
$ es-cli create index
$ es-cli create index # Read detail json by stdin
$ es-cli copy index
$ es-cli count index # Return total count of documents
$ es-cli delete index
$ es-cli dump index # Dump details & docs
$ es-cli restore index # Insert docs from dumped doc file(Without details)
$ es-cli restore index # Insert docs from dumped doc file(Without details)
```
### Detail API
```
$ es-cli get detail # Get settings, alias, mappings for creat index
$ es-cli update detail # Zero downtime(without write) update detail
$ es-cli update detail # Read detail json by stdin
```
### Alias API
```
$ es-cli add alias ...
$ es-cli remove alias ...
$ es-cli list alias
```
## Configuration
You can use configuration file.
es-cli see options order by command options > current directory.
configrutaion file name is "`escli.json`
the configuration file's format is json.
e.g
```
{
"user": "user",
"pass": "pass",
"host": "http://localhost:9200",
"type": "_doc"
}
```
when use multiple elasticsearch, use namespace
e.g.
```
{
"production": {
"host": "http://prod-es"
},
"qa": {
"host": "http://qa-es"
}
}
```
and exec `es-cli -n production list index`