models.plugins

Module Contents

Classes

Plugin() A plugin on the server.
PluginCollection()
class Plugin

A plugin on the server.

__repr__()
name()

The plugin’s name.

enabled()

Whether the plugin is enabled.

settings()

A dictionary representing the plugin’s configuration.

configure(options)

Update the plugin’s settings.

Args:
options (dict): A key-value mapping of options.
Raises:
docker.errors.APIError
If the server returns an error.
disable()

Disable the plugin.

Raises:
docker.errors.APIError
If the server returns an error.
enable(timeout=0)

Enable the plugin.

Args:
timeout (int): Timeout in seconds. Default: 0
Raises:
docker.errors.APIError
If the server returns an error.
push()

Push the plugin to a remote registry.

Returns:
A dict iterator streaming the status of the upload.
Raises:
docker.errors.APIError
If the server returns an error.
remove(force=False)

Remove the plugin from the server.

Args:
force (bool): Remove even if the plugin is enabled.
Default: False
Raises:
docker.errors.APIError
If the server returns an error.
upgrade(remote=None)

Upgrade the plugin.

Args:
remote (string): Remote reference to upgrade to. The
:latest tag is optional and is the default if omitted. Default: this plugin’s name.
Returns:
A generator streaming the decoded API logs
class PluginCollection
create(name, plugin_data_dir, gzip=False)

Create a new plugin.

Args:
name (string): The name of the plugin. The :latest tag is
optional, and is the default if omitted.
plugin_data_dir (string): Path to the plugin data directory.
Plugin data directory must contain the config.json manifest file and the rootfs directory.

gzip (bool): Compress the context using gzip. Default: False

Returns:
(Plugin): The newly created plugin.
get(name)

Gets a plugin.

Args:
name (str): The name of the plugin.
Returns:
(Plugin): The plugin.
Raises:

docker.errors.NotFound If the plugin does not exist. docker.errors.APIError

If the server returns an error.
install(remote_name, local_name=None)

Pull and install a plugin.

Args:
remote_name (string): Remote reference for the plugin to
install. The :latest tag is optional, and is the default if omitted.
local_name (string): Local name for the pulled plugin.
The :latest tag is optional, and is the default if omitted. Optional.
Returns:
(Plugin): The installed plugin
Raises:
docker.errors.APIError
If the server returns an error.
list()

List plugins installed on the server.

Returns:
(list of Plugin): The plugins.
Raises:
docker.errors.APIError
If the server returns an error.