Skip to content

Commit 045bad2

Browse files
committed
Fix a number of docs formatting issues
Signed-off-by: Joffrey F <[email protected]>
1 parent 9c6d76f commit 045bad2

File tree

11 files changed

+96
-101
lines changed

11 files changed

+96
-101
lines changed

docker/api/container.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -388,13 +388,13 @@ def create_container(self, image, command=None, hostname=None, user=None,
388388
environment (dict or list): A dictionary or a list of strings in
389389
the following format ``["PASSWORD=xxx"]`` or
390390
``{"PASSWORD": "xxx"}``.
391-
dns (list): DNS name servers. Deprecated since API version 1.10.
392-
Use ``host_config`` instead.
393-
dns_opt (list): Additional options to be added to the container's
394-
``resolv.conf`` file
391+
dns (:py:class:`list`): DNS name servers. Deprecated since API
392+
version 1.10. Use ``host_config`` instead.
393+
dns_opt (:py:class:`list`): Additional options to be added to the
394+
container's ``resolv.conf`` file
395395
volumes (str or list):
396-
volumes_from (list): List of container names or Ids to get
397-
volumes from.
396+
volumes_from (:py:class:`list`): List of container names or Ids to
397+
get volumes from.
398398
network_disabled (bool): Disable networking
399399
name (str): A name for the container
400400
entrypoint (str or list): An entrypoint
@@ -478,19 +478,19 @@ def create_host_config(self, *args, **kwargs):
478478
device_write_bps: Limit write rate (bytes per second) from a
479479
device.
480480
device_write_iops: Limit write rate (IO per second) from a device.
481-
devices (list): Expose host devices to the container, as a list
482-
of strings in the form
481+
devices (:py:class:`list`): Expose host devices to the container,
482+
as a list of strings in the form
483483
``<path_on_host>:<path_in_container>:<cgroup_permissions>``.
484484
485485
For example, ``/dev/sda:/dev/xvda:rwm`` allows the container
486486
to have read-write access to the host's ``/dev/sda`` via a
487487
node named ``/dev/xvda`` inside the container.
488-
dns (list): Set custom DNS servers.
489-
dns_search (list): DNS search domains.
488+
dns (:py:class:`list`): Set custom DNS servers.
489+
dns_search (:py:class:`list`): DNS search domains.
490490
extra_hosts (dict): Addtional hostnames to resolve inside the
491491
container, as a mapping of hostname to IP address.
492-
group_add (list): List of additional group names and/or IDs that
493-
the container process will run as.
492+
group_add (:py:class:`list`): List of additional group names and/or
493+
IDs that the container process will run as.
494494
ipc_mode (str): Set the IPC mode for the container.
495495
isolation (str): Isolation technology to use. Default: `None`.
496496
links (dict or list of tuples): Either a dictionary mapping name
@@ -539,8 +539,8 @@ def create_host_config(self, *args, **kwargs):
539539
- ``Name`` One of ``on-failure``, or ``always``.
540540
- ``MaximumRetryCount`` Number of times to restart the
541541
container on failure.
542-
security_opt (list): A list of string values to customize labels
543-
for MLS systems, such as SELinux.
542+
security_opt (:py:class:`list`): A list of string values to
543+
customize labels for MLS systems, such as SELinux.
544544
shm_size (str or int): Size of /dev/shm (e.g. ``1G``).
545545
sysctls (dict): Kernel parameters to set in the container.
546546
tmpfs (dict): Temporary filesystems to mount, as a dictionary
@@ -555,13 +555,13 @@ def create_host_config(self, *args, **kwargs):
555555
'/mnt/vol1': 'size=3G,uid=1000'
556556
}
557557
558-
ulimits (list): Ulimits to set inside the container, as a list of
559-
dicts.
558+
ulimits (:py:class:`list`): Ulimits to set inside the container,
559+
as a list of dicts.
560560
userns_mode (str): Sets the user namespace mode for the container
561561
when user namespace remapping option is enabled. Supported
562562
values are: ``host``
563-
volumes_from (list): List of container names or IDs to get
564-
volumes from.
563+
volumes_from (:py:class:`list`): List of container names or IDs to
564+
get volumes from.
565565
566566
567567
Returns:
@@ -618,17 +618,17 @@ def create_endpoint_config(self, *args, **kwargs):
618618
:py:meth:`create_networking_config`.
619619
620620
Args:
621-
aliases (list): A list of aliases for this endpoint. Names in
622-
that list can be used within the network to reach the
621+
aliases (:py:class:`list`): A list of aliases for this endpoint.
622+
Names in that list can be used within the network to reach the
623+
container. Defaults to ``None``.
624+
links (:py:class:`list`): A list of links for this endpoint.
625+
Containers declared in this list will be linked to this
623626
container. Defaults to ``None``.
624-
links (list): A list of links for this endpoint. Containers
625-
declared in this list will be linked to this container.
626-
Defaults to ``None``.
627627
ipv4_address (str): The IP address of this container on the
628628
network, using the IPv4 protocol. Defaults to ``None``.
629629
ipv6_address (str): The IP address of this container on the
630630
network, using the IPv6 protocol. Defaults to ``None``.
631-
link_local_ips (list): A list of link-local (IPv4/IPv6)
631+
link_local_ips (:py:class:`list`): A list of link-local (IPv4/IPv6)
632632
addresses.
633633
634634
Returns:

