docker-py API reference
111 public APIs from docker-py (docker/docker-py) — 32 classes, 2 functions, 77 methods. Signatures extracted by static analysis of the actual source.
Repository: docker/docker-py
| Kind | Count |
|---|---|
| Classes | 32 |
| Functions | 2 |
| Methods | 77 |
API list
class
docker.api.client.APIClientA low-level client for the Docker Engine API.
class
docker.client.DockerClientA client for communicating with a Docker server.
class
docker.context.api.ContextAPIContext API.
method
docker.context.api.ContextAPI.contexts()Context list.
method
docker.context.api.ContextAPI.get_context(name=None)Retrieves a context object.
method
docker.context.api.ContextAPI.get_current_context()Get current context.
method
docker.context.api.ContextAPI.inspect_context(name='default')Remove a context.
method
docker.context.api.ContextAPI.remove_context(name)Remove a context.
class
docker.context.context.ContextA context.
method
docker.credentials.store.Store.erase(server)Erase credentials for `server`.
method
docker.credentials.store.Store.get(server)Retrieve credentials for `server`.
method
docker.credentials.store.Store.list()List stored credentials.
method
docker.credentials.store.Store.store(server, username, secret)Store credentials for `server`.
class
docker.errors.APIErrorAn HTTP error from the API.
class
docker.errors.DockerExceptionA base class from which all other exceptions inherit.
class
docker.models.configs.ConfigA config.
method
docker.models.configs.Config.remove()Remove this config.
class
docker.models.configs.ConfigCollectionConfigs on the Docker server.
method
docker.models.configs.ConfigCollection.get(config_id)Get a config.
method
docker.models.configs.ConfigCollection.list(**kwargs)List configs.
class
docker.models.containers.ContainerLocal representation of a container object.
method
docker.models.containers.Container.attach(**kwargs)Attach to this container.
method
docker.models.containers.Container.image()The image of the container.
method
docker.models.containers.Container.logs(**kwargs)Get logs from this container.
method
docker.models.containers.Container.name()The name of the container.
method
docker.models.containers.Container.remove(**kwargs)Remove this container.
method
docker.models.containers.Container.rename(name)Rename this container.
method
docker.models.containers.Container.resize(height, width)Resize the tty session.
method
docker.models.containers.Container.restart(**kwargs)Restart this container.
method
docker.models.containers.Container.start(**kwargs)Start this container.
method
docker.models.containers.Container.status()The status of the container.
method
docker.models.containers.Container.stop(**kwargs)Stops a container.
class
docker.models.images.ImageAn image on the server.
method
docker.models.images.Image.history()Show the history of an image.
method
docker.models.images.Image.labels()The labels of an image as dictionary.
method
docker.models.images.Image.remove(force=False, noprune=False)Remove this image.
method
docker.models.images.Image.save(chunk_size=DEFAULT_DATA_CHUNK_SIZE, named=False)Get a tarball of an image.
method
docker.models.images.Image.tag(repository, tag=None, **kwargs)Tag this image into a repository.
method
docker.models.images.Image.tags()The image's tags.
method
docker.models.images.ImageCollection.build(**kwargs)Build an image and return it.
method
docker.models.images.ImageCollection.get(name)Gets an image.
method
docker.models.images.ImageCollection.list(name=None, all=False, filters=None)List images on the server.
method
docker.models.images.RegistryData.id()The ID of the object.
method
docker.models.images.RegistryData.pull(platform=None)Pull the image digest.
class
docker.models.networks.NetworkA Docker network.
method
docker.models.networks.Network.name()The name of the network.
method
docker.models.networks.Network.remove()Remove this network.
class
docker.models.networks.NetworkCollectionNetworks on the Docker server.
method
docker.models.networks.NetworkCollection.create(name, *args, **kwargs)Create a network.
method
docker.models.networks.NetworkCollection.get(network_id, *args, **kwargs)Get a network by its ID.
method
docker.models.networks.NetworkCollection.list(*args, **kwargs)List networks.
class
docker.models.nodes.NodeA node in a swarm.
method
docker.models.nodes.Node.remove(force=False)Remove this node from the swarm.
method
docker.models.nodes.Node.update(node_spec)Update the node's configuration.
method
docker.models.nodes.Node.version()The version number of the service.
class
docker.models.nodes.NodeCollectionNodes on the Docker server.
method
docker.models.nodes.NodeCollection.get(node_id)Get a node.
method
docker.models.nodes.NodeCollection.list(*args, **kwargs)List swarm nodes.
class
docker.models.plugins.PluginA plugin on the server.
method
docker.models.plugins.Plugin.configure(options)Update the plugin's settings.
method
docker.models.plugins.Plugin.disable(force=False)Disable the plugin.
method
docker.models.plugins.Plugin.enable(timeout=0)Enable the plugin.
method
docker.models.plugins.Plugin.enabled()Whether the plugin is enabled.
method
docker.models.plugins.Plugin.name()The plugin's name.
method
docker.models.plugins.Plugin.push()Push the plugin to a remote registry.
method
docker.models.plugins.Plugin.remove(force=False)Remove the plugin from the server.
method
docker.models.plugins.Plugin.upgrade(remote=None)Upgrade the plugin.
method
docker.models.plugins.PluginCollection.create(name, plugin_data_dir, gzip=False)Create a new plugin.
method
docker.models.plugins.PluginCollection.get(name)Gets a plugin.
method
docker.models.plugins.PluginCollection.install(remote_name, local_name=None)Pull and install a plugin.
method
docker.models.plugins.PluginCollection.list()List plugins installed on the server.
method
docker.models.resource.Collection.prepare_model(attrs)Create a model from a set of attributes.
class
docker.models.resource.ModelA base class for representing a single object on the server.
method
docker.models.resource.Model.id()The ID of the object.
class
docker.models.secrets.SecretA secret.
method
docker.models.secrets.Secret.remove()Remove this secret.
class
docker.models.secrets.SecretCollectionSecrets on the Docker server.
method
docker.models.secrets.SecretCollection.get(secret_id)Get a secret.
method
docker.models.secrets.SecretCollection.list(**kwargs)List secrets.
class
docker.models.services.ServiceA service.
method
docker.models.services.Service.logs(**kwargs)Get log stream for the service.
method
docker.models.services.Service.name()The service's name.
method
docker.models.services.Service.remove()Stop and remove the service.
method
docker.models.services.Service.scale(replicas)Scale service container.
method
docker.models.services.Service.update(**kwargs)Update a service's configuration.
method
docker.models.services.Service.version()The version number of the service.
class
docker.models.services.ServiceCollectionServices on the Docker server.
method
docker.models.services.ServiceCollection.create(image, command=None, **kwargs)Create a service.
method
docker.models.services.ServiceCollection.get(service_id, insert_defaults=None)Get a service.
method
docker.models.services.ServiceCollection.list(**kwargs)List services.
class
docker.models.swarm.SwarmThe server's Swarm state.
method
docker.models.swarm.Swarm.version()The version number of the swarm.
class
docker.models.volumes.VolumeA volume.
method
docker.models.volumes.Volume.name()The name of the volume.
method
docker.models.volumes.Volume.remove(force=False)Remove this volume.
class
docker.models.volumes.VolumeCollectionVolumes on the Docker server.
method
docker.models.volumes.VolumeCollection.create(name=None, **kwargs)Create a volume.
method
docker.models.volumes.VolumeCollection.get(volume_id)Get a volume.
method
docker.models.volumes.VolumeCollection.list(**kwargs)List volumes.
class
docker.tls.TLSConfigTLS configuration.
class
docker.types.daemon.CancellableStreamStream wrapper for real-time events, logs, etc.
method
docker.types.daemon.CancellableStream.close()Closes the event streaming.
class
docker.types.services.DriverConfigIndicates which driver to use, as well as its configuration.
class
docker.types.services.EndpointSpecDescribes properties to access and load-balance a service.
class
docker.types.services.MountDescribes a mounted folder's configuration inside a container.
class
docker.types.services.NetworkAttachmentConfigNetwork attachment options for a service.
class
docker.types.services.PrivilegesSecurity options for a service's containers.
class
docker.types.swarm.SwarmSpecDescribe a Swarm's configuration and options.
func
docker.utils.fnmatch.fnmatch(name, pat)Test whether FILENAME matches PATTERN.
class
docker.utils.proxy.ProxyConfigHold the client's proxy configuration
func
docker.utils.socket.read(socket, n=4096)Reads at most n bytes from socket
About this data
These signatures were extracted from the public source of docker/docker-py
using Python's ast module. Argument names, default values,
type annotations and return types are taken verbatim from the code.
Implementation bodies are never stored. See
how it works for details.