Plugins

Manage plugins on the server.

Methods available on client.plugins:

class PluginCollection
get(name)

Gets a plugin.

Parameters:

name (str) – The name of the plugin.

Returns:

The plugin.

Return type:

(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.

Parameters:
  • 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:

The installed plugin

Return type:

(Plugin)

Raises:

docker.errors.APIError – If the server returns an error.

list()

List plugins installed on the server.

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

Plugin objects

class Plugin

A plugin on the server.

id

The ID of the object.

short_id

The ID of the object, truncated to 10 characters.

name

The plugin’s name.

enabled

Whether the plugin is enabled.

settings

A dictionary representing the plugin’s configuration.

attrs

The raw representation of this object from the server.

configure(options)

Update the plugin’s settings.

Parameters: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.

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

Load this object from the server again and update attrs with the new data.

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.

Parameters: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.

Parameters:remote (string) – Remote reference to upgrade to. The

:param :latest tag is optional and is the default if omitted.: :param Default: this plugin’s name.

Returns:A generator streaming the decoded API logs