diff options
Diffstat (limited to 'ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_power.py')
-rw-r--r-- | ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_power.py | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_power.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_power.py index 65bdfbfd7..9487a2004 100644 --- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_power.py +++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_power.py @@ -3,11 +3,8 @@ # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated by vmware_rest_code_generator. -# See: https://github.com/ansible-collections/vmware_rest_code_generator -from __future__ import absolute_import, division, print_function - -__metaclass__ = type +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -73,21 +70,23 @@ options: type: bool vm: description: - - Identifier of the virtual machine. This parameter is mandatory. + - Identifier of the virtual machine. + - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_info). + This parameter is mandatory. required: true type: str author: - Ansible Cloud Team (@ansible-collections) version_added: 0.1.0 requirements: -- vSphere 7.0.2 or greater +- vSphere 7.0.3 or greater - python >= 3.6 - aiohttp seealso: - description: A module to boot, hard shutdown and hard reset guest module: vmware.vmware_rest.vcenter_vm_power notes: -- Tested on vSphere 7.0.2 +- Tested on vSphere 7.0.3 """ EXAMPLES = r""" @@ -141,13 +140,11 @@ value: # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "shutdown": {"query": {}, "body": {}, "path": {"vm": "vm"}}, "reboot": {"query": {}, "body": {}, "path": {"vm": "vm"}}, + "shutdown": {"query": {}, "body": {}, "path": {"vm": "vm"}}, "standby": {"query": {}, "body": {}, "path": {"vm": "vm"}}, } # pylint: disable=line-too-long -import json -import socket from ansible.module_utils.basic import env_fallback try: @@ -162,26 +159,27 @@ try: except ImportError: from ansible.module_utils.basic import AnsibleModule from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( - build_full_device_list, exists, gen_args, - get_device_info, get_subdevice_type, - list_devices, open_session, prepare_payload, - update_changed_flag, session_timeout, + update_changed_flag, ) def prepare_argument_spec(): argument_spec = { "vcenter_hostname": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_HOST"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_HOST"]), ), "vcenter_username": dict( - type="str", required=True, fallback=(env_fallback, ["VMWARE_USER"]), + type="str", + required=True, + fallback=(env_fallback, ["VMWARE_USER"]), ), "vcenter_password": dict( type="str", @@ -252,7 +250,6 @@ def build_url(params): async def entry_point(module, session): - if module.params["state"] == "present": if "_create" in globals(): operation = "create" |