MogileFS-Client

 view release on metacpan or  search on metacpan

lib/MogileFS/Admin.pm  view on Meta::CPAN

# create a class within a domain
sub create_class {
    my MogileFS::Admin $self = shift;

    # wrapper around _mod_class(create)
    return $self->_mod_class(@_, 'create');
}


# update a class's mindevcount within a domain
sub update_class {
    my MogileFS::Admin $self = shift;

    # wrapper around _mod_class(update)
    return $self->_mod_class(@_, 'update');
}

# delete a class
sub delete_class {
    my MogileFS::Admin $self = shift;
    return undef if $self->{readonly};

lib/MogileFS/Admin.pm  view on Meta::CPAN

    return undef unless $host;

    my $args = shift;
    return undef unless ref $args eq 'HASH';
    return undef unless $args->{ip} && $args->{port};

    return $self->_mod_host($host, $args, 'create');
}

# edit a host
sub update_host {
    my MogileFS::Admin $self = shift;
    my $host = shift;
    return undef unless $host;

    my $args = shift;
    return undef unless ref $args eq 'HASH';

    return $self->_mod_host($host, $args, 'update');
}

lib/MogileFS/Admin.pm  view on Meta::CPAN


    my (%opts) = @_;   #hostname or hostid, devid, state (optional)

    my $res = $self->{backend}->do_request("create_device", \%opts)
        or return undef;

    return 1;
}

# edit a device
sub update_device {
    my MogileFS::Admin $self = shift;
    return undef if $self->{readonly};
    my $host = shift;
    my $device = shift;
    return undef unless $host;
    return undef unless $device;

    my $args = shift;
    return undef unless ref $args eq 'HASH';

lib/MogileFS/Client.pm  view on Meta::CPAN


=head2 update_class

    $mogc->update_class($key, $newclass);

Update the replication class of a pre-existing file, causing
the file to become more or less replicated.

=cut

sub update_class {
    my MogileFS::Client $self = shift;
    my ($key, $class) = @_;
    my $res = $self->{backend}->do_request
            ("updateclass", {
                domain => $self->{domain},
                key => $key,
                class => $class,
            }) or return undef;
    return $res;
}



( run in 0.402 second using v1.01-cache-2.11-cpan-4d4bc49f3ae )