Skip to content

PluginCLI

create

create(plugin_name, plugin_data_directory, compress=False)

Create a plugin from a rootfs and configuration.

Parameters:

Name Type Description Default
plugin_name str

The name you want to give to your plugin

required
plugin_data_directory ValidPath

Must contain config.json and rootfs directory.

required
compress bool

Compress the context using gzip

False

disable

disable(plugin, force=False)

Disable a plugin

Parameters:

Name Type Description Default
plugin ValidPlugin

The plugin to disable

required
force bool

Force the disable of an active plugin

False

enable

enable(plugin, timeout=None)

Enable a plugin

Parameters:

Name Type Description Default
plugin ValidPlugin

The plugin to enable

required
timeout int

HTTP client timeout (in seconds) (default 30)

None

inspect

inspect(x)

Returns a python_on_whales.Plugin object from a string (name or id of the plugin)

Parameters:

Name Type Description Default
x Union[str, List[str]]

One id or hostname or a list of name or ids

required

Returns

One or a list of `python_on_whales.Plugin`

install

install(plugin_name, configuration={}, alias=None, disable=False, disable_content_trust=True)

Installs a Docker plugin

Warning: --grant-all-permissions is enabled, which means the program won't stop to ask you to grant the permissions.

Parameters:

Name Type Description Default
plugin_name str

The name of the plugin you want to install

required
configuration Dict[str, str]

A dict adding configuration options to the plugin

{}
alias Optional[str]

Local name for plugin

None
disable bool

Do not enable the plugin on install

False
disable_content_trust bool

Skip image verification (default True)

True

Returns

A `python_on_whales.Plugin`.

list

list()

Returns a List[python_on_whales.Plugin that are installed on the daemon.

push

push(plugin, disable_content_trust=True)

Push a plugin to a registry.

Parameters:

Name Type Description Default
plugin ValidPlugin

The plugin to push

required
disable_content_trust bool

Skip image signing (default True)

True

remove

remove(x, force=False)

Removes one or more plugins

Parameters:

Name Type Description Default
x Union[ValidPlugin, List[ValidPlugin]]

One or more plugins to remove.

required
force bool

Force the removal of this plugin.

False

set

set(plugin, configuration)

Change the settings for a plugin

Parameters:

Name Type Description Default
plugin ValidPlugin

The plugin that needs its settings changed

required
configuration Dict[str, str]

The new configuration options.

required

upgrade

upgrade(plugin, remote=None, disable_content_trust=True, skip_remote_check=False)

Upgrade a plugin

Warning: --grant-all-permissions is enabled, which means the program won't stop to ask you to grant the permissions.

Parameters:

Name Type Description Default
plugin ValidPlugin

The plugin to upgrade

required
remote Optional[str]

The remote to fetch the upgrade from

None
disable_content_trust bool

Skip image verification (default True)

True
skip_remote_check bool

Do not check if specified remote plugin matches existing plugin image

False