Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional env.username + env.password #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ This original codes has out of maintenance, so I have started maintenance this p

* env.host - a elasticsearch node capable of providing stats interface (default localhost)
* env.port - elasticsearch HTTP API port (default 9200)
* env.username + env.password - optional HTTP API credentials

### Example Config

Expand Down
5 changes: 5 additions & 0 deletions elasticsearch_cache
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,14 @@ Kentaro Yoshida - https://github.com/y-ken

my $host = exists $ENV{'host'} ? $ENV{'host'} : 'localhost';
my $port = exists $ENV{'port'} ? $ENV{'port'} : 9200;
my $username = exists $ENV{'username'} ? $ENV{'username'} : '';
my $password = exists $ENV{'password'} ? $ENV{'password'} : '';

my $ua = LWP::UserAgent->new;
$ua->timeout(10);
if ($username and $password) {
$ua->credentials("$host:$port", 'security', $username, $password);
}

sub get_json_from_url {
my $uri = shift;
Expand Down
5 changes: 5 additions & 0 deletions elasticsearch_cluster_shards
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,14 @@ Kentaro Yoshida - https://github.com/y-ken

my $host = exists $ENV{'host'} ? $ENV{'host'} : 'localhost';
my $port = exists $ENV{'port'} ? $ENV{'port'} : 9200;
my $username = exists $ENV{'username'} ? $ENV{'username'} : '';
my $password = exists $ENV{'password'} ? $ENV{'password'} : '';

my $ua = LWP::UserAgent->new;
$ua->timeout(10);
if ($username and $password) {
$ua->credentials("$host:$port", 'security', $username, $password);
}

sub get_json_from_url {
my $uri = shift;
Expand Down
5 changes: 5 additions & 0 deletions elasticsearch_docs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,14 @@ Kentaro Yoshida - https://github.com/y-ken

my $host = exists $ENV{'host'} ? $ENV{'host'} : 'localhost';
my $port = exists $ENV{'port'} ? $ENV{'port'} : 9200;
my $username = exists $ENV{'username'} ? $ENV{'username'} : '';
my $password = exists $ENV{'password'} ? $ENV{'password'} : '';

my $ua = LWP::UserAgent->new;
$ua->timeout(10);
if ($username and $password) {
$ua->credentials("$host:$port", 'security', $username, $password);
}

sub get_json_from_url {
my $uri = shift;
Expand Down
5 changes: 5 additions & 0 deletions elasticsearch_gc_time
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,14 @@ Kentaro Yoshida - https://github.com/y-ken

my $host = exists $ENV{'host'} ? $ENV{'host'} : 'localhost';
my $port = exists $ENV{'port'} ? $ENV{'port'} : 9200;
my $username = exists $ENV{'username'} ? $ENV{'username'} : '';
my $password = exists $ENV{'password'} ? $ENV{'password'} : '';

my $ua = LWP::UserAgent->new;
$ua->timeout(10);
if ($username and $password) {
$ua->credentials("$host:$port", 'security', $username, $password);
}

sub get_json_from_url {
my $uri = shift;
Expand Down
5 changes: 5 additions & 0 deletions elasticsearch_index_size
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,14 @@ Kentaro Yoshida - https://github.com/y-ken

my $host = exists $ENV{'host'} ? $ENV{'host'} : 'localhost';
my $port = exists $ENV{'port'} ? $ENV{'port'} : 9200;
my $username = exists $ENV{'username'} ? $ENV{'username'} : '';
my $password = exists $ENV{'password'} ? $ENV{'password'} : '';

my $ua = LWP::UserAgent->new;
$ua->timeout(10);
if ($username and $password) {
$ua->credentials("$host:$port", 'security', $username, $password);
}

sub get_json_from_url {
my $uri = shift;
Expand Down
5 changes: 5 additions & 0 deletions elasticsearch_index_total
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,14 @@ Kentaro Yoshida - https://github.com/y-ken

my $host = exists $ENV{'host'} ? $ENV{'host'} : 'localhost';
my $port = exists $ENV{'port'} ? $ENV{'port'} : 9200;
my $username = exists $ENV{'username'} ? $ENV{'username'} : '';
my $password = exists $ENV{'password'} ? $ENV{'password'} : '';

my $ua = LWP::UserAgent->new;
$ua->timeout(10);
if ($username and $password) {
$ua->credentials("$host:$port", 'security', $username, $password);
}

sub get_json_from_url {
my $uri = shift;
Expand Down
5 changes: 5 additions & 0 deletions elasticsearch_jvm_memory
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,14 @@ Kentaro Yoshida - https://github.com/y-ken

my $host = exists $ENV{'host'} ? $ENV{'host'} : 'localhost';
my $port = exists $ENV{'port'} ? $ENV{'port'} : 9200;
my $username = exists $ENV{'username'} ? $ENV{'username'} : '';
my $password = exists $ENV{'password'} ? $ENV{'password'} : '';

my $ua = LWP::UserAgent->new;
$ua->timeout(10);
if ($username and $password) {
$ua->credentials("$host:$port", 'security', $username, $password);
}

sub get_json_from_url {
my $uri = shift;
Expand Down
5 changes: 5 additions & 0 deletions elasticsearch_jvm_pools_size
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,14 @@ Kentaro Yoshida - https://github.com/y-ken

my $host = exists $ENV{'host'} ? $ENV{'host'} : 'localhost';
my $port = exists $ENV{'port'} ? $ENV{'port'} : 9200;
my $username = exists $ENV{'username'} ? $ENV{'username'} : '';
my $password = exists $ENV{'password'} ? $ENV{'password'} : '';

my $ua = LWP::UserAgent->new;
$ua->timeout(10);
if ($username and $password) {
$ua->credentials("$host:$port", 'security', $username, $password);
}

sub get_json_from_url {
my $uri = shift;
Expand Down
5 changes: 5 additions & 0 deletions elasticsearch_jvm_threads
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,14 @@ Kentaro Yoshida - https://github.com/y-ken

my $host = exists $ENV{'host'} ? $ENV{'host'} : 'localhost';
my $port = exists $ENV{'port'} ? $ENV{'port'} : 9200;
my $username = exists $ENV{'username'} ? $ENV{'username'} : '';
my $password = exists $ENV{'password'} ? $ENV{'password'} : '';

my $ua = LWP::UserAgent->new;
$ua->timeout(10);
if ($username and $password) {
$ua->credentials("$host:$port", 'security', $username, $password);
}

sub get_json_from_url {
my $uri = shift;
Expand Down
5 changes: 5 additions & 0 deletions elasticsearch_open_files
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,14 @@ Kentaro Yoshida - https://github.com/y-ken

my $host = exists $ENV{'host'} ? $ENV{'host'} : 'localhost';
my $port = exists $ENV{'port'} ? $ENV{'port'} : 9200;
my $username = exists $ENV{'username'} ? $ENV{'username'} : '';
my $password = exists $ENV{'password'} ? $ENV{'password'} : '';

my $ua = LWP::UserAgent->new;
$ua->timeout(10);
if ($username and $password) {
$ua->credentials("$host:$port", 'security', $username, $password);
}

sub get_json_from_url {
my $uri = shift;
Expand Down