Other Modules¶
curator.cli
¶
- curator.cli.process_action(client, action_def, dry_run=False)¶
Do the
action
inaction_def.action
, using the associated options and anykwargs
.- Parameters:
client (
Elasticsearch
) – A client connection objectaction_def (
ActionDef
) – Theaction
object
- Return type:
None
- curator.cli.ilm_action_skip(client, action_def)¶
Skip rollover action if
allow_ilm_indices
isfalse
. For all other non-snapshot actions, add theilm
filtertype to thefilters
list.
- curator.cli.exception_handler(action_def, err)¶
Do the grunt work with the exception
- curator.cli.run(ctx: Context) None ¶
- Parameters:
ctx (
Context
) – The Click command context
Called by
cli()
to execute what was collected at the command-line
- curator.cli.cli(ctx, config, hosts, cloud_id, id, api_key, username, password, bearer_auth, opaque_id, request_timeout, http_compress, verify_certs, ca_certs, client_cert, client_key, ssl_assert_hostname, ssl_assert_fingerprint, ssl_version, master_only, skip_version_test, dry_run, loglevel, logfile, logformat, action_file)¶
This is the
click.Command
that initiates everything and connects the command-line to the rest of Curator.- Parameters:
ctx (
Context
) – The Click Contextconfig (str) – Path to configuration file.
hosts (list) – Elasticsearch URL to connect to
cloud_id (str) – Shorthand to connect to Elastic Cloud instance
id (str) – API Key “id” value
api_key (str) – API Key “api_key” value
username (str) – Username used to create “basic_auth” tuple
password (str) – Password used to create “basic_auth” tuple
bearer_auth (str) – Bearer Auth Token
opaque_id (str) – Opaque ID string
request_timeout (int) – Request timeout in seconds
http_compress (bool) – Enable HTTP compression
verify_certs (bool) – Verify SSL/TLS certificate(s)
ca_certs (str) – Path to CA certificate file or directory
client_cert (str) – Path to client certificate file
client_key (str) – Path to client certificate key
ssl_assert_hostname (str) – Hostname or IP address to verify on the node’s certificate.
ssl_assert_fingerprint (str) – SHA-256 fingerprint of the node’s certificate. If this value is given then root-of-trust verification isn’t done and only the node’s certificate fingerprint is verified.
ssl_version (str) – Minimum acceptable TLS/SSL version
master_only (bool) – Only run if the single host provided is the elected master
skip_version_test (bool) – Do not check the host version
dry_run (bool) – Do not perform any changes.
loglevel (str) – Log level
logfile (str) – Path to log file
logformat (str) – Log output format
action_file (str) – Path to action file
curator.repomgrcli
¶
- curator.repomgrcli.delete_callback(ctx, param, value)¶
Callback if command
delete
calledIf the action is
delete
, this is theclick.Parameter
callback function if you used the--yes
flag.
- curator.repomgrcli.show_repos(client)¶
Show all repositories
- Parameters:
client (
Elasticsearch
) – A client connection object- Return type:
None
- curator.repomgrcli.get_client(ctx)¶
- Parameters:
ctx (
Context
) – Theclick
Context- Returns:
A client connection object
- Return type:
- curator.repomgrcli.create_repo(ctx, repo_name=None, repo_type=None, repo_settings=None, verify=False)¶
Call
create_repository()
to create a snapshot repository from the provided arguments
- curator.repomgrcli.azure(ctx, name, client, container, base_path, chunk_size, compress, max_restore_rate, max_snapshot_rate, readonly, location_mode, verify)¶
- Parameters:
ctx (
Context
) – The Click Contextname (str) – The repository name
client (str) – The named client (Azure)
container (str) – Container name. You must create the Azure container before creating the repository.
base_path (str) – Specifies the path within container to repository data. Defaults to empty (root directory).
chunk_size (str) – Chunk size, e.g.
1g
,10m
,5k
. Default is unbounded.compress (bool) – Enable/Disable metadata compression.
max_restore_rate (str) – Throttles per node restore rate (per second). Default is
20mb
.max_snapshot_rate (str) – Throttles per node restore rate (per second). Default is
20mb
.readonly (bool) – Make repsitory read-only.
location_mode (str) – Either
primary_only
orsecondary_only
. Note that if you set it tosecondary_only
, it will forcereadonly
toTrue
.verify (bool) – Verify repository after creation.
- curator.repomgrcli.gcs(ctx, name, bucket, client, base_path, chunk_size, compress, max_restore_rate, max_snapshot_rate, readonly, verify)¶
- Parameters:
ctx (
Context
) – The Click Contextname (str) – The repository name
client (str) – The name of the client to use to connect to Google Cloud Storage.
bucket (str) – The name of the bucket to be used for snapshots.
base_path (str) – Specifies the path within bucket to repository data. Defaults to the root of the bucket.
chunk_size (str) – Chunk size, e.g.
1g
,10m
,5k
. Default is unbounded.compress (bool) – Enable/Disable metadata compression.
max_restore_rate (str) – Throttles per node restore rate (per second). Default is
20mb
.max_snapshot_rate (str) – Throttles per node restore rate (per second). Default is
20mb
.readonly (bool) – Make repsitory read-only.
verify (bool) – Verify repository after creation.
- curator.repomgrcli.s3(ctx, name, bucket, client, base_path, chunk_size, compress, max_restore_rate, max_snapshot_rate, readonly, server_side_encryption, buffer_size, canned_acl, storage_class, verify)¶
- Parameters:
ctx (
Context
) – The Click Contextname (str) – The repository name
bucket (str) – The bucket name must adhere to Amazon’s S3 bucket naming rules.
client (str) – The name of the S3 client to use to connect to S3.
base_path (str) – Specifies the path to the repository data within its bucket. Defaults to an empty string, meaning that the repository is at the root of the bucket. The value of this setting should not start or end with a /.
chunk_size (str) – Chunk size, e.g.
1g
,10m
,5k
. Default is unbounded.compress (bool) – Enable/Disable metadata compression.
max_restore_rate (str) – Throttles per node restore rate (per second). Default is
20mb
.max_snapshot_rate (str) – Throttles per node restore rate (per second). Default is
20mb
.readonly (bool) – Make repsitory read-only.
server_side_encryption (bool) – If set, files are encrypted on server side using AES256 algorithm.
buffer_size (str) – Minimum threshold below which the chunk is uploaded using a single request. Must be between 5mb and 5gb.
canned_acl (str) – When the S3 repository creates buckets and objects, it adds the canned ACL into the buckets and objects.
storage_class (str) – Sets the S3 storage class for objects stored in the snapshot repository.
verify (bool) – Verify repository after creation.
- curator.repomgrcli.fs(ctx, name, location, compress, chunk_size, max_snapshots, max_restore_rate, max_snapshot_rate, readonly, verify)¶
- Parameters:
ctx (
Context
) – The Click Contextname (str) – The repository name
location (str) – Shared file-system location. Must match remote path, & be accessible to all master & data nodes
compress (bool) – Enable/Disable metadata compression.
chunk_size (str) – Chunk size, e.g.
1g
,10m
,5k
. Default is unbounded.max_snapshots (int) – Maximum number of snapshots the repository can contain. Defaults to
Integer.MAX_VALUE
, which is 2147483647.max_restore_rate (str) – Throttles per node restore rate (per second). Default is
20mb
.max_snapshot_rate (str) – Throttles per node restore rate (per second). Default is
20mb
.readonly (bool) – Make repsitory read-only.
verify (bool) – Verify repository after creation.
- curator.repomgrcli.url(ctx, name, chunk_size, http_max_retries, http_socket_timeout, compress, max_snapshots, max_restore_rate, shared_filesystem_url, verify)¶
- Parameters:
ctx (
Context
) – The Click Contextname (str) – The repository name
chunk_size (str) – Chunk size, e.g.
1g
,10m
,5k
. Default is unbounded.http_max_retries (int) – Maximum number of retries for http and https
http_socket_timeout (int) – Maximum wait time for data transfers over a connection.
compress (bool) – Enable/Disable metadata compression.
max_snapshots (int) – Maximum number of snapshots the repository can contain. Defaults to
Integer.MAX_VALUE
, which is 2147483647.max_restore_rate (str) – Throttles per node restore rate (per second). Default is
20mb
.shared_filesystem_url (str) – URL location of the root of the shared filesystem repository.
verify (bool) – Verify repository after creation.
- curator.repomgrcli.source(ctx, name, delegate_type, location, compress, chunk_size, max_snapshots, max_restore_rate, max_snapshot_rate, readonly, verify)¶
- Parameters:
ctx (
Context
) – The Click Contextname (str) – The repository name
delegate_type (str) – Delegated repository type.
location (str) – Shared file-system location. Must match remote path, & be accessible to all master & data nodes
compress (bool) – Enable/Disable metadata compression.
chunk_size (str) – Chunk size, e.g.
1g
,10m
,5k
. Default is unbounded.max_snapshots (int) – Maximum number of snapshots the repository can contain. Defaults to
Integer.MAX_VALUE
, which is 2147483647.max_restore_rate (str) – Throttles per node restore rate (per second). Default is
20mb
.max_snapshot_rate (str) – Throttles per node restore rate (per second). Default is
20mb
.readonly (bool) – Make repsitory read-only.
verify (bool) – Verify repository after creation.
- curator.repomgrcli.repo_mgr_cli(ctx, config, hosts, cloud_id, id, api_key, username, password, bearer_auth, opaque_id, request_timeout, http_compress, verify_certs, ca_certs, client_cert, client_key, ssl_assert_hostname, ssl_assert_fingerprint, ssl_version, master_only, skip_version_test, dry_run, loglevel, logfile, logformat)¶
- Parameters:
ctx (
Context
) – The Click Contextconfig (str) – Path to configuration file.
hosts (list) – Elasticsearch URL to connect to
cloud_id (str) – Shorthand to connect to Elastic Cloud instance
id (str) – API Key “id” value
api_key (str) – API Key “api_key” value
username (str) – Username used to create “basic_auth” tuple
password (str) – Password used to create “basic_auth” tuple
bearer_auth (str) – Bearer Auth Token
opaque_id (str) – Opaque ID string
request_timeout (int) – Request timeout in seconds
http_compress (bool) – Enable HTTP compression
verify_certs (bool) – Verify SSL/TLS certificate(s)
ca_certs (str) – Path to CA certificate file or directory
client_cert (str) – Path to client certificate file
client_key (str) – Path to client certificate key
ssl_assert_hostname (str) – Hostname or IP address to verify on the node’s certificate.
ssl_assert_fingerprint (str) – SHA-256 fingerprint of the node’s certificate. If this value is given then root-of-trust verification isn’t done and only the node’s certificate fingerprint is verified.
ssl_version (str) – Minimum acceptable TLS/SSL version
master_only (bool) – Only run if the single host provided is the elected master
skip_version_test (bool) – Do not check the host version
dry_run (bool) – Do not perform any changes. NON-FUNCTIONAL PLACEHOLDER! DO NOT USE!
loglevel (str) – Log level
logfile (str) – Path to log file
logformat (str) – Log output format