NAME

Search::Elasticsearch::Plugin::XPack::5_0::Security - Plugin providing Security API for Search::Elasticsearch 5.x

VERSION

version 5.02

SYNOPSIS

use Search::Elasticsearch();

my $es = Search::Elasticsearch->new(
    nodes    => \@nodes,
    plugins  => ['XPack'],
    userinfo => "username:password"
);

my $response = $es->security->authenticate();

DESCRIPTION

This class extends the Search::Elasticsearch client with a security namespace, to support the API for the Security plugin for Elasticsearch. In other words, it can be used as follows:

use Search::Elasticsearch();
my $es = Search::Elasticsearch->new(
    nodes    => \@nodes,
    plugins  => ['XPack'],
    userinfo => "username:password"
);

my $response = $es->security->authenticate(...);

METHODS

The full documentation for the Security plugin is available here: https://www.elastic.co/guide/en/x-pack/current/xpack-security.html

authenticate()

$response = $es->security->authenticate()

The authenticate() method checks that the userinfo is correct and returns a list of which roles are assigned to the user.

See the authenticate docs for more information.

Query string parameters: error_trace, human

put_user()

$response = $es->security->put_user(
    username => $username,     # required
    body     => {...}          # required
);

The put_user() method creates a new user or updates an existing user.

See the put_user docs for more information.

Query string parameters: error_trace, human

get_user()

$response = $es->security->get_user(
    username => $username | \@usernames     # optional
);

The get_user() method retrieves info for the specified users (or all users).

See the get_user docs for more information.

Query string parameters: error_trace, human

delete_user()

$response = $es->security->delete_user(
    username => $username       # required
);

The delete_user() method deletes the specified user.

See the delete_user docs for more information.

Query string parameters: error_trace, human

change_password()

$response = $es->security->change_password(
    username => $username       # optional
    body => {
        password => $password   # required
    }
)

The change_password() method changes the password for the specified user.

See the change_password docs for more information.

disable_user()

$response = $es->security->disable_user(
    username => $username       # required
);

The disable_user() method disables the specified user.

See the disable_user docs for more information.

Query string parameters: error_trace, human

enable_user()

$response = $es->security->enable_user(
    username => $username       # required
);

The enable_user() method enables the specified user.

See the enable_user docs for more information.

Query string parameters: error_trace, human

clear_cached_realms()

$response = $es->security->clear_cached_realms(
    realms => $realms       # required  (comma-separated string)
);

The clear_cached_realms() method clears the caches for the specified realms

Query string parameters: error_trace, human, usernames

See the clear_cached_realms docs for more information.

put_role()

$response = $es->security->put_role(
    name => $name,             # required
    body     => {...}          # required
);

The put_role() method creates a new role or updates an existing role.

See the put_role docs for more information.

Query string parameters: error_trace, human

get_role()

$response = $es->security->get_role(
    name => $name | \@names     # optional
);

The get_role() method retrieves info for the specified roles (or all roles).

See the get_role docs for more information.

Query string parameters: error_trace, human

delete_role()

$response = $es->security->delete_role(
    name => $name       # required
);

The delete_role() method deletes the specified role.

See the delete_role docs for more information.

Query string parameters: error_trace, human

clear_cached_roles()

$response = $es->security->clear_cached_roles(
    names => $names       # required  (comma-separated string)
);

The clear_cached_roles() method clears the caches for the specified roles.

See the clear_cached_roles docs for more information.

Query string parameters: error_trace, human

AUTHOR

Clinton Gormley <drtech@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2017 by Elasticsearch BV.

This is free software, licensed under:

The Apache License, Version 2.0, January 2004