summaryrefslogtreecommitdiff
path: root/docker/models
diff options
context:
space:
mode:
Diffstat (limited to 'docker/models')
-rw-r--r--docker/models/containers.py32
-rw-r--r--docker/models/networks.py19
-rw-r--r--docker/models/services.py20
3 files changed, 35 insertions, 36 deletions
diff --git a/docker/models/containers.py b/docker/models/containers.py
index ad1cb61..b1cdd8f 100644
--- a/docker/models/containers.py
+++ b/docker/models/containers.py
@@ -468,17 +468,17 @@ class ContainerCollection(Collection):
device_write_bps: Limit write rate (bytes per second) from a
device.
device_write_iops: Limit write rate (IO per second) from a device.
- devices (list): Expose host devices to the container, as a list
- of strings in the form
+ devices (:py:class:`list`): Expose host devices to the container,
+ as a list of strings in the form
``<path_on_host>:<path_in_container>:<cgroup_permissions>``.
For example, ``/dev/sda:/dev/xvda:rwm`` allows the container
to have read-write access to the host's ``/dev/sda`` via a
node named ``/dev/xvda`` inside the container.
- dns (list): Set custom DNS servers.
- dns_opt (list): Additional options to be added to the container's
- ``resolv.conf`` file.
- dns_search (list): DNS search domains.
+ dns (:py:class:`list`): Set custom DNS servers.
+ dns_opt (:py:class:`list`): Additional options to be added to the
+ container's ``resolv.conf`` file.
+ dns_search (:py:class:`list`): DNS search domains.
domainname (str or list): Set custom DNS search domains.
entrypoint (str or list): The entrypoint for the container.
environment (dict or list): Environment variables to set inside
@@ -486,8 +486,8 @@ class ContainerCollection(Collection):
format ``["SOMEVARIABLE=xxx"]``.
extra_hosts (dict): Addtional hostnames to resolve inside the
container, as a mapping of hostname to IP address.
- group_add (list): List of additional group names and/or IDs that
- the container process will run as.
+ group_add (:py:class:`list`): List of additional group names and/or
+ IDs that the container process will run as.
hostname (str): Optional hostname for the container.
ipc_mode (str): Set the IPC mode for the container.
isolation (str): Isolation technology to use. Default: `None`.
@@ -517,8 +517,8 @@ class ContainerCollection(Collection):
behavior. Accepts number between 0 and 100.
memswap_limit (str or int): Maximum amount of memory + swap a
container is allowed to consume.
- networks (list): A list of network names to connect this
- container to.
+ networks (:py:class:`list`): A list of network names to connect
+ this container to.
name (str): The name for this container.
network_disabled (bool): Disable networking.
network_mode (str): One of:
@@ -574,8 +574,8 @@ class ContainerCollection(Collection):
For example:
``{"Name": "on-failure", "MaximumRetryCount": 5}``
- security_opt (list): A list of string values to customize labels
- for MLS systems, such as SELinux.
+ security_opt (:py:class:`list`): A list of string values to
+ customize labels for MLS systems, such as SELinux.
shm_size (str or int): Size of /dev/shm (e.g. ``1G``).
stdin_open (bool): Keep ``STDIN`` open even if not attached.
stdout (bool): Return logs from ``STDOUT`` when ``detach=False``.
@@ -598,8 +598,8 @@ class ContainerCollection(Collection):
}
tty (bool): Allocate a pseudo-TTY.
- ulimits (list): Ulimits to set inside the container, as a list of
- dicts.
+ ulimits (:py:class:`list`): Ulimits to set inside the container, as
+ a list of dicts.
user (str or int): Username or UID to run commands as inside the
container.
userns_mode (str): Sets the user namespace mode for the container
@@ -621,8 +621,8 @@ class ContainerCollection(Collection):
{'/home/user1/': {'bind': '/mnt/vol2', 'mode': 'rw'},
'/var/www': {'bind': '/mnt/vol1', 'mode': 'ro'}}
- volumes_from (list): List of container names or IDs to get
- volumes from.
+ volumes_from (:py:class:`list`): List of container names or IDs to
+ get volumes from.
working_dir (str): Path to the working directory.
Returns:
diff --git a/docker/models/networks.py b/docker/models/networks.py
index d5e2097..a80c9f5 100644
--- a/docker/models/networks.py
+++ b/docker/models/networks.py
@@ -32,17 +32,18 @@ class Network(Model):
container (str): Container to connect to this network, as either
an ID, name, or :py:class:`~docker.models.containers.Container`
object.
- aliases (list): A list of aliases for this endpoint. Names in that
- list can be used within the network to reach the container.
- Defaults to ``None``.
- links (list): A list of links for this endpoint. Containers
- declared in this list will be linkedto this container.
- Defaults to ``None``.
+ aliases (:py:class:`list`): A list of aliases for this endpoint.
+ Names in that list can be used within the network to reach the
+ container. Defaults to ``None``.
+ links (:py:class:`list`): A list of links for this endpoint.
+ Containers declared in this list will be linkedto this
+ container. Defaults to ``None``.
ipv4_address (str): The IP address of this container on the
network, using the IPv4 protocol. Defaults to ``None``.
ipv6_address (str): The IP address of this container on the
network, using the IPv6 protocol. Defaults to ``None``.
- link_local_ips (list): A list of link-local (IPv4/IPv6) addresses.
+ link_local_ips (:py:class:`list`): A list of link-local (IPv4/IPv6)
+ addresses.
Raises:
:py:class:`docker.errors.APIError`
@@ -167,8 +168,8 @@ class NetworkCollection(Collection):
List networks. Similar to the ``docker networks ls`` command.
Args:
- names (list): List of names to filter by.
- ids (list): List of ids to filter by.
+ names (:py:class:`list`): List of names to filter by.
+ ids (:py:class:`list`): List of ids to filter by.
Returns:
(list of :py:class:`Network`) The networks on the server.
diff --git a/docker/models/services.py b/docker/models/services.py
index d70c9e7..ef6c3e3 100644
--- a/docker/models/services.py
+++ b/docker/models/services.py
@@ -42,7 +42,7 @@ class Service(Model):
``label``, and ``desired-state``.
Returns:
- (list): List of task dictionaries.
+ (:py:class:`list`): List of task dictionaries.
Raises:
:py:class:`docker.errors.APIError`
@@ -92,29 +92,27 @@ class ServiceCollection(Collection):
args (list of str): Arguments to the command.
constraints (list of str): Placement constraints.
container_labels (dict): Labels to apply to the container.
- endpoint_spec (dict): Properties that can be configured to
+ endpoint_spec (EndpointSpec): Properties that can be configured to
access and load balance a service. Default: ``None``.
env (list of str): Environment variables, in the form
``KEY=val``.
labels (dict): Labels to apply to the service.
log_driver (str): Log driver to use for containers.
log_driver_options (dict): Log driver options.
- mode (string): Scheduling mode for the service (``replicated`` or
+ mode (str): Scheduling mode for the service (``replicated`` or
``global``). Defaults to ``replicated``.
mounts (list of str): Mounts for the containers, in the form
``source:target:options``, where options is either
``ro`` or ``rw``.
name (str): Name to give to the service.
- networks (list): List of network names or IDs to attach the
- service to. Default: ``None``.
- resources (dict): Resource limits and reservations. For the
- format, see the Remote API documentation.
- restart_policy (dict): Restart policy for containers. For the
- format, see the Remote API documentation.
+ networks (list of str): List of network names or IDs to attach
+ the service to. Default: ``None``.
+ resources (Resources): Resource limits and reservations.
+ restart_policy (RestartPolicy): Restart policy for containers.
stop_grace_period (int): Amount of time to wait for
containers to terminate before forcefully killing them.
- update_config (dict): Specification for the update strategy of the
- service. Default: ``None``
+ update_config (UpdateConfig): Specification for the update strategy
+ of the service. Default: ``None``
user (str): User to run commands as.
workdir (str): Working directory for commands to run.