Skip to content

docker config

ConfigCLI

create

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

Create a config from a file

See the docker docs for more information about swarm configs.

PARAMETER DESCRIPTION
name

The config name.

TYPE: str

file

Tbe file to be used as config.

TYPE: Union[str, Path]

labels

The labels to add to the config

TYPE: Dict[str, str] DEFAULT: {}

template_driver

The template driver

TYPE: Optional[str] DEFAULT: None

Returns

A `python_on_whales.Config` object.

inspect

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

list(filters={})

List all config available in the swarm.

PARAMETER DESCRIPTION
filters

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

TYPE: Dict[str, str] DEFAULT: {}

Returns

A `List[python_on_whales.Config]`.

remove

remove(x)

Remove one or more configs.

PARAMETER DESCRIPTION
x

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.

TYPE: Union[ValidConfig, List[ValidConfig]]