[[subcommand]]
= Subcommands

[partintro]
--

The http://click.pocoo.org/3/[Click API] is used to form the command-line for
Curator. Click allows Curator to have nested commands. In this way, a
command-line structure can be built which allows multiple commands to all make
use of the same subcommands.

Available subcommands are <<indices-subcommand,indices>> for
<<index-selection,index selection>>, and <<snapshots-subcommand,snapshots>> for
<<snapshot-selection,snapshot selection>>.

--

== Command "tree"

This is tree view of all command and subcommands currently available:

----------------------------------
$ curator
    ├── alias
    │     └── indices
    ├── allocation
    │     └── indices
    ├── bloom
    │     └── indices
    ├── close
    │     └── indices
    ├── delete
    │     └── indices
    │     └── snapshots
    ├── open
    │     └── indices
    ├── optimize
    │     └── indices
    ├── replicas
    │     └── indices
    ├── seal
    │     └── indices
    ├── show
    │     └── indices
    │     └── snapshots
    └── snapshot
          └── indices
----------------------------------

&nbsp;

[[indices-subcommand]]
== indices

Commands using the `indices` subcommand:

* <<alias>>
* <<allocation>>
* <<bloom>>
* <<close>>
* <<delete>>
* <<open>>
* <<optimize>>
* <<replicas>>
* <<seal>>
* <<show>>
* <<snapshot>>

=== Help Output

This is the help output for <<index-selection,index selection>>.

----------
curator show indices --help
Usage: curator show indices [OPTIONS]

  Get a list of indices to act on from the provided arguments, then perform
  the command [alias, allocation, bloom, close, delete, etc.] on the
  resulting list.

Options:
  --newer-than INTEGER            Include only indices newer than n time_units
  --older-than INTEGER            Include only indices older than n time_units
  --prefix TEXT                   Include only indices beginning with prefix.
  --suffix TEXT                   Include only indices ending with suffix.
  --time-unit [hours|days|weeks|months]
                                  Unit of time to reckon by
  --timestring TEXT               Python strftime string to match your index
                                  definition, e.g. 2014.07.15 would be
                                  %Y.%m.%d
  --regex TEXT                    Provide your own regex, e.g
                                  '^prefix-.*-suffix$'
  --exclude TEXT                  Exclude matching indices. Can be invoked
                                  multiple times.
  --index TEXT                    Include the provided index in the list. Can
                                  be invoked multiple times.
  --all-indices                   Do not filter indices.  Act on all indices.
  --help                          Show this message and exit.
----------

&nbsp;

[[snapshots-subcommand]]
== snapshots

Commands using the `snapshots` subcommand:

* <<delete>>
* <<show>>

=== Help Output

This is the help output for <<snapshot-selection,snapshot selection>>.

----------
curator show snapshots --help
Usage: curator show snapshots [OPTIONS]

  Get a list of snapshots to act on from the provided arguments, then
  perform the command [delete, show] on the resulting list.

Options:
  --newer-than INTEGER            Include only snapshots newer than n
                                  time_units
  --older-than INTEGER            Include only snapshots older than n
                                  time_units
  --prefix TEXT                   Include only snapshots beginning with
                                  prefix.
  --suffix TEXT                   Include only snapshots ending with suffix.
  --time-unit [hours|days|weeks|months]
                                  Unit of time to reckon by
  --timestring TEXT               Python strftime string to match your
                                  snapshot's definition, e.g. 20140715020304
                                  would be %Y%m%d%H%M%S
  --regex TEXT                    Provide your own regex, e.g
                                  '^prefix-.*-suffix$'
  --exclude TEXT                  Exclude matching snapshots. Can be invoked
                                  multiple times.
  --snapshot TEXT                 Include the provided snapshot in the list.
                                  Can be invoked multiple times.
  --all-snapshots                 Do not filter snapshots.  Act on all
                                  snapshots.
  --repository TEXT               Repository name.
  --help                          Show this message and exit.
----------
