create

docker.config.create(name, file, labels={}, template_driver=None)

Create a config from a file

See the docker docs for more information about swarm configs.

Arguments

  • name str: The config name.
  • file Union[str, pathlib.Path]: Tbe file to be used as config.
  • labels Dict[str, str]: The labels to add to the config
  • template_driver Optional[str]: The template driver

Returns

A python_on_whales.Config object.


inspect

docker.config.inspect(x)

Returns a python_on_whales.Config object based on its name or id.

Argument

x: An id or name or a list of ids/names.

Returns

A python_on_whales.Config if a string was passed as argument. A List[python_on_whales.Config] if a list of strings was passed as argument.


list

docker.config.list(filters={})

List all config available in the swarm.

Arguments

  • filters Dict[str, str]: If you want to filter the results based on a given condition. For example, docker.config.list(filters=dict(label="my_label=hello")).

Returns

A List[python_on_whales.Config].


remove

docker.config.remove(x)

Remove one or more configs.

Arguments

  • x Union[python_on_whales.Config, str, List[Union[python_on_whales.Config, str]]]: One or a list of configs. Valid values are the id of the config or a python_on_whales.Config object. An empty list means the function call does nothing.