API-Docker
view release on metacpan or search on metacpan
lib/API/Docker/Volume.pm view on Meta::CPAN
package API::Docker::Volume;
# ABSTRACT: Docker volume entity
our $VERSION = '0.002';
use Moo;
use namespace::clean;
has client => (
is => 'ro',
weak_ref => 1,
);
has Name => (is => 'ro');
has Driver => (is => 'ro');
has Mountpoint => (is => 'ro');
has CreatedAt => (is => 'ro');
has Status => (is => 'ro');
has Labels => (is => 'ro');
has Scope => (is => 'ro');
has Options => (is => 'ro');
has UsageData => (is => 'ro');
sub inspect {
my ($self) = @_;
return $self->client->volumes->inspect($self->Name);
}
sub remove {
my ($self, %opts) = @_;
return $self->client->volumes->remove($self->Name, %opts);
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
API::Docker::Volume - Docker volume entity
=head1 VERSION
version 0.002
=head1 SYNOPSIS
my $docker = API::Docker->new;
my $volumes = $docker->volumes->list;
my $volume = $volumes->[0];
say $volume->Name;
say $volume->Driver;
say $volume->Mountpoint;
$volume->remove;
=head1 DESCRIPTION
This class represents a Docker volume. Instances are returned by
L<API::Docker::API::Volumes> methods.
=head2 client
Reference to L<API::Docker> client.
=head2 Name
Volume name.
=head2 Driver
Volume driver (usually C<local>).
=head2 Mountpoint
Filesystem path where the volume is mounted on the host.
=head2 inspect
my $updated = $volume->inspect;
Get fresh volume information.
( run in 0.948 second using v1.01-cache-2.11-cpan-7fcb06a456a )