README.md in desi-0.1.0 vs README.md in desi-0.2.0
- old
+ new
@@ -11,11 +11,11 @@
* do basic indices management (list, delete, empty a given set of indices)
It can be used both as a command-line tool and as a library.
-## Usage
+## Usage (command-line)
$ desi list # List locally installed ElasticSearch releases
$ desi releases # List all upstream Elastic Search releases (latest 5 by default)
$ desi install [VERSION] # Install a specific version (latest by default)
$ desi start # Start a local 1-node cluster (noop if active)
@@ -23,18 +23,18 @@
$ desi stop # Stop cluster
$ desi status [--host HOST] # Show running cluster info
$ desi indices "^foo" # List all indices whose name match /^foo/
$ desi indices "^foo" --delete # Delete all matching indices
- $ desi indices "bar$" --empty # Remove all records from the matching
- # indices
+ $ desi indices "bar$" --empty # Remove all records from the matching indices
-## Examples
+## Examples (command-line and Ruby)
-### Currently installed releases
+### Get the list of locally installed releases
-The current version is the one symlinked to `$HOME/elasticsearch/current`
+The current version is the one symlinked to `$HOME/elasticsearch/current`, that
+will be spun up by (`desi start`)
* command-line
```shell
$ desi list
@@ -50,11 +50,59 @@
Desi::LocalInstall.new.releases.map(&:name) #=> ["elasticsearch-0.19.8", "elasticsearch-0.19.9"]
Desi::LocalInstall.new.releases.detect(&:current?).version #=> "0.19.9"
```
+### List and delete some indices
+ * command-line
+
+ ```shell
+ $ # List all local indices
+ $ desi indices
+ Indices from host http://127.0.0.1:9200 matching the pattern /.*/
+
+ foo
+ bar
+ baz
+
+ $ # List all indices on remote cluster 129.168.1.42, reachable on port 9800
+ $ desi indices --host 129.168.1.42:9800 foo
+ Indices from host http://192.168.1.42:9800 matching the pattern /foo/
+
+ remotefoo1
+ remotefoo2
+
+ $ # Remove all indices whose name starts with "ba"
+ $ desi indices --delete "^ba"
+ The following indices from host http://127.0.0.1:9200 are now deleted
+ * bar
+ * baz
+ ```
+
+
+ * library
+
+ ```ruby
+ # All local indices
+ Desi::IndexManager.new.list #=> ["foo", "bar", "baz"]
+
+ # All local indices whose name starts with `b`
+ Desi::IndexManager.new.list("^b") #=> ["bar", "baz"]
+
+ # All indices from distant cluster
+ Desi::IndexManager.new(host: "192.168.1.42:9800").list #=> ["remotefoo1", "remotefoo2"]
+
+ # Delete all local indices whose name starts with `ba`
+ Desi::IndexManager.new.delete!("^ba") #=> nil
+
+ # The indices actually disappeared
+ Desi::IndexManager.new.list #=> ["foo"]
+ ```
+
+
+
## Installation
Add this line to your application's Gemfile:
gem 'desi'
@@ -67,10 +115,10 @@
$ gem install desi
## TODO
- * add tests, dammit!
+ * add more tests
* `desi upgrade` (Upgrade to latest version and migrate data)
* `desi switch VERSION` (Switch currently active ES version to VERSION)
* plugin management ? (list, install, remove ES plugins)