summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fontein <felix@fontein.de>2019-10-12 21:08:20 +0200
committerToshio Kuratomi <a.badger@gmail.com>2019-10-15 10:11:34 -0700
commit197e0a567baf1033f881781e6be7a54e74236538 (patch)
treecd996542bbe163c079bc07e790fb6303d46354ef
parentcfcee2d069c667d5a43ab81bfa832c7aeb1e2c57 (diff)
downloadansible-197e0a567baf1033f881781e6be7a54e74236538.tar.gz
docker modules: improve return value list documentation (#63145)
* Improve type documentation. * Also improve return values. (cherry picked from commit 7f643690c7535c2623c52809cd27b3231b9f0fa7)
-rw-r--r--lib/ansible/modules/cloud/docker/docker_compose.py11
-rw-r--r--lib/ansible/modules/cloud/docker/docker_host_info.py4
-rw-r--r--lib/ansible/modules/cloud/docker/docker_image_info.py1
-rw-r--r--lib/ansible/modules/cloud/docker/docker_node_info.py1
-rw-r--r--lib/ansible/modules/cloud/docker/docker_prune.py4
-rw-r--r--lib/ansible/modules/cloud/docker/docker_swarm.py5
-rw-r--r--lib/ansible/modules/cloud/docker/docker_swarm_info.py3
-rw-r--r--lib/ansible/modules/cloud/docker/docker_swarm_service.py1
8 files changed, 25 insertions, 5 deletions
diff --git a/lib/ansible/modules/cloud/docker/docker_compose.py b/lib/ansible/modules/cloud/docker/docker_compose.py
index 5e284cea87..6ea6e1e991 100644
--- a/lib/ansible/modules/cloud/docker/docker_compose.py
+++ b/lib/ansible/modules/cloud/docker/docker_compose.py
@@ -328,6 +328,7 @@ services:
description: One or more commands to be executed in the container.
returned: success
type: list
+ elements: str
example: ["postgres"]
image:
description: Name of the image from which the container was built.
@@ -337,12 +338,13 @@ services:
labels:
description: Meta data assigned to the container.
returned: success
- type: complex
+ type: dict
example: {...}
networks:
description: Contains a dictionary for each network to which the container is a member.
returned: success
- type: complex
+ type: list
+ elements: dict
contains:
IPAddress:
description: The IP address assigned to the container.
@@ -358,6 +360,7 @@ services:
description: Aliases assigned to the container by the network.
returned: success
type: list
+ elements: str
example: ['db']
globalIPv6:
description: IPv6 address assigned to the container.
@@ -373,6 +376,7 @@ services:
description: List of container names to which this container is linked.
returned: success
type: list
+ elements: str
example: null
macAddress:
description: Mac Address assigned to the virtual NIC.
@@ -382,7 +386,7 @@ services:
state:
description: Information regarding the current disposition of the container.
returned: success
- type: complex
+ type: dict
contains:
running:
description: Whether or not the container is up with a running process.
@@ -436,6 +440,7 @@ actions:
description: A descriptive name of the action to be performed on the service's containers.
returned: always
type: list
+ elements: str
contains:
id:
description: the container's long ID
diff --git a/lib/ansible/modules/cloud/docker/docker_host_info.py b/lib/ansible/modules/cloud/docker/docker_host_info.py
index f3bcf796e7..7c7df66ec2 100644
--- a/lib/ansible/modules/cloud/docker/docker_host_info.py
+++ b/lib/ansible/modules/cloud/docker/docker_host_info.py
@@ -155,6 +155,7 @@ volumes:
See description for I(verbose_output).
returned: When I(volumes) is C(yes)
type: list
+ elements: dict
networks:
description:
- List of dict objects containing the basic information about each network.
@@ -162,6 +163,7 @@ networks:
See description for I(verbose_output).
returned: When I(networks) is C(yes)
type: list
+ elements: dict
containers:
description:
- List of dict objects containing the basic information about each container.
@@ -169,6 +171,7 @@ containers:
See description for I(verbose_output).
returned: When I(containers) is C(yes)
type: list
+ elements: dict
images:
description:
- List of dict objects containing the basic information about each image.
@@ -176,6 +179,7 @@ images:
See description for I(verbose_output).
returned: When I(images) is C(yes)
type: list
+ elements: dict
disk_usage:
description:
- Information on summary disk usage by images, containers and volumes on docker host
diff --git a/lib/ansible/modules/cloud/docker/docker_image_info.py b/lib/ansible/modules/cloud/docker/docker_image_info.py
index 7ffe47a0e5..f3c3b79ccb 100644
--- a/lib/ansible/modules/cloud/docker/docker_image_info.py
+++ b/lib/ansible/modules/cloud/docker/docker_image_info.py
@@ -79,6 +79,7 @@ images:
- The list only contains inspection results of images existing locally.
returned: always
type: list
+ elements: dict
sample: [
{
"Architecture": "amd64",
diff --git a/lib/ansible/modules/cloud/docker/docker_node_info.py b/lib/ansible/modules/cloud/docker/docker_node_info.py
index b9094c9f16..63791abf8f 100644
--- a/lib/ansible/modules/cloud/docker/docker_node_info.py
+++ b/lib/ansible/modules/cloud/docker/docker_node_info.py
@@ -86,6 +86,7 @@ nodes:
managers and nodes that are unreachable.
returned: always
type: list
+ elements: dict
'''
import traceback
diff --git a/lib/ansible/modules/cloud/docker/docker_prune.py b/lib/ansible/modules/cloud/docker/docker_prune.py
index 32f0db7658..d7028015b5 100644
--- a/lib/ansible/modules/cloud/docker/docker_prune.py
+++ b/lib/ansible/modules/cloud/docker/docker_prune.py
@@ -124,6 +124,7 @@ containers:
- List of IDs of deleted containers.
returned: I(containers) is C(true)
type: list
+ elements: str
sample: '[]'
containers_space_reclaimed:
description:
@@ -138,6 +139,7 @@ images:
- List of IDs of deleted images.
returned: I(images) is C(true)
type: list
+ elements: str
sample: '[]'
images_space_reclaimed:
description:
@@ -152,6 +154,7 @@ networks:
- List of IDs of deleted networks.
returned: I(networks) is C(true)
type: list
+ elements: str
sample: '[]'
# volumes
@@ -160,6 +163,7 @@ volumes:
- List of IDs of deleted volumes.
returned: I(volumes) is C(true)
type: list
+ elements: str
sample: '[]'
volumes_space_reclaimed:
description:
diff --git a/lib/ansible/modules/cloud/docker/docker_swarm.py b/lib/ansible/modules/cloud/docker/docker_swarm.py
index 7886aeb5aa..304c2b12b8 100644
--- a/lib/ansible/modules/cloud/docker/docker_swarm.py
+++ b/lib/ansible/modules/cloud/docker/docker_swarm.py
@@ -236,12 +236,12 @@ RETURN = '''
swarm_facts:
description: Informations about swarm.
returned: success
- type: complex
+ type: dict
contains:
JoinTokens:
description: Tokens to connect to the Swarm.
returned: success
- type: complex
+ type: dict
contains:
Worker:
description: Token to create a new *worker* node
@@ -264,6 +264,7 @@ actions:
description: Provides the actions done on the swarm.
returned: when action failed.
type: list
+ elements: str
example: "['This cluster is already a swarm cluster']"
'''
diff --git a/lib/ansible/modules/cloud/docker/docker_swarm_info.py b/lib/ansible/modules/cloud/docker/docker_swarm_info.py
index 6a82d025e1..f82ce8f48d 100644
--- a/lib/ansible/modules/cloud/docker/docker_swarm_info.py
+++ b/lib/ansible/modules/cloud/docker/docker_swarm_info.py
@@ -175,6 +175,7 @@ nodes:
See description for I(verbose_output).
returned: When I(nodes) is C(yes)
type: list
+ elements: dict
services:
description:
- List of dict objects containing the basic information about each volume.
@@ -182,6 +183,7 @@ services:
See description for I(verbose_output).
returned: When I(services) is C(yes)
type: list
+ elements: dict
tasks:
description:
- List of dict objects containing the basic information about each volume.
@@ -189,6 +191,7 @@ tasks:
See description for I(verbose_output).
returned: When I(tasks) is C(yes)
type: list
+ elements: dict
'''
diff --git a/lib/ansible/modules/cloud/docker/docker_swarm_service.py b/lib/ansible/modules/cloud/docker/docker_swarm_service.py
index 7e43242b93..b3cd2b91c1 100644
--- a/lib/ansible/modules/cloud/docker/docker_swarm_service.py
+++ b/lib/ansible/modules/cloud/docker/docker_swarm_service.py
@@ -901,6 +901,7 @@ changes:
description:
- List of changed service attributes if a service has been altered, [] otherwise.
type: list
+ elements: str
sample: ['container_labels', 'replicas']
rebuilt:
returned: always