ArangoDB2

 view release on metacpan or  search on metacpan

lib/ArangoDB2/Replication.pm  view on Meta::CPAN

package ArangoDB2::Replication;

use strict;
use warnings;

use base qw(
    ArangoDB2::Base
);

use Data::Dumper;
use JSON::XS;

my $JSON = JSON::XS->new->utf8;



###############
# API METHODS #
###############

# applierConfig
#
# GET /_api/replication/applier-config
# PUT /_api/replication/applier-config
sub applierConfig
{
    my($self, $args) = @_;
    # process args
    $args = $self->_build_args($args, ['configuration']);
    # build path
    my $path = $self->api_path('replication', 'applier-config');
    # make request
    return $args->{configuration}
        ? $self->arango->http->put($path, $args)
        : $self->arango->http->get($path);
}

# applierStart
#
# PUT /_api/replication/applier-start
sub applierStart
{
    my($self, $args) = @_;
    # process args
    $args = $self->_build_args($args, ['from']);
    # make request
    return $self->arango->http->put(
        $self->api_path('replication', 'applier-start'),
        $args,
    );
}

# applierState
#
# GET /_api/replication/applier-state
sub applierState
{
    my($self) = @_;
    # make request
    return $self->arango->http->get(
        $self->api_path('replication', 'applier-state'),
    );
}

# applierStop
#
# PUT /_api/replication/applier-stop
sub applierStop
{
    my($self) = @_;
    # make request
    return $self->arango->http->get(
        $self->api_path('replication', 'applier-stop'),



( run in 1.808 second using v1.01-cache-2.11-cpan-39bf76dae61 )