API-Docker
view release on metacpan or search on metacpan
lib/API/Docker/Role/Entity/Plugin.pm view on Meta::CPAN
C<< $plugin->settings->env >> is a list of C<KEY=value> B<strings>, which is
what L</configure> takes. C<< $plugin->config->env >> is a list of
L<API::Docker::Type::PluginEnv> objects describing those same variables --
same field name, two shapes. The daemon flattens the one into the other when
the plugin is installed. L</configure> writes to the settings, never to the
config.
=head2 Not available on Podman
Managed plugins are a Docker feature: none of these endpoints exist on
Podman, so nothing in this role works against it. See
L<API::Docker::API::Plugins/"Not available on Podman">.
Why the methods are a role applied to a generated class rather than a class
of their own: L<API::Docker::Role::Entity/DESCRIPTION>.
=head2 inspect
my $fresh = $plugin->inspect;
Get fresh plugin information. Returns another L<API::Docker::Type::Plugin> --
the same class, since the daemon describes a plugin one way.
=head2 enable
$plugin->enable;
$plugin->enable(timeout => 30);
Enable the plugin.
=head2 disable
$plugin->disable(force => 1);
Disable the plugin.
=head2 remove
$plugin->remove(force => 1);
Remove the plugin. An enabled plugin is refused without C<force>.
=head2 configure
$plugin->configure(['DEBUG=1']);
$plugin->configure('DEBUG=1', 'sshkey.source=/tmp');
Set the plugin's user-configurable settings. The plugin must be disabled
first. The settings are the C<KEY=value> strings of
C<< $plugin->settings->env >>, not the objects of C<< $plugin->config->env >>
-- see L</"Two shapes of Env, one level apart">.
=head2 upgrade
my $privileges = $docker->plugins->privileges($plugin->plugin_reference);
$plugin->upgrade(remote => $plugin->plugin_reference,
privileges => $privileges);
Upgrade the plugin in place. C<privileges> is required, as it is on
L<API::Docker::API::Plugins/upgrade>, and C<remote> defaults to
L<API::Docker::Type::Plugin/name> -- which is not what you want for a
plugin installed under a local name, hence
C<< ->plugin_reference >>.
=head2 push
$plugin->push(auth => { username => 'me', password => 'secret' });
Push the plugin to a registry. B<This writes to a real registry> under the
credentials given.
C<push> shadows the Perl builtin inside this package, which is why
L<namespace::clean> is loaded. Always call it as a method.
=head1 SEE ALSO
=over
=item * L<API::Docker::API::Plugins> - the operations these forward to
=item * L<API::Docker::Type::Plugin> - the fields C<list> and C<inspect>
return
=item * L<API::Docker::Role::Entity> - why the methods live in a role
=back
=head1 SUPPORT
=head2 Issues
Please report bugs and feature requests on GitHub at
L<https://github.com/Getty/p5-api-docker/issues>.
=head1 CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
=head1 AUTHOR
Torsten Raudssus <getty@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> L<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.
=cut
( run in 0.650 second using v1.01-cache-2.11-cpan-6736b670a1e )