Elasticsearch Curator Python API¶
The Elasticsearch Curator Python API helps you manage your indices and snapshots.
Note
This documentation is for the Elasticsearch Curator Python API. Documentation for the Elasticsearch Curator CLI – which uses this API and is installed as an entry_point as part of the package – is available in the Elastic guide.
Compatibility¶
The Elasticsearch Curator Python API is compatible with the 5.x Elasticsearch versions, and supports Python versions 2.7, and 3.5+.
Installation¶
Install the elasticsearch-curator
package with pip:
pip install elasticsearch-curator
Example Usage¶
import elasticsearch
import curator
client = elasticsearch.Elasticsearch()
ilo = curator.IndexList(client)
ilo.filter_by_regex(kind='prefix', value='logstash-')
ilo.filter_by_age(source='name', direction='older', timestring='%Y.%m.%d', unit='days', unit_count=30)
delete_indices = curator.DeleteIndices(ilo)
delete_indices.do_action()
Tip
See more examples in the Examples page.
Features¶
The API methods fall into the following categories:
Object Classes build and filter index list or snapshot list objects.
Action Classes act on object classes.
Utilities are helper methods.
Logging¶
The Elasticsearch Curator Python API uses the standard logging library from Python.
It inherits two loggers from elasticsearch-py
: elasticsearch
and
elasticsearch.trace
. Clients use the elasticsearch
logger to log
standard activity, depending on the log level. The elasticsearch.trace
logger logs requests to the server in JSON format as pretty-printed curl
commands that you can execute from the command line. The elasticsearch.trace
logger is not inherited from the base logger and must be activated separately.
Contents¶
- Object Classes
- Action Classes
- Filter Methods
- Utility & Helper Methods
TimestringSearch
absolute_date_range()
byte_size()
check_csv()
check_master()
check_version()
chunk_index_list()
create_repo_body()
create_repository()
create_snapshot_body()
date_range()
ensure_list()
find_snapshot_tasks()
fix_epoch()
get_client()
get_date_regex()
get_datemath()
get_datetime()
get_indices()
get_point_of_reference()
get_repository()
get_snapshot()
get_snapshot_data()
get_version()
get_yaml()
health_check()
index_size()
is_master_node()
name_to_node_id()
node_id_to_name()
node_roles()
parse_date_pattern()
parse_datemath()
prune_nones()
read_file()
relocate_check()
report_failure()
repository_exists()
restore_check()
rollable_alias()
safe_to_snap()
show_dry_run()
single_data_path()
snapshot_check()
snapshot_in_progress()
snapshot_running()
task_check()
test_client_options()
test_repo_fs()
to_csv()
validate_actions()
validate_filters()
verify_client_object()
verify_index_list()
verify_snapshot_list()
wait_for_it()
SchemaCheck
- Examples
- Changelog
- 5.8.1 (25 September 2019)
- 5.8.0 (24 September 2019)
- 5.7.6 (6 May 2019)
- 5.7.5 (26 April 2019)
- 5.7.4 (25 April 2019)
- 5.7.3 (24 April 2019)
- 5.7.2 (24 April 2019)
- 5.7.1 (24 April 2019)
- 5.7.0 (24 April 2019)
- 5.6.0 (13 November 2018)
- 5.5.4 (23 May 2018)
- 5.5.3 (21 May 2018)
- 5.5.2 (14 May 2018)
- 5.5.1 (22 March 2018)
- 5.5.0 (21 March 2018)
- 5.4.1 (6 December 2017)
- 5.4.0 (13 November 2017)
- 5.3.0 (31 October 2017)
- 5.2.0 (1 September 2017)
- 5.1.2 (08 August 2017)
- 5.1.1 (8 June 2017)
- 5.1.0 (8 June 2017)
- 5.0.4 (16 May 2017)
- 5.0.3 (15 May 2017)
- 5.0.2 (4 May 2017)
- 5.0.1 (10 April 2017)
- 5.0.0 (5 April 2017)
- 5.0.0a1 (23 March 2017)
- 4.2.6 (27 January 2016)
- 4.2.5 (22 December 2016)
- 4.2.4 (7 December 2016)
- 4.2.3.post1 (22 November 2016)
- 4.2.3 (21 November 2016)
- 4.2.2 (21 November 2016)
- 4.2.1 (8 November 2016)
- 4.2.0 (4 November 2016)
- 4.1.2 (6 October 2016)
- 4.1.1 (27 September 2016)
- 4.1.0 (6 September 2016)
- 4.0.6 (15 August 2016)
- 4.0.5 (3 August 2016)
- 4.0.4 (1 August 2016)
- 4.0.3 (22 July 2016)
- 4.0.2 (22 July 2016)
- 4.0.1 (1 July 2016)
- 4.0.0 (24 June 2016)
- 4.0.0b2 (16 June 2016)
- 4.0.0b1 (13 June 2016)
- 4.0.0a10 (10 June 2016)
- 4.0.0a9 (27 Apr 2016)
- 4.0.0a8 (26 Apr 2016)
- 4.0.0a7 (25 Apr 2016)
- 4.0.0a6 (25 Apr 2016)
- 4.0.0a4 (21 Apr 2016)
- 4.0.0a3 (21 Apr 2016)
- 3.5.1 (21 March 2016)
- 3.5.0 (16 March 2016)
- 3.4.1 (10 February 2016)
- 3.4.0 (28 October 2015)
- 3.3.0 (31 August 2015)
- 3.2.3 (16 July 2015)
- 3.2.2 (13 July 2015)
- 3.2.1 (10 July 2015)
- 3.2.0 (25 June 2015)
- 3.1.0 (21 May 2015)
- 3.0.3 (27 Mar 2015)
- 3.0.2 (23 Mar 2015)
- 3.0.1 (16 Mar 2015)
- 3.0.0 (9 March 2015)
- 3.0.0rc1 (5 March 2015)
- 3.0.0b4 (5 March 2015)
- 3.0.0b3 (4 March 2015)
- 3.0.0-beta2 (3 March 2015)
- 3.0.0-beta1 (3 March 2015)
- 2.1.2 (22 January 2015)
- 2.1.1 (30 December 2014)
- 2.1.0 (30 December 2014)
- 2.0.2 (8 October 2014)
- 2.0.1 (1 October 2014)
- 2.0.0 (25 September 2014)
- 1.2.2 (29 July 2014)
- 1.2.1 (24 July 2014)
- 1.2.0 (24 July 2014)
- 1.1.3 (18 July 2014)
- 1.1.2 (13 June 2014)
- 1.1.0 (12 June 2014)
- 1.0.0 (25 Mar 2014)
- 0.6.2 (18 Feb 2014)
- 0.6.1 (08 Feb 2014)
- 0.6.0 (08 Feb 2014)
- 0.5.2 (26 Jan 2014)
- 0.5.1 (20 Jan 2014)
- 0.5.0 (17 Jan 2014)
- 0.4.0
License¶
Copyright (c) 2012–2019 Elasticsearch <http://www.elastic.co>
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.