docker/api/network.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ def networks(self, names=None, ids=None, filters=None):
1111
List networks. Similar to the ``docker networks ls`` command.
1212
1313
Args:
14-
names (list): List of names to filter by
15-
ids (list): List of ids to filter by
14+
names (:py:class:`list`): List of names to filter by
15+
ids (:py:class:`list`): List of ids to filter by
1616
filters (dict): Filters to be processed on the network list.
1717
Available filters:
1818
- ``driver=[<driver-name>]`` Matches a network's driver.
1919
- ``label=[<key>]`` or ``label=[<key>=<value>]``.
20-
- ``type=["custom"|"builtin"] `` Filters networks by type.
20+
- ``type=["custom"|"builtin"]`` Filters networks by type.
2121
2222
Returns:
2323
(dict): List of network objects.
@@ -169,17 +169,18 @@ def connect_container_to_network(self, container, net_id,
169169
Args:
170170
container (str): container-id/name to be connected to the network
171171
net_id (str): network id
172-
aliases (list): A list of aliases for this endpoint. Names in that
173-
list can be used within the network to reach the container.
174-
Defaults to ``None``.
175-
links (list): A list of links for this endpoint. Containers
176-
declared in this list will be linkedto this container.
177-
Defaults to ``None``.
172+
aliases (:py:class:`list`): A list of aliases for this endpoint.
173+
Names in that list can be used within the network to reach the
174+
container. Defaults to ``None``.
175+
links (:py:class:`list`): A list of links for this endpoint.
176+
Containers declared in this list will be linked to this
177+
container. Defaults to ``None``.
178178
ipv4_address (str): The IP address of this container on the
179179
network, using the IPv4 protocol. Defaults to ``None``.
180180
ipv6_address (str): The IP address of this container on the
181181
network, using the IPv6 protocol. Defaults to ``None``.
182-
link_local_ips (list): A list of link-local (IPv4/IPv6) addresses.
182+
link_local_ips (:py:class:`list`): A list of link-local
183+
(IPv4/IPv6) addresses.
183184
"""
184185
data = {
185186
"Container": container,

docker/api/service.py

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ def create_service(
1313
Create a service.
1414
1515
Args:
16-
task_template (dict): Specification of the task to start as part
17-
of the new service.
16+
task_template (TaskTemplate): Specification of the task to start as
17+
part of the new service.
1818
name (string): User-defined name for the service. Optional.
1919
labels (dict): A map of labels to associate with the service.
2020
Optional.
2121
mode (string): Scheduling mode for the service (``replicated`` or
2222
``global``). Defaults to ``replicated``.
23-
update_config (dict): Specification for the update strategy of the
24-
service. Default: ``None``
25-
networks (list): List of network names or IDs to attach the
26-
service to. Default: ``None``.
27-
endpoint_config (dict): Properties that can be configured to
23+
update_config (UpdateConfig): Specification for the update strategy
24+
of the service. Default: ``None``
25+
networks (:py:class:`list`): List of network names or IDs to attach
26+
the service to. Default: ``None``.
27+
endpoint_spec (EndpointSpec): Properties that can be configured to
2828
access and load balance a service. Default: ``None``.
2929
3030
Returns:
@@ -159,7 +159,7 @@ def tasks(self, filters=None):
159159
``label`` and ``desired-state``.
160160
161161
Returns:
162-
(list): List of task dictionaries.
162+
(:py:class:`list`): List of task dictionaries.
163163
164164
Raises:
165165
:py:class:`docker.errors.APIError`
@@ -186,20 +186,18 @@ def update_service(self, service, version, task_template=None, name=None,
186186
ID).
187187
version (int): The version number of the service object being
188188
updated. This is required to avoid conflicting writes.
189-
task_template (dict): Specification of the updated task to start
190-
as part of the service. See the [TaskTemplate
191-
class](#TaskTemplate) for details.
189+
task_template (TaskTemplate): Specification of the updated task to
190+
start as part of the service.
192191
name (string): New name for the service. Optional.
193192
labels (dict): A map of labels to associate with the service.
194193
Optional.
195194
mode (string): Scheduling mode for the service (``replicated`` or
196195
``global``). Defaults to ``replicated``.
197-
update_config (dict): Specification for the update strategy of the
198-
service. See the [UpdateConfig class](#UpdateConfig) for
199-
details. Default: ``None``.
200-
networks (list): List of network names or IDs to attach the
201-
service to. Default: ``None``.
202-
endpoint_config (dict): Properties that can be configured to
196+
update_config (UpdateConfig): Specification for the update strategy
197+
of the service. Default: ``None``.
198+
networks (:py:class:`list`): List of network names or IDs to attach
199+
the service to. Default: ``None``.
200+
endpoint_spec (EndpointSpec): Properties that can be configured to
203201
access and load balance a service. Default: ``None``.
204202
205203
Returns:

docker/api/swarm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ def join_swarm(self, remote_addrs, join_token, listen_addr=None,
143143
Make this Engine join a swarm that has already been created.
144144
145145
Args:
146-
remote_addrs (list): Addresses of one or more manager nodes already
147-
participating in the Swarm to join.
146+
remote_addrs (:py:class:`list`): Addresses of one or more manager
147+
nodes already participating in the Swarm to join.
148148
join_token (string): Secret token for joining this Swarm.
149149
listen_addr (string): Listen address used for inter-manager
150150
communication if the node gets promoted to manager, as well as

docker/models/containers.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -468,26 +468,26 @@ def run(self, image, command=None, stdout=True, stderr=False,
468468
device_write_bps: Limit write rate (bytes per second) from a
469469
device.
470470
device_write_iops: Limit write rate (IO per second) from a device.
471-
devices (list): Expose host devices to the container, as a list
472-
of strings in the form
471+
devices (:py:class:`list`): Expose host devices to the container,
472+
as a list of strings in the form
473473
``<path_on_host>:<path_in_container>:<cgroup_permissions>``.
474474
475475
For example, ``/dev/sda:/dev/xvda:rwm`` allows the container
476476
to have read-write access to the host's ``/dev/sda`` via a
477477
node named ``/dev/xvda`` inside the container.
478-
dns (list): Set custom DNS servers.
479-
dns_opt (list): Additional options to be added to the container's
480-
``resolv.conf`` file.
481-
dns_search (list): DNS search domains.
478+
dns (:py:class:`list`): Set custom DNS servers.
479+
dns_opt (:py:class:`list`): Additional options to be added to the
480+
container's ``resolv.conf`` file.
481+
dns_search (:py:class:`list`): DNS search domains.
482482
domainname (str or list): Set custom DNS search domains.
483483
entrypoint (str or list): The entrypoint for the container.
484484
environment (dict or list): Environment variables to set inside
485485
the container, as a dictionary or a list of strings in the
486486
format ``["SOMEVARIABLE=xxx"]``.
487487
extra_hosts (dict): Addtional hostnames to resolve inside the
488488
container, as a mapping of hostname to IP address.
489-
group_add (list): List of additional group names and/or IDs that
490-
the container process will run as.
489+
group_add (:py:class:`list`): List of additional group names and/or
490+
IDs that the container process will run as.
491491
hostname (str): Optional hostname for the container.
492492
ipc_mode (str): Set the IPC mode for the container.
493493
isolation (str): Isolation technology to use. Default: `None`.
@@ -517,8 +517,8 @@ def run(self, image, command=None, stdout=True, stderr=False,
517517
behavior. Accepts number between 0 and 100.
518518
memswap_limit (str or int): Maximum amount of memory + swap a
519519
container is allowed to consume.
520-
networks (list): A list of network names to connect this
521-
container to.
520+
networks (:py:class:`list`): A list of network names to connect
521+
this container to.
522522
name (str): The name for this container.
523523
network_disabled (bool): Disable networking.
524524
network_mode (str): One of:
@@ -574,8 +574,8 @@ def run(self, image, command=None, stdout=True, stderr=False,
574574
For example:
575575
``{"Name": "on-failure", "MaximumRetryCount": 5}``
576576
577-
security_opt (list): A list of string values to customize labels
578-
for MLS systems, such as SELinux.
577+
security_opt (:py:class:`list`): A list of string values to
578+
customize labels for MLS systems, such as SELinux.
579579
shm_size (str or int): Size of /dev/shm (e.g. ``1G``).
580580
stdin_open (bool): Keep ``STDIN`` open even if not attached.
581581
stdout (bool): Return logs from ``STDOUT`` when ``detach=False``.
@@ -598,8 +598,8 @@ def run(self, image, command=None, stdout=True, stderr=False,
598598
}
599599
600600
tty (bool): Allocate a pseudo-TTY.
601-
ulimits (list): Ulimits to set inside the container, as a list of
602-
dicts.
601+
ulimits (:py:class:`list`): Ulimits to set inside the container, as
602+
a list of dicts.
603603
user (str or int): Username or UID to run commands as inside the
604604
container.
605605
userns_mode (str): Sets the user namespace mode for the container
@@ -621,8 +621,8 @@ def run(self, image, command=None, stdout=True, stderr=False,
621621
{'/home/user1/': {'bind': '/mnt/vol2', 'mode': 'rw'},
622622
'/var/www': {'bind': '/mnt/vol1', 'mode': 'ro'}}
623623
624-
volumes_from (list): List of container names or IDs to get
625-
volumes from.
624+
volumes_from (:py:class:`list`): List of container names or IDs to
625+
get volumes from.
626626
working_dir (str): Path to the working directory.
627627
628628
Returns:

docker/models/networks.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,18 @@ def connect(self, container):
3232
container (str): Container to connect to this network, as either
3333
an ID, name, or :py:class:`~docker.models.containers.Container`
3434
object.
35-
aliases (list): A list of aliases for this endpoint. Names in that
36-
list can be used within the network to reach the container.
37-
Defaults to ``None``.
38-
links (list): A list of links for this endpoint. Containers
39-
declared in this list will be linkedto this container.
40-
Defaults to ``None``.
35+
aliases (:py:class:`list`): A list of aliases for this endpoint.
36+
Names in that list can be used within the network to reach the
37+
container. Defaults to ``None``.
38+
links (:py:class:`list`): A list of links for this endpoint.
39+
Containers declared in this list will be linkedto this
40+
container. Defaults to ``None``.
4141
ipv4_address (str): The IP address of this container on the
4242
network, using the IPv4 protocol. Defaults to ``None``.
4343
ipv6_address (str): The IP address of this container on the
4444
network, using the IPv6 protocol. Defaults to ``None``.
45-
link_local_ips (list): A list of link-local (IPv4/IPv6) addresses.
45+
link_local_ips (:py:class:`list`): A list of link-local (IPv4/IPv6)
46+
addresses.
4647
4748
Raises:
4849
:py:class:`docker.errors.APIError`
@@ -167,8 +168,8 @@ def list(self, *args, **kwargs):
167168
List networks. Similar to the ``docker networks ls`` command.
168169
169170
Args:
170-
names (list): List of names to filter by.
171-
ids (list): List of ids to filter by.
171+
names (:py:class:`list`): List of names to filter by.
172+
ids (:py:class:`list`): List of ids to filter by.
172173
173174
Returns:
174175
(list of :py:class:`Network`) The networks on the server.

0 commit comments

Comments
 (0)