from curator.cli_singletons.open_indices import open_indices from curator.cli_singletons.replicas import replicas from curator.cli_singletons.restore import restore from curator.cli_singletons.rollover import rollover from curator.cli_singletons.snapshot import snapshot from curator.cli_singletons.shrink import shrink from curator.cli_singletons.show import show_indices, show_snapshots from curator.cli_singletons.freeze import freeze from curator.cli_singletons.unfreeze import unfreeze from curator._version import __version__ import logging logger = logging.getLogger(__name__) @click.group(context_settings=get_width()) @click.option('--config', help='Path to configuration file. Default: ~/.curator/curator.yml', type=click.Path(), default=settings.config_file()) @click.option('--host', help='Elasticsearch host.') @click.option('--url_prefix', help='Elasticsearch http url prefix.') @click.option('--port', help='Elasticsearch port.') @click.option('--use_ssl', is_flag=True, callback=false_to_none, help='Connect to Elasticsearch through SSL.') @click.option('--certificate', help='Path to certificate to use for SSL validation.') @click.option('--client-cert', help='Path to file containing SSL certificate for client auth.', type=str) @click.option('--client-key', help='Path to file containing SSL key for client auth.', type=str) @click.option('--ssl-no-validate', is_flag=True, callback=false_to_none, help='Do not validate SSL certificate') @click.option('--http_auth', help='Use Basic Authentication ex: user:pass') @click.option('--timeout', help='Connection timeout in seconds.', type=int) @click.option('--master-only', is_flag=True, callback=false_to_none, help='Only operate on elected master node.') @click.option('--dry-run', is_flag=True, help='Do not perform any changes.') @click.option('--loglevel', help='Log level') @click.option('--logfile', help='log file') @click.option('--logformat', help='Log output format [default|logstash|json].')
logger.error( 'Failed to complete action: {0}. {1}: ' '{2}'.format(action, type(e), e) ) if continue_if_exception: logger.info( 'Continuing execution with next action because ' '"continue_if_exception" is set to True for action ' '{0}'.format(action) ) else: sys.exit(1) logger.info('Action ID: {0}, "{1}" completed.'.format(idx, action)) logger.info('Job completed.') @click.command() @click.option('--config', help="Path to configuration file. Default: ~/.curator/curator.yml", type=click.Path(exists=True), default=settings.config_file() ) @click.option('--dry-run', is_flag=True, help='Do not perform any changes.') @click.argument('action_file', type=click.Path(exists=True), nargs=1) @click.version_option(version=__version__) def cli(config, dry_run, action_file): """ Curator for Elasticsearch indices. See http://elastic.co/guide/en/elasticsearch/client/curator/current """ run(config, action_file, dry_run)
from curator.cli_singletons.delete import delete_indices, delete_snapshots from curator.cli_singletons.forcemerge import forcemerge from curator.cli_singletons.open_indices import open_indices from curator.cli_singletons.replicas import replicas from curator.cli_singletons.restore import restore from curator.cli_singletons.rollover import rollover from curator.cli_singletons.snapshot import snapshot from curator.cli_singletons.shrink import shrink from curator.cli_singletons.show import show_indices, show_snapshots from curator._version import __version__ import logging logger = logging.getLogger(__name__) @click.group(context_settings=get_width()) @click.option('--config', help='Path to configuration file. Default: ~/.curator/curator.yml', type=click.Path(), default=settings.config_file()) @click.option('--host', help='Elasticsearch host.') @click.option('--url_prefix', help='Elasticsearch http url prefix.') @click.option('--port', help='Elasticsearch port.') @click.option('--use_ssl', is_flag=True, callback=false_to_none, help='Connect to Elasticsearch through SSL.') @click.option('--certificate', help='Path to certificate to use for SSL validation.') @click.option('--client-cert', help='Path to file containing SSL certificate for client auth.', type=str) @click.option('--client-key', help='Path to file containing SSL key for client auth.', type=str) @click.option('--ssl-no-validate', is_flag=True, callback=false_to_none, help='Do not validate SSL certificate') @click.option('--http_auth', help='Use Basic Authentication ex: user:pass') @click.option('--timeout', help='Connection timeout in seconds.', type=int) @click.option('--master-only', is_flag=True, callback=false_to_none, help='Only operate on elected master node.') @click.option('--dry-run', is_flag=True, help='Do not perform any changes.') @click.option('--loglevel', help='Log level') @click.option('--logfile', help='log file') @click.option('--logformat', help='Log output format [default|logstash|json].')
from curator.cli_singletons.restore import restore from curator.cli_singletons.rollover import rollover from curator.cli_singletons.snapshot import snapshot from curator.cli_singletons.shrink import shrink from curator.cli_singletons.show import show_indices, show_snapshots from curator.cli_singletons.freeze import freeze from curator.cli_singletons.unfreeze import unfreeze from curator._version import __version__ @click.group(context_settings=get_width()) @click.option( '--config', help='Path to configuration file. Default: ~/.curator/curator.yml', type=click.Path(), default=settings.config_file()) @click.option('--host', help='Elasticsearch host.') @click.option('--url_prefix', help='Elasticsearch http url prefix.') @click.option('--port', help='Elasticsearch port.') @click.option('--use_ssl', is_flag=True, callback=false_to_none, help='Connect to Elasticsearch through SSL.') @click.option('--certificate', help='Path to certificate to use for SSL validation.') @click.option('--client-cert', help='Path to file containing SSL certificate for client auth.', type=str) @click.option('--client-key', help='Path to file containing SSL key for client auth.', type=str)
from curator.cli_singletons.forcemerge import forcemerge from curator.cli_singletons.open_indices import open_indices from curator.cli_singletons.replicas import replicas from curator.cli_singletons.restore import restore from curator.cli_singletons.rollover import rollover from curator.cli_singletons.snapshot import snapshot from curator.cli_singletons.shrink import shrink from curator.cli_singletons.show import show_indices, show_snapshots from curator.cli_singletons.freeze import freeze from curator.cli_singletons.unfreeze import unfreeze from curator._version import __version__ @click.group(context_settings=get_width()) @click.option( '--config', help='Path to configuration file. Default: ~/.curator/curator.yml', type=click.Path(), default=settings.config_file() ) @click.option('--host', help='Elasticsearch host.') @click.option('--url_prefix', help='Elasticsearch http url prefix.') @click.option('--port', help='Elasticsearch port.') @click.option( '--use_ssl', is_flag=True, callback=false_to_none, help='Connect to Elasticsearch through SSL.' ) @click.option('--certificate', help='Path to certificate to use for SSL validation.') @click.option( '--client-cert', help='Path to file containing SSL certificate for client auth.', type=str) @click.option('--client-key', help='Path to file containing SSL key for client auth.', type=str) @click.option( '--ssl-no-validate', is_flag=True, callback=false_to_none, help='Do not validate SSL certificate'