NAME
Data::AnyXfer::Elastic::ServerDict - Logic for server selection and metadata lookup
SYNOPSIS
# Create dictionary from env
my
$dict
= Data::AnyXfer::Elastic::ServerDict->from_env;
# Or manually add server definitions
my
$dict
= Data::AnyXfer::Elastic::ServerDict->new;
$dict
->add_server_definition(
$def
);
# Now lookup information needed for connecting or importing
# data
my
@nodes
=
$dict
->all_testing_nodes;
my
@nodes
=
$dict
->all_development_nodes;
my
@nodes
=
$dict
->get_silo_nodes(
'public_data'
);
DESCRIPTION
This class provides the metadata and connection info lookup logic for Data::AnyXfer::Elastic to locate or populate your Elasticsearch instances.
METHODS
from_env
# Create dictionary from env
my
$dict
= Data::AnyXfer::Elastic::ServerDict->from_env;
Creates a server dict using "load_from_env" in Data::AnyXfer::Elastic::ServerDefinition.
Returns a new Data::AnyXfer::Elastic::ServerDict instance.
add_server_definition
$dict
->add_server_definition(
Data::AnyXfer::Elastic::ServerDefinition->new( ... )
);
Adds a server definition to the
LOOKUP METHODS
all_production_nodes
my
@nodes
=
$dict
->all_production_nodes;
Return connection details for all elasticsearch nodes in the production
environment.
all_development_nodes
my
@nodes
=
$dict
->all_development_nodes;
Return connection details for all elasticsearch nodes in the development
environment.
all_testing_nodes
my
$nodes
=
$dict
->all_testing_nodes;
Return connection details for all elasticsearch nodes in the testing
environment.
list_silos
my
@silo_names
=
$dict
->list_silos;
Retrieves all known silo names..
get_silo_nodes
my
@node_groups
=
$dict
->get_silo_nodes(
$silo_name
);
Retrieves groups of nodes assigned to clusters tagged with the given silo.
get_silo_write_nodes
my
@node_groups
=
$dict
->get_silo_write_nodes(
$silo_name
);
Retrieves groups of nodes assigned to clusters tagged with the given silo, like get_silo_nodes
but looks for a cluser_nodes
definition, before falling back to nodes
.
get_node_version
my
$version
=
$dict
->get_node_version(
'test-es-1.example.com:9200'
);
Returns the target node's elasticsearch version as defined by all matching Data::AnyXfer::Elastic::ServerDefinition instances belonging to this ServerDict.
COPYRIGHT
This software is copyright (c) 2019, Anthony Lucas.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 27:
Non-ASCII character seen before =encoding in '# data'. Assuming UTF-8