NAME

OpenSearch::Cluster - Cluster API

SYNOPSIS

use OpenSearch;
my $os = OpenSearch->new(
  ...
  async => 1
);

my $cluster = $os->cluster;

# When async is set, this returns a L<Mojo::Promise> object
# Otherwise, it returns a hashref with the JSON response. 
my $settings = $cluster->get_settings;

$cluster->put_settings(
  persistent => {
    'indices.recovery.max_bytes_per_sec' => '50mb'
  },
  transient => {
    'cluster.routing.allocation.enable' => 'all'
  }
  timeout => '30s'
);

my $health = $cluster->health(...);

DESCRIPTION

This module provides an interface to the OpenSearch Cluster API.

METHODS

get_settings

$cluster->get_settings;

put_settings

$cluster->put_settings(
  persistent => {
    'indices.recovery.max_bytes_per_sec' => '50mb'
  },
  transient => {
    'cluster.routing.allocation.enable' => 'all'
  }
  timeout => '30s'
);

health

$cluster->health(...);

stats

$cluster->stats(...);

allocation_explain

$cluster->allocation_explain(...);

AUTHOR

OpenSearch was written by Sebastian Grenz, <git at fail.ninja>