NAME
API::Docker::Role::Entity::Volume - Volume operations, on the generated volume type
VERSION
version 0.004
SYNOPSIS
my $docker = API::Docker->new;
my ($volume) = @{ $docker->volumes->list };
say $volume->name;
say $volume->driver;
say $volume->mountpoint;
$volume->remove;
DESCRIPTION
The convenience methods of a volume. This role is composed, at load time, into API::Docker::Type::Volume, the generated class the daemon answers volume requests with.
One class for all three calls
A volume has one shape. The swagger answers GET /volumes/{name} and POST /volumes/create with the Volume definition outright, and GET /volumes with a VolumeListResponse whose Volumes is an array of that same definition -- which is why "list" in API::Docker::API::Volumes unwraps that one key and returns the entries, and why create hands back an entity where the other resources return the daemon's raw response.
The entity is addressed by name, not by id
A volume has no Id. Its name is its identifier on every endpoint, which is why this role requires 'name' where the container, image and network ones require id.
Every method here forwards to API::Docker::API::Volumes with the volume's own name and returns whatever that method returns; the options are that method's options, undocumented here on purpose so there is one place to correct when the engine's are found to be something else.
Why the methods are a role applied to a generated class rather than a class of their own: "DESCRIPTION" in API::Docker::Role::Entity.
inspect
my $fresh = $volume->inspect;
Get fresh volume information. Returns another API::Docker::Type::Volume -- the same class, since the daemon describes a volume one way.
remove
$volume->remove(force => 1);
Remove the volume.
SEE ALSO
API::Docker::API::Volumes - the operations these forward to
API::Docker::Type::Volume - the fields
list,inspectandcreatereturnAPI::Docker::Role::Entity - why the methods live in a role
SUPPORT
Issues
Please report bugs and feature requests on GitHub at https://github.com/Getty/p5-api-docker/issues.
CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
AUTHOR
Torsten Raudssus <getty@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.