From 55afa7e944f91f4595988568b864ad14608de16b Mon Sep 17 00:00:00 2001 From: Constantin Bugneac Date: Tue, 20 Oct 2015 09:30:57 +0100 Subject: [PATCH] Added documentation for returned structure --- .../modules/cloud/amazon/ec2_ami_find.py | 100 +++++++++++++++++- 1 file changed, 99 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/amazon/ec2_ami_find.py b/lib/ansible/modules/cloud/amazon/ec2_ami_find.py index bf16dc6ae2a..b2c74333911 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_ami_find.py +++ b/lib/ansible/modules/cloud/amazon/ec2_ami_find.py @@ -163,6 +163,105 @@ EXAMPLES = ''' wait: yes ''' +RETURN = ''' +ami_id: + description: id of found amazon image + returned: when AMI found + type: string + sample: "ami-e9095e8c" +architecture: + description: architecture of image + returned: when AMI found + type: string + sample: "x86_64" +architecture: + description: architecture of image + returned: when AMI found + type: string + sample: "x86_64" +block_device_mapping: + description: block device mapping associated with image + returned: when AMI found + type: dictionary of block devices + sample: { + "/dev/xvda": { + "delete_on_termination": true, + "encrypted": false, + "size": 8, + "snapshot_id": "snap-ca0330b8", + "volume_type": "gp2" + } +creationDate: + description: creation date of image + returned: when AMI found + type: string + sample: "2015-10-15T22:43:44.000Z" +description: + description: description of image + returned: when AMI found + type: string + sample: "test-server01" +hypervisor: + description: type of hypervisor + returned: when AMI found + type: string + sample: "xen" +is_public: + description: whether image is public + returned: when AMI found + type: bool + sample: false +location: + description: location of image + returned: when AMI found + type: string + sample: "435210894375/test-server01-20151015-234343" +name: + description: ami name of image + returned: when AMI found + type: string + sample: "test-server01-20151015-234343" +owner_id: + description: owner of image + returned: when AMI found + type: string + sample: "435210894375" +platform: + description: plaform of image + returned: when AMI found + type: string + sample: null +root_device_name: + description: rood device name of image + returned: when AMI found + type: string + sample: "/dev/xvda" +root_device_type: + description: rood device type of image + returned: when AMI found + type: string + sample: "ebs" +state: + description: state of image + returned: when AMI found + type: string + sample: "available" +tags: + description: tags assigned to image + returned: when AMI found + type: dictionary of tags + sample: { + "Environment": "devel", + "Name": "test-server01", + "Role": "web" + } +virtualization_type: + description: image virtualization type + returned: when AMI found + type: string + sample: "hvm" +''' + try: import boto.ec2 from boto.ec2.blockdevicemapping import BlockDeviceType, BlockDeviceMapping @@ -323,4 +422,3 @@ from ansible.module_utils.ec2 import * if __name__ == '__main__': main() -