summaryrefslogtreecommitdiffstats
path: root/ansible_collections/vmware/vmware_rest/plugins/modules
diff options
context:
space:
mode:
Diffstat (limited to 'ansible_collections/vmware/vmware_rest/plugins/modules')
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_consolecli.py27
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_consolecli_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_dcui.py27
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_dcui_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_shell.py27
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_shell_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_ssh.py27
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_ssh_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_applmgmt_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_database_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_databasestorage_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_load_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_mem_info.py30
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_softwarepackages_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_storage_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_swap_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_system_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_infraprofile_configs.py27
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_infraprofile_configs_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_localaccounts_globalpolicy.py30
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_localaccounts_globalpolicy_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_localaccounts_info.py27
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_monitoring_info.py31
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_monitoring_query.py38
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking.py28
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_domains.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_domains_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_hostname.py27
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_hostname_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_servers.py33
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_servers_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_firewall_inbound.py39
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_firewall_inbound_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_interfaces_info.py31
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_interfaces_ipv4.py42
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_interfaces_ipv4_info.py33
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_interfaces_ipv6.py31
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_interfaces_ipv6_info.py33
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_noproxy.py27
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_noproxy_info.py39
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_proxy.py55
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_proxy_info.py27
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_ntp.py27
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_ntp_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_services.py33
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_services_info.py31
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_shutdown.py31
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_shutdown_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_globalfips.py34
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_globalfips_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_storage.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_storage_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_time_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_time_timezone.py27
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_time_timezone_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_version_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_timesync.py31
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_timesync_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_update_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_vmon_service.py33
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/appliance_vmon_service_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/content_configuration.py30
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/content_configuration_info.py29
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/content_library_item_info.py27
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/content_locallibrary.py49
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/content_locallibrary_info.py27
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/content_subscribedlibrary.py61
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/content_subscribedlibrary_info.py27
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_cluster_info.py49
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_datacenter.py49
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_datacenter_info.py46
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_datastore_info.py52
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_folder_info.py51
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_host.py60
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_host_info.py55
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_network_info.py48
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_ovf_libraryitem.py37
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_resourcepool.py102
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_resourcepool_info.py55
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_storage_policies_info.py32
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm.py649
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_customization.py154
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_filesystem_directories.py86
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_identity_info.py33
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_localfilesystem_info.py33
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_networking_info.py33
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_networking_interfaces_info.py33
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_networking_routes_info.py33
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_operations_info.py33
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_power.py33
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_power_info.py33
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware.py47
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_adapter_sata.py52
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_adapter_sata_info.py35
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_adapter_scsi.py59
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_adapter_scsi_info.py35
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_boot.py53
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_boot_device.py58
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_boot_device_info.py35
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_boot_info.py33
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_cdrom.py97
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_cdrom_info.py35
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_cpu.py70
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_cpu_info.py33
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_disk.py141
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_disk_info.py35
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_ethernet.py117
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_ethernet_info.py35
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_floppy.py67
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_floppy_info.py35
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_info.py33
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_memory.py64
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_memory_info.py33
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_parallel.py67
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_parallel_info.py35
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_serial.py110
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_serial_info.py35
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_info.py55
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_libraryitem_info.py33
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_power.py35
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_power_info.py33
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_storage_policy.py53
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_storage_policy_compliance.py38
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_storage_policy_compliance_info.py33
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_storage_policy_info.py33
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_tools.py36
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_tools_info.py33
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_tools_installer.py39
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_tools_installer_info.py33
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vmtemplate_libraryitems.py45
-rw-r--r--ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vmtemplate_libraryitems_info.py29
132 files changed, 2937 insertions, 2961 deletions
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_consolecli.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_consolecli.py
index cdf6511c0..1c1a3eb10 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_consolecli.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_consolecli.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"""
@@ -75,11 +72,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -102,8 +99,6 @@ PAYLOAD_FORMAT = {
"set": {"query": {}, "body": {"enabled": "enabled"}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -118,26 +113,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",
@@ -204,7 +200,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_consolecli_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_consolecli_info.py
index d14bfae21..a14c9672a 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_consolecli_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_consolecli_info.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"""
@@ -64,11 +61,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -90,8 +87,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -106,26 +101,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_dcui.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_dcui.py
index d314ae39c..1e5c26e0b 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_dcui.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_dcui.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"""
@@ -75,11 +72,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -102,8 +99,6 @@ PAYLOAD_FORMAT = {
"set": {"query": {}, "body": {"enabled": "enabled"}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -118,26 +113,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",
@@ -202,7 +198,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_dcui_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_dcui_info.py
index b7009c91a..33d64ae48 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_dcui_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_dcui_info.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"""
@@ -64,11 +61,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -90,8 +87,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -106,26 +101,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_shell.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_shell.py
index 9962b04be..5cc4377f1 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_shell.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_shell.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"""
@@ -83,11 +80,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -123,8 +120,6 @@ PAYLOAD_FORMAT = {
}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -139,26 +134,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",
@@ -224,7 +220,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_shell_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_shell_info.py
index 1821b6b60..78cc1a29a 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_shell_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_shell_info.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"""
@@ -66,11 +63,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -95,8 +92,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -111,26 +106,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_ssh.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_ssh.py
index d48605e82..85add817c 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_ssh.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_ssh.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"""
@@ -75,11 +72,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -103,8 +100,6 @@ PAYLOAD_FORMAT = {
"set": {"query": {}, "body": {"enabled": "enabled"}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -119,26 +114,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",
@@ -203,7 +199,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_ssh_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_ssh_info.py
index fd6b47701..debb75fd4 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_ssh_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_access_ssh_info.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"""
@@ -64,11 +61,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -91,8 +88,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -107,26 +102,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_applmgmt_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_applmgmt_info.py
index 56563f611..ce822f432 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_applmgmt_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_applmgmt_info.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"""
@@ -64,11 +61,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -91,8 +88,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -107,26 +102,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_database_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_database_info.py
index 0a73c8e14..2b6c5e41b 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_database_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_database_info.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"""
@@ -64,11 +61,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -85,8 +82,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -101,26 +96,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_databasestorage_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_databasestorage_info.py
index c45b70893..c23c4b5cf 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_databasestorage_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_databasestorage_info.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"""
@@ -64,11 +61,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -91,8 +88,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -107,26 +102,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_load_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_load_info.py
index 682073a76..a5f632627 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_load_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_load_info.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"""
@@ -64,11 +61,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -91,8 +88,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -107,26 +102,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_mem_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_mem_info.py
index 4d36033c8..4e02ed37b 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_mem_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_mem_info.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"""
@@ -64,11 +61,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -78,6 +75,7 @@ EXAMPLES = r"""
"""
RETURN = r"""
+
# content generated by the update_return_section callback# task: Get the system mem status
value:
description: Get the system mem status
@@ -91,8 +89,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -107,26 +103,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_softwarepackages_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_softwarepackages_info.py
index 0ced96666..da749d9c6 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_softwarepackages_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_softwarepackages_info.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"""
@@ -69,11 +66,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -96,8 +93,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -112,26 +107,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_storage_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_storage_info.py
index abe8be6a2..d334c03e2 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_storage_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_storage_info.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"""
@@ -64,11 +61,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -91,8 +88,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -107,26 +102,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_swap_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_swap_info.py
index 1dd108a64..ba7c51d40 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_swap_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_swap_info.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"""
@@ -64,11 +61,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -91,8 +88,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -107,26 +102,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_system_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_system_info.py
index ba094ada2..2102647d2 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_system_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_health_system_info.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"""
@@ -64,11 +61,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -91,8 +88,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -107,26 +102,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_infraprofile_configs.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_infraprofile_configs.py
index 5bb72f120..8c685fde6 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_infraprofile_configs.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_infraprofile_configs.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"""
@@ -88,11 +85,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -137,8 +134,6 @@ PAYLOAD_FORMAT = {
}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -153,26 +148,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",
@@ -241,7 +237,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_infraprofile_configs_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_infraprofile_configs_info.py
index 61e865798..ae36681b4 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_infraprofile_configs_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_infraprofile_configs_info.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"""
@@ -64,11 +61,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -97,8 +94,6 @@ PAYLOAD_FORMAT = {
"list": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -113,26 +108,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_localaccounts_globalpolicy.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_localaccounts_globalpolicy.py
index 6193406ee..ee3fe2a1f 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_localaccounts_globalpolicy.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_localaccounts_globalpolicy.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"""
@@ -19,11 +16,13 @@ options:
description:
- Maximum number of days a password may be used. If the password is older
than this, a password change will be forced.
+ - If unset then the restriction will be ignored.
type: int
min_days:
description:
- Minimum number of days allowed between password changes. Any password changes
attempted sooner than this will be rejected.
+ - If unset then the restriction will be ignored.
type: int
session_timeout:
description:
@@ -80,16 +79,17 @@ options:
description:
- Number of days warning given before a password expires. A zero means warning
is given only upon the day of expiration.
+ - If unset then no warning will be provided.
type: int
author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -120,8 +120,6 @@ PAYLOAD_FORMAT = {
}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -136,26 +134,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",
@@ -224,7 +223,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_localaccounts_globalpolicy_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_localaccounts_globalpolicy_info.py
index 6894e980e..6ae13879d 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_localaccounts_globalpolicy_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_localaccounts_globalpolicy_info.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"""
@@ -64,11 +61,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -94,8 +91,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -110,26 +105,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_localaccounts_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_localaccounts_info.py
index 80c561463..a0ef2687b 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_localaccounts_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_localaccounts_info.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"""
@@ -68,11 +65,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -124,8 +121,6 @@ PAYLOAD_FORMAT = {
"list": {"query": {}, "body": {}, "path": {}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -143,23 +138,23 @@ from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest imp
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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_monitoring_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_monitoring_info.py
index 9bd24c17d..d554c1b34 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_monitoring_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_monitoring_info.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"""
@@ -25,7 +22,9 @@ options:
version_added: 2.1.0
stat_id:
description:
- - statistic item id Required with I(state=['get'])
+ - statistic item id
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.appliance_monitoring_info).
+ Required with I(state=['get'])
type: str
vcenter_hostname:
description:
@@ -68,11 +67,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -918,8 +917,6 @@ PAYLOAD_FORMAT = {
"list": {"query": {}, "body": {}, "path": {}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -937,23 +934,23 @@ from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest imp
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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_monitoring_query.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_monitoring_query.py
index af56df191..b9a7aea23 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_monitoring_query.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_monitoring_query.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"""
@@ -27,7 +24,8 @@ options:
- MAX
- MIN
description:
- - C(function_type) Defines aggregation function This parameter is mandatory.
+ - I(function_type) enumerated type Defines aggregation function This parameter
+ is mandatory.
required: true
type: str
interval:
@@ -38,13 +36,15 @@ options:
- MINUTES30
- MINUTES5
description:
- - C(interval_type) Defines interval between the values in hours and mins, for
- which aggregation will apply This parameter is mandatory.
+ - I(interval_type) enumerated type Defines interval between the values in
+ hours and mins, for which aggregation will apply This parameter is mandatory.
required: true
type: str
names:
description:
- - 'monitored item IDs Ex: CPU, MEMORY This parameter is mandatory.'
+ - 'monitored item IDs Ex: CPU, MEMORY'
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.appliance_monitoring_info).
elements: str
required: true
type: list
@@ -102,11 +102,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -164,8 +164,6 @@ PAYLOAD_FORMAT = {
}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -180,26 +178,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",
@@ -277,7 +276,6 @@ def build_url(params):
async def entry_point(module, session):
-
func = globals()["_query"]
return await func(module.params, session)
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking.py
index f5e5ed6f9..38e5c6c27 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking.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"""
@@ -20,6 +17,7 @@ options:
ipv6_enabled:
description:
- IPv6 Enabled or not
+ - If unspecified, leaves the current state of Ipv6.
type: bool
session_timeout:
description:
@@ -77,11 +75,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -111,8 +109,6 @@ PAYLOAD_FORMAT = {
"update": {"query": {}, "body": {"ipv6_enabled": "ipv6_enabled"}, "path": {}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -127,26 +123,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",
@@ -215,7 +212,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_domains.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_domains.py
index 670fef6e0..accfb894d 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_domains.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_domains.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"""
@@ -80,11 +77,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -112,12 +109,10 @@ value:
# This structure describes the format of the data expected by the end-points
PAYLOAD_FORMAT = {
- "set": {"query": {}, "body": {"domains": "domains"}, "path": {}},
"add": {"query": {}, "body": {"domain": "domain"}, "path": {}},
+ "set": {"query": {}, "body": {"domains": "domains"}, "path": {}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -132,26 +127,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",
@@ -223,7 +219,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_domains_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_domains_info.py
index 5f0fc5ab7..32305e7cb 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_domains_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_domains_info.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"""
@@ -64,11 +61,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -91,8 +88,6 @@ PAYLOAD_FORMAT = {
"list": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -107,26 +102,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_hostname.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_hostname.py
index 6e764f653..5278d94ea 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_hostname.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_hostname.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"""
@@ -76,11 +73,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -110,8 +107,6 @@ PAYLOAD_FORMAT = {
"set": {"query": {}, "body": {"name": "name"}, "path": {}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -126,26 +121,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",
@@ -216,7 +212,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_hostname_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_hostname_info.py
index c8fc059bf..73d948fbc 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_hostname_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_hostname_info.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"""
@@ -64,11 +61,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -91,8 +88,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -107,26 +102,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_servers.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_servers.py
index 137dadf33..4bee9ebdb 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_servers.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_servers.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"""
@@ -21,8 +18,8 @@ options:
- dhcp
- is_static
description:
- - C(dns_server_mode) Describes DNS Server source (DHCP,static) Required with
- I(state=['set'])
+ - I(dns_server_mode) enumerated type Describes DNS Server source (DHCP,static)
+ Required with I(state=['set'])
type: str
server:
description:
@@ -90,11 +87,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -144,12 +141,10 @@ value:
# This structure describes the format of the data expected by the end-points
PAYLOAD_FORMAT = {
"test": {"query": {}, "body": {"servers": "servers"}, "path": {}},
- "set": {"query": {}, "body": {"mode": "mode", "servers": "servers"}, "path": {}},
"add": {"query": {}, "body": {"server": "server"}, "path": {}},
+ "set": {"query": {}, "body": {"mode": "mode", "servers": "servers"}, "path": {}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -164,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",
@@ -256,7 +252,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_servers_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_servers_info.py
index 6cfb9a51a..82b50b7f4 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_servers_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_dns_servers_info.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"""
@@ -64,11 +61,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -94,8 +91,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -110,26 +105,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_firewall_inbound.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_firewall_inbound.py
index 4398c2a27..b1eb55b16 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_firewall_inbound.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_firewall_inbound.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"""
@@ -18,14 +15,7 @@ description: 'Set the ordered list of firewall rules to allow or deny traffic fr
one or more incoming IP addresses. This overwrites the existing firewall rules
and creates a new rule list. Within the list of traffic rules, rules are processed
in order of appearance, from top to bottom. For example, the list of rules can
- be as follows: <table> <tr> <th>Address</th><th>Prefix</th><th>Interface Name</th><th>Policy</th>
- </tr> <tr> <td>10.112.0.1</td><td>0</td><td>*</td><td>REJECT</td> </tr> <tr> <td>10.112.0.1</td><td>0</td><td>nic0</td><td>ACCEPT</td>
- </tr> </table> In the above example, the first rule drops all packets originating
- from 10.112.0.1 and<br> the second rule accepts all packets originating from 10.112.0.1
- only on nic0. In effect, the second rule is always ignored which is not desired,
- hence the order has to be swapped. When a connection matches a firewall rule,
- further processing for the connection stops, and the appliance ignores any additional
- firewall rules you have set.'
+ be as follows: [dropped table ]'
options:
rules:
description:
@@ -36,7 +26,8 @@ options:
- ' - C(prefix) (int): CIDR prefix used to mask address. For example, an IPv4
prefix of 24 ignores the low-order 8 bits of address. ([''set''])'
- ' This key is required with [''set''].'
- - ' - C(policy) (str): C(policy) Defines firewall rule policies. ([''set''])'
+ - ' - C(policy) (str): I(policy) enumerated type Defines firewall rule policies.
+ ([''set''])'
- ' This key is required with [''set''].'
- ' - Accepted values:'
- ' - ACCEPT'
@@ -103,11 +94,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -146,8 +137,6 @@ PAYLOAD_FORMAT = {
"set": {"query": {}, "body": {"rules": "rules"}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -162,26 +151,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",
@@ -248,7 +238,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_firewall_inbound_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_firewall_inbound_info.py
index 5f874f28d..dbe5616c0 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_firewall_inbound_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_firewall_inbound_info.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"""
@@ -67,11 +64,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -94,8 +91,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -110,26 +105,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_info.py
index 48c364894..ebf11dd3f 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_info.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"""
@@ -64,11 +61,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -118,8 +115,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -134,26 +129,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_interfaces_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_interfaces_info.py
index 12ff0d9d8..9d08ce5b9 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_interfaces_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_interfaces_info.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"""
@@ -17,7 +14,9 @@ description: Get information about a particular network interface.
options:
interface_name:
description:
- - Network interface, for example, "nic0". Required with I(state=['get'])
+ - Network interface, for example, "nic0".
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.appliance_networking_interfaces_info).
+ Required with I(state=['get'])
type: str
session_timeout:
description:
@@ -68,11 +67,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -125,8 +124,6 @@ PAYLOAD_FORMAT = {
"list": {"query": {}, "body": {}, "path": {}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -144,23 +141,23 @@ from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest imp
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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_interfaces_ipv4.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_interfaces_ipv4.py
index 28a2e5e5d..2f2b96f71 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_interfaces_ipv4.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_interfaces_ipv4.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"""
@@ -18,6 +15,8 @@ options:
address:
description:
- The IPv4 address, for example, "10.20.80.191".
+ - This field is optional and it is only relevant when the value of I(mode)
+ is STATIC.
type: str
default_gateway:
description:
@@ -27,10 +26,13 @@ options:
However, if the gateway address is link-local, then it is added for that
interface. This does not support configuration of multiple global default
gateways through different interfaces.
+ - If unset, the defaultGateway was never set.
type: str
interface_name:
description:
- - Network interface to update, for example, "nic0". This parameter is mandatory.
+ - Network interface to update, for example, "nic0".
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.appliance_networking_interfaces_info).
+ This parameter is mandatory.
required: true
type: str
mode:
@@ -39,14 +41,16 @@ options:
- STATIC
- UNCONFIGURED
description:
- - The C(mode) defines different IPv4 address assignment modes. This parameter
- is mandatory.
+ - The I(mode) enumerated type defines different IPv4 address assignment modes.
+ This parameter is mandatory.
required: true
type: str
prefix:
description:
- - The IPv4 CIDR prefix, for example, 24. See http://www.oav.net/mirrors/cidr.html
+ - The IPv4 CIDR prefix, for example, 24. See http://www.oav.net/mirrors/cidr.html
for netmask-to-prefix conversion.
+ - This field is optional and it is only relevant when the value of I(mode)
+ is STATIC.
type: int
session_timeout:
description:
@@ -103,11 +107,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -152,8 +156,6 @@ PAYLOAD_FORMAT = {
}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -168,26 +170,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",
@@ -263,7 +266,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_interfaces_ipv4_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_interfaces_ipv4_info.py
index 745b77695..5700b1ac0 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_interfaces_ipv4_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_interfaces_ipv4_info.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"""
@@ -17,7 +14,9 @@ description: Get IPv4 network configuration for specific NIC.
options:
interface_name:
description:
- - The Network interface to query, for example, "nic0". Required with I(state=['get'])
+ - The Network interface to query, for example, "nic0".
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.appliance_networking_interfaces_info).
+ Required with I(state=['get'])
type: str
session_timeout:
description:
@@ -68,11 +67,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -101,8 +100,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {"interface_name": "interface_name"}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -117,26 +114,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_interfaces_ipv6.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_interfaces_ipv6.py
index 8ce23e3cf..fbc73396e 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_interfaces_ipv6.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_interfaces_ipv6.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"""
@@ -51,7 +48,9 @@ options:
type: bool
interface_name:
description:
- - Network interface to update, for example, "nic0". This parameter is mandatory.
+ - Network interface to update, for example, "nic0".
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.appliance_networking_interfaces_info).
+ This parameter is mandatory.
required: true
type: str
session_timeout:
@@ -109,11 +108,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -155,8 +154,6 @@ PAYLOAD_FORMAT = {
}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -171,26 +168,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",
@@ -262,7 +260,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_interfaces_ipv6_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_interfaces_ipv6_info.py
index 1554a6337..858d3541b 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_interfaces_ipv6_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_interfaces_ipv6_info.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"""
@@ -17,7 +14,9 @@ description: Get IPv6 network configuration for specific interface.
options:
interface_name:
description:
- - Network interface to query, for example, "nic0". Required with I(state=['get'])
+ - Network interface to query, for example, "nic0".
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.appliance_networking_interfaces_info).
+ Required with I(state=['get'])
type: str
session_timeout:
description:
@@ -68,11 +67,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -105,8 +104,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {"interface_name": "interface_name"}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -121,26 +118,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_noproxy.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_noproxy.py
index 7b85605b5..0c938c1fa 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_noproxy.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_noproxy.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"""
@@ -82,11 +79,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -117,8 +114,6 @@ PAYLOAD_FORMAT = {
"set": {"query": {}, "body": {"servers": "servers"}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -133,26 +128,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",
@@ -219,7 +215,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_noproxy_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_noproxy_info.py
index 0f6d26b19..4b779ebfa 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_noproxy_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_noproxy_info.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"""
@@ -64,11 +61,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -78,14 +75,12 @@ EXAMPLES = r"""
"""
RETURN = r"""
-# content generated by the update_return_section callback# task: Get HTTP noproxy configuration
+# content generated by the update_return_section callback# task: Remove the noproxy entries
value:
- description: Get HTTP noproxy configuration
+ description: Remove the noproxy entries
returned: On success
- sample:
- - localhost
- - 127.0.0.1
- type: list
+ sample: {}
+ type: dict
"""
# This structure describes the format of the data expected by the end-points
@@ -93,8 +88,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -109,26 +102,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_proxy.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_proxy.py
index ddf002bb7..71bc5abd0 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_proxy.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_proxy.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"""
@@ -28,22 +25,22 @@ options:
the port to connect to the proxy server. A value of -1 indicates the default
port. ([''test''])'
- ' This key is required with [''test''].'
- - ' - C(username) (str): Username for proxy server. ([''test''])'
- - ' - C(password) (str): Password for proxy server. ([''test''])'
- - ' - C(enabled) (bool): In the result of the C(#get) and C(#list) {@term
- operations} this field indicates whether proxying is enabled for a particular
- protocol. In the input to the C(test) and C(set) {@term operations} this
- field specifies whether proxying should be enabled for a particular protocol.
- ([''test''])'
+ - ' - C(username) (str): Username for proxy server.'
+ - Only set if proxy requires username. (['test'])
+ - ' - C(password) (str): Password for proxy server.'
+ - Only set if proxy requires password. (['test'])
+ - ' - C(enabled) (bool): In the result of the #get and #list operations this
+ field indicates whether proxying is enabled for a particular protocol.
+ In the input to the test and set operations this field specifies whether
+ proxying should be enabled for a particular protocol. ([''test''])'
- ' This key is required with [''test''].'
type: dict
enabled:
description:
- - In the result of the C(#get) and C(#list) {@term operations} this field
- indicates whether proxying is enabled for a particular protocol. In the
- input to the C(test) and C(set) {@term operations} this field specifies
- whether proxying should be enabled for a particular protocol. Required
- with I(state=['set'])
+ - 'In the result of the #get and #list operations this field indicates whether
+ proxying is enabled for a particular protocol. In the input to the test
+ and set operations this field specifies whether proxying should be enabled
+ for a particular protocol. Required with I(state=[''set''])'
type: bool
host:
description:
@@ -52,6 +49,7 @@ options:
password:
description:
- Password for proxy server.
+ - Only set if proxy requires password.
type: str
port:
description:
@@ -88,6 +86,7 @@ options:
username:
description:
- Username for proxy server.
+ - Only set if proxy requires username.
type: str
vcenter_hostname:
description:
@@ -130,11 +129,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -169,6 +168,7 @@ PAYLOAD_FORMAT = {
"body": {"config": "config", "host": "host"},
"path": {"protocol": "protocol"},
},
+ "delete": {"query": {}, "body": {}, "path": {"protocol": "protocol"}},
"set": {
"query": {},
"body": {
@@ -180,11 +180,8 @@ PAYLOAD_FORMAT = {
},
"path": {"protocol": "protocol"},
},
- "delete": {"query": {}, "body": {}, "path": {"protocol": "protocol"}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -199,26 +196,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",
@@ -296,7 +294,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_proxy_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_proxy_info.py
index e3dbdfcfc..81f7d8dfa 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_proxy_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_networking_proxy_info.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"""
@@ -68,11 +65,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -108,8 +105,6 @@ PAYLOAD_FORMAT = {
"list": {"query": {}, "body": {}, "path": {}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -127,23 +122,23 @@ from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest imp
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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_ntp.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_ntp.py
index d26d17bf6..5db6acbfa 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_ntp.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_ntp.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"""
@@ -81,11 +78,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -123,8 +120,6 @@ PAYLOAD_FORMAT = {
"set": {"query": {}, "body": {"servers": "servers"}, "path": {}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -139,26 +134,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",
@@ -227,7 +223,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_ntp_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_ntp_info.py
index a3890ff7b..c3821cc40 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_ntp_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_ntp_info.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"""
@@ -68,11 +65,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -99,8 +96,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -115,26 +110,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_services.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_services.py
index 4542c19fc..f277fd1eb 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_services.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_services.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"""
@@ -17,7 +14,9 @@ description: Restarts a service
options:
service:
description:
- - identifier of the service to restart This parameter is mandatory.
+ - identifier of the service to restart
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.appliance_services_info).
+ This parameter is mandatory.
required: true
type: str
session_timeout:
@@ -77,11 +76,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -115,13 +114,11 @@ value:
# This structure describes the format of the data expected by the end-points
PAYLOAD_FORMAT = {
- "start": {"query": {}, "body": {}, "path": {"service": "service"}},
"restart": {"query": {}, "body": {}, "path": {"service": "service"}},
+ "start": {"query": {}, "body": {}, "path": {"service": "service"}},
"stop": {"query": {}, "body": {}, "path": {"service": "service"}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -136,26 +133,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",
@@ -224,7 +222,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_services_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_services_info.py
index 86e945fec..e4fdd345e 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_services_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_services_info.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"""
@@ -17,7 +14,9 @@ description: Returns the state of a service.
options:
service:
description:
- - identifier of the service whose state is being queried. Required with I(state=['get'])
+ - identifier of the service whose state is being queried.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.appliance_services_info).
+ Required with I(state=['get'])
type: str
session_timeout:
description:
@@ -68,11 +67,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -104,8 +103,6 @@ PAYLOAD_FORMAT = {
"list": {"query": {}, "body": {}, "path": {}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -123,23 +120,23 @@ from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest imp
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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_shutdown.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_shutdown.py
index 496ee87b4..2280d85fe 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_shutdown.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_shutdown.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"""
@@ -81,11 +78,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -125,17 +122,15 @@ value:
# This structure describes the format of the data expected by the end-points
PAYLOAD_FORMAT = {
- "cancel": {"query": {}, "body": {}, "path": {}},
- "reboot": {"query": {}, "body": {"delay": "delay", "reason": "reason"}, "path": {}},
"poweroff": {
"query": {},
"body": {"delay": "delay", "reason": "reason"},
"path": {},
},
+ "reboot": {"query": {}, "body": {"delay": "delay", "reason": "reason"}, "path": {}},
+ "cancel": {"query": {}, "body": {}, "path": {}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -150,26 +145,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",
@@ -239,7 +235,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_shutdown_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_shutdown_info.py
index 020fb7940..7f85e9396 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_shutdown_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_shutdown_info.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"""
@@ -64,11 +61,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -98,8 +95,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -114,26 +109,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_globalfips.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_globalfips.py
index 9abe88739..044f9c25f 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_globalfips.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_globalfips.py
@@ -3,22 +3,19 @@
# 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"""
module: appliance_system_globalfips
short_description: Enable/Disable Global FIPS mode for the appliance
-description: Enable/Disable Global FIPS mode for the appliance. <p><b>Caution:</b>
- Changing the value of this setting will reboot the Appliance.
+description: 'Enable/Disable Global FIPS mode for the appliance. '
options:
enabled:
description:
- FIPS setting state.
+ - If unset, the value is unchanged.
type: bool
session_timeout:
description:
@@ -75,11 +72,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -93,8 +90,6 @@ PAYLOAD_FORMAT = {
"update": {"query": {}, "body": {"enabled": "enabled"}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -109,26 +104,24 @@ 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",
@@ -199,7 +192,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_globalfips_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_globalfips_info.py
index b2cfe5534..e1d003553 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_globalfips_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_globalfips_info.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"""
@@ -64,11 +61,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -82,8 +79,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -98,26 +93,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_storage.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_storage.py
index f9a1f4eb7..4bfdc3734 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_storage.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_storage.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"""
@@ -71,11 +68,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -105,12 +102,10 @@ value:
# This structure describes the format of the data expected by the end-points
PAYLOAD_FORMAT = {
- "resize_ex": {"query": {}, "body": {}, "path": {}},
"resize": {"query": {}, "body": {}, "path": {}},
+ "resize_ex": {"query": {}, "body": {}, "path": {}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -125,26 +120,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",
@@ -214,7 +210,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_storage_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_storage_info.py
index 2d6dccebb..9133ff372 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_storage_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_storage_info.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"""
@@ -64,11 +61,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -91,8 +88,6 @@ PAYLOAD_FORMAT = {
"list": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -107,26 +102,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_time_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_time_info.py
index 9ec1be999..75511d136 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_time_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_time_info.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"""
@@ -64,11 +61,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -95,8 +92,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -111,26 +106,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_time_timezone.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_time_timezone.py
index f71ce8cf4..361cc68c8 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_time_timezone.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_time_timezone.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"""
@@ -75,11 +72,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -103,8 +100,6 @@ PAYLOAD_FORMAT = {
"set": {"query": {}, "body": {"name": "name"}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -119,26 +114,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",
@@ -205,7 +201,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_time_timezone_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_time_timezone_info.py
index 55036b151..59da771f7 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_time_timezone_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_time_timezone_info.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"""
@@ -64,11 +61,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -91,8 +88,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -107,26 +102,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_version_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_version_info.py
index 7a150a3f0..5646884ff 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_version_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_system_version_info.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"""
@@ -64,11 +61,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -98,8 +95,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -114,26 +109,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_timesync.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_timesync.py
index 0593a6483..b3b04ff80 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_timesync.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_timesync.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"""
@@ -21,8 +18,8 @@ options:
- HOST
- NTP
description:
- - The C(time_sync_mode) defines time synchronization modes This parameter
- is mandatory.
+ - The I(time_sync_mode) enumerated type defines time synchronization modes
+ This parameter is mandatory.
required: true
type: str
session_timeout:
@@ -80,11 +77,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -107,8 +104,6 @@ PAYLOAD_FORMAT = {
"set": {"query": {}, "body": {"mode": "mode"}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -123,26 +118,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",
@@ -211,7 +207,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_timesync_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_timesync_info.py
index 3cee769a2..28e7f2445 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_timesync_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_timesync_info.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"""
@@ -64,11 +61,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -91,8 +88,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -107,26 +102,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_update_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_update_info.py
index e136a5781..109b76db0 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_update_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_update_info.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"""
@@ -64,11 +61,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -93,8 +90,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -109,26 +104,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_vmon_service.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_vmon_service.py
index 086544913..932b8a96f 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_vmon_service.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_vmon_service.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"""
@@ -89,11 +86,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -120,19 +117,17 @@ value:
# This structure describes the format of the data expected by the end-points
PAYLOAD_FORMAT = {
+ "list_details": {"query": {}, "body": {}, "path": {}},
+ "start": {"query": {}, "body": {}, "path": {"service": "service"}},
+ "stop": {"query": {}, "body": {}, "path": {"service": "service"}},
"update": {
"query": {},
"body": {"startup_type": "spec/startup_type"},
"path": {"service": "service"},
},
- "stop": {"query": {}, "body": {}, "path": {"service": "service"}},
- "list_details": {"query": {}, "body": {}, "path": {}},
"restart": {"query": {}, "body": {}, "path": {"service": "service"}},
- "start": {"query": {}, "body": {}, "path": {"service": "service"}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -147,26 +142,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",
@@ -241,7 +237,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_vmon_service_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_vmon_service_info.py
index 1589c0711..cc73aecf1 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_vmon_service_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/appliance_vmon_service_info.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"""
@@ -70,11 +67,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -477,8 +474,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {"service": "service"}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -493,26 +488,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/content_configuration.py b/ansible_collections/vmware/vmware_rest/plugins/modules/content_configuration.py
index 5ba1d003f..d32e05dd5 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/content_configuration.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/content_configuration.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"""
@@ -101,11 +98,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -146,8 +143,6 @@ PAYLOAD_FORMAT = {
}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -162,26 +157,24 @@ 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",
@@ -253,7 +246,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/content_configuration_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/content_configuration_info.py
index 16dd53d40..391db4c81 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/content_configuration_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/content_configuration_info.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"""
@@ -64,11 +61,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -95,8 +92,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -111,26 +106,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/content_library_item_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/content_library_item_info.py
index 34e6d1e97..d4556bba8 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/content_library_item_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/content_library_item_info.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,11 +70,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -184,8 +181,6 @@ PAYLOAD_FORMAT = {
"list": {"query": {"library_id": "library_id"}, "body": {}, "path": {}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -203,23 +198,23 @@ from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest imp
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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/content_locallibrary.py b/ansible_collections/vmware/vmware_rest/plugins/modules/content_locallibrary.py
index e886d9d31..8475105b7 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/content_locallibrary.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/content_locallibrary.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"""
@@ -110,6 +107,12 @@ options:
by a remote file system, the library JSON file will be stored at {library_id}/lib.json
in the remote file system path. ([''present''])'
type: dict
+ security_policy_id:
+ description:
+ - 'Represents the security policy applied to this library. Setting the field
+ will make the library secure. This field is ignored in C(update)operation
+ if {@link #unsetSecurityPolicyId} is set to C(True).'
+ type: str
server_guid:
description:
- The unique identifier of the vCenter server where the library exists.
@@ -257,6 +260,14 @@ options:
can be used to determine which additional services can be performed with
a library.
type: str
+ unset_security_policy_id:
+ description:
+ - 'This represents the intent of the change to {@link #securityPolicyId} in
+ C(update)operation. If this field is set to C(True), any security policy
+ applied to the library will be removed. If this field is set to C(False),
+ any security policy applied to library will be changed to the value specified
+ in {@link #securityPolicyId}, if any.'
+ type: bool
vcenter_hostname:
description:
- The hostname or IP address of the vSphere vCenter
@@ -307,11 +318,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -1242,7 +1253,6 @@ results:
# This structure describes the format of the data expected by the end-points
PAYLOAD_FORMAT = {
- "delete": {"query": {}, "body": {}, "path": {"library_id": "library_id"}},
"update": {
"query": {},
"body": {
@@ -1254,10 +1264,12 @@ PAYLOAD_FORMAT = {
"name": "name",
"optimization_info": "optimization_info",
"publish_info": "publish_info",
+ "security_policy_id": "security_policy_id",
"server_guid": "server_guid",
"storage_backings": "storage_backings",
"subscription_info": "subscription_info",
"type": "type",
+ "unset_security_policy_id": "unset_security_policy_id",
"version": "version",
},
"path": {"library_id": "library_id"},
@@ -1278,18 +1290,19 @@ PAYLOAD_FORMAT = {
"name": "name",
"optimization_info": "optimization_info",
"publish_info": "publish_info",
+ "security_policy_id": "security_policy_id",
"server_guid": "server_guid",
"storage_backings": "storage_backings",
"subscription_info": "subscription_info",
"type": "type",
+ "unset_security_policy_id": "unset_security_policy_id",
"version": "version",
},
"path": {},
},
+ "delete": {"query": {}, "body": {}, "path": {"library_id": "library_id"}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -1304,26 +1317,28 @@ 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",
@@ -1359,6 +1374,7 @@ def prepare_argument_spec():
argument_spec["name"] = {"type": "str"}
argument_spec["optimization_info"] = {"type": "dict"}
argument_spec["publish_info"] = {"type": "dict"}
+ argument_spec["security_policy_id"] = {"type": "str"}
argument_spec["server_guid"] = {"type": "str"}
argument_spec["state"] = {
"type": "str",
@@ -1369,6 +1385,7 @@ def prepare_argument_spec():
argument_spec["subscription_info"] = {"type": "dict"}
argument_spec["subscriptions"] = {"type": "list", "elements": "dict"}
argument_spec["type"] = {"type": "str", "choices": ["LOCAL", "SUBSCRIBED"]}
+ argument_spec["unset_security_policy_id"] = {"type": "bool"}
argument_spec["version"] = {"type": "str"}
return argument_spec
@@ -1407,7 +1424,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
@@ -1424,7 +1440,6 @@ async def entry_point(module, session):
async def _create(params, session):
-
lookup_url = per_id_url = build_url(params)
uniquity_keys = ["name"]
comp_func = None
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/content_locallibrary_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/content_locallibrary_info.py
index c7559e03b..a01f6388f 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/content_locallibrary_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/content_locallibrary_info.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"""
@@ -68,11 +65,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -323,8 +320,6 @@ PAYLOAD_FORMAT = {
"list": {"query": {}, "body": {}, "path": {}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -342,23 +337,23 @@ from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest imp
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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/content_subscribedlibrary.py b/ansible_collections/vmware/vmware_rest/plugins/modules/content_subscribedlibrary.py
index 782233286..6feffb8bc 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/content_subscribedlibrary.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/content_subscribedlibrary.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"""
@@ -114,6 +111,12 @@ options:
by a remote file system, the library JSON file will be stored at {library_id}/lib.json
in the remote file system path. ([''present''])'
type: dict
+ security_policy_id:
+ description:
+ - 'Represents the security policy applied to this library. Setting the field
+ will make the library secure. This field is ignored in C(update)operation
+ if {@link #unsetSecurityPolicyId} is set to C(True).'
+ type: str
server_guid:
description:
- The unique identifier of the vCenter server where the library exists.
@@ -255,6 +258,14 @@ options:
can be used to determine which additional services can be performed with
a library.
type: str
+ unset_security_policy_id:
+ description:
+ - 'This represents the intent of the change to {@link #securityPolicyId} in
+ C(update)operation. If this field is set to C(True), any security policy
+ applied to the library will be removed. If this field is set to C(False),
+ any security policy applied to library will be changed to the value specified
+ in {@link #securityPolicyId}, if any.'
+ type: bool
vcenter_hostname:
description:
- The hostname or IP address of the vSphere vCenter
@@ -305,11 +316,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -446,7 +457,7 @@ results:
# This structure describes the format of the data expected by the end-points
PAYLOAD_FORMAT = {
- "sync": {"query": {}, "body": {}, "path": {"library_id": "library_id"}},
+ "evict": {"query": {}, "body": {}, "path": {"library_id": "library_id"}},
"update": {
"query": {},
"body": {
@@ -458,14 +469,21 @@ PAYLOAD_FORMAT = {
"name": "name",
"optimization_info": "optimization_info",
"publish_info": "publish_info",
+ "security_policy_id": "security_policy_id",
"server_guid": "server_guid",
"storage_backings": "storage_backings",
"subscription_info": "subscription_info",
"type": "type",
+ "unset_security_policy_id": "unset_security_policy_id",
"version": "version",
},
"path": {"library_id": "library_id"},
},
+ "probe": {
+ "query": {},
+ "body": {"subscription_info": "subscription_info"},
+ "path": {},
+ },
"create": {
"query": {"client_token": "client_token"},
"body": {
@@ -477,25 +495,20 @@ PAYLOAD_FORMAT = {
"name": "name",
"optimization_info": "optimization_info",
"publish_info": "publish_info",
+ "security_policy_id": "security_policy_id",
"server_guid": "server_guid",
"storage_backings": "storage_backings",
"subscription_info": "subscription_info",
"type": "type",
+ "unset_security_policy_id": "unset_security_policy_id",
"version": "version",
},
"path": {},
},
"delete": {"query": {}, "body": {}, "path": {"library_id": "library_id"}},
- "probe": {
- "query": {},
- "body": {"subscription_info": "subscription_info"},
- "path": {},
- },
- "evict": {"query": {}, "body": {}, "path": {"library_id": "library_id"}},
+ "sync": {"query": {}, "body": {}, "path": {"library_id": "library_id"}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -510,26 +523,28 @@ 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",
@@ -565,6 +580,7 @@ def prepare_argument_spec():
argument_spec["name"] = {"type": "str"}
argument_spec["optimization_info"] = {"type": "dict"}
argument_spec["publish_info"] = {"type": "dict"}
+ argument_spec["security_policy_id"] = {"type": "str"}
argument_spec["server_guid"] = {"type": "str"}
argument_spec["state"] = {
"type": "str",
@@ -574,6 +590,7 @@ def prepare_argument_spec():
argument_spec["storage_backings"] = {"type": "list", "elements": "dict"}
argument_spec["subscription_info"] = {"type": "dict"}
argument_spec["type"] = {"type": "str", "choices": ["LOCAL", "SUBSCRIBED"]}
+ argument_spec["unset_security_policy_id"] = {"type": "bool"}
argument_spec["version"] = {"type": "str"}
return argument_spec
@@ -614,7 +631,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
@@ -631,7 +647,6 @@ async def entry_point(module, session):
async def _create(params, session):
-
lookup_url = per_id_url = build_url(params)
uniquity_keys = ["name"]
comp_func = None
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/content_subscribedlibrary_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/content_subscribedlibrary_info.py
index 891b65e6f..c80607f02 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/content_subscribedlibrary_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/content_subscribedlibrary_info.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"""
@@ -68,11 +65,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -113,8 +110,6 @@ PAYLOAD_FORMAT = {
"list": {"query": {}, "body": {}, "path": {}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -132,23 +127,23 @@ from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest imp
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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_cluster_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_cluster_info.py
index e0947f099..d2b8a0ef7 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_cluster_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_cluster_info.py
@@ -3,27 +3,27 @@
# 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"""
module: vcenter_cluster_info
-short_description: Retrieves information about the cluster corresponding to {@param.name
- cluster}.
-description: Retrieves information about the cluster corresponding to {@param.name
- cluster}.
+short_description: Retrieves information about the cluster corresponding to cluster.
+description: Retrieves information about the cluster corresponding to cluster.
options:
cluster:
description:
- - Identifier of the cluster. Required with I(state=['get'])
+ - Identifier of the cluster.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_cluster_info).
+ Required with I(state=['get'])
type: str
clusters:
description:
- Identifiers of clusters that can match the filter.
+ - If unset or empty, clusters with any identifier match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_cluster_info).
elements: str
type: list
datacenters:
@@ -31,6 +31,9 @@ options:
- filter_datacenters
description:
- Datacenters that must contain the cluster for the cluster to match the filter.
+ - If unset or empty, clusters in any datacenter match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_datacenter_info).
elements: str
type: list
folders:
@@ -38,13 +41,17 @@ options:
- filter_folders
description:
- Folders that must contain the cluster for the cluster to match the filter.
+ - If unset or empty, clusters in any folder match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_folder_info).
elements: str
type: list
names:
aliases:
- filter_names
description:
- - Names that clusters must have to match the filter (see {@link Info#name}).
+ - Names that clusters must have to match the filter (see I(name)).
+ - If unset or empty, clusters with any name match the filter.
elements: str
type: list
session_timeout:
@@ -96,11 +103,11 @@ 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -145,8 +152,6 @@ PAYLOAD_FORMAT = {
},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -164,23 +169,23 @@ from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest imp
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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_datacenter.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_datacenter.py
index 638084024..dd153a1f3 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_datacenter.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_datacenter.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"""
@@ -17,15 +14,24 @@ description: Create a new datacenter in the vCenter inventory
options:
datacenter:
description:
- - Identifier of the datacenter to be deleted. Required with I(state=['absent'])
+ - Identifier of the datacenter to be deleted.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_datacenter_info).
+ Required with I(state=['absent'])
type: str
folder:
description:
- Datacenter folder in which the new datacenter should be created.
+ - This field is currently required. In the future, if this field is unset,
+ the system will attempt to choose a suitable folder for the datacenter;
+ if a folder cannot be chosen, the datacenter creation operation will fail.
+ - 'When clients pass a value of this structure as a parameter, the field must
+ be the id of a resource returned by M(vmware.vmware_rest.vcenter_folder_info). '
type: str
force:
description:
- If true, delete the datacenter even if it is not empty.
+ - If unset a ResourceInUse error will be reported if the datacenter is not
+ empty. This is the equivalent of passing the value false.
type: bool
name:
description:
@@ -87,18 +93,17 @@ 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
- name: Get a list of all the datacenters
register: existing_datacenters
vmware.vmware_rest.vcenter_datacenter_info:
-
- name: Force delete the existing DC
vmware.vmware_rest.vcenter_datacenter:
state: absent
@@ -108,7 +113,6 @@ EXAMPLES = r"""
until:
- _result is not failed
retries: 7
-
- name: Create datacenter my_dc
vmware.vmware_rest.vcenter_datacenter:
name: my_dc
@@ -164,8 +168,6 @@ PAYLOAD_FORMAT = {
},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -180,26 +182,28 @@ 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",
@@ -271,7 +275,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
@@ -288,20 +291,20 @@ async def entry_point(module, session):
async def _create(params, session):
-
lookup_url = per_id_url = build_url(params)
uniquity_keys = ["datacenter"]
comp_func = None
async def lookup_with_filters(params, session, url):
- # e.g: for the datacenter resources
+ search_filter = ""
+
if "folder" not in params:
return
+ search_filter = f"&folders={params.get('folder')}"
+
if "name" not in params:
return
- async with session.get(
- f"{url}?names={params['name']}&folders={params['folder']}"
- ) as resp:
+ async with session.get(f"{url}?names={params['name']}{search_filter}") as resp:
_json = await resp.json()
if isinstance(_json, list) and len(_json) == 1:
return await get_device_info(session, url, _json[0]["datacenter"])
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_datacenter_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_datacenter_info.py
index 8454fe5d4..1e7d03e16 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_datacenter_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_datacenter_info.py
@@ -3,29 +3,29 @@
# 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"""
module: vcenter_datacenter_info
-short_description: Retrieves information about the datacenter corresponding to {@param.name
- datacenter}.
-description: Retrieves information about the datacenter corresponding to {@param.name
- datacenter}.
+short_description: Retrieves information about the datacenter corresponding to datacenter.
+description: Retrieves information about the datacenter corresponding to datacenter.
options:
datacenter:
description:
- - Identifier of the datacenter. Required with I(state=['get'])
+ - Identifier of the datacenter.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_datacenter_info).
+ Required with I(state=['get'])
type: str
datacenters:
aliases:
- filter_datacenters
description:
- Identifiers of datacenters that can match the filter.
+ - If unset or empty, datacenters with any identifier match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_datacenter_info).
elements: str
type: list
folders:
@@ -34,13 +34,17 @@ options:
description:
- Folders that must contain the datacenters for the datacenter to match the
filter.
+ - If unset or empty, datacenters in any folder match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_folder_info).
elements: str
type: list
names:
aliases:
- filter_names
description:
- - Names that datacenters must have to match the filter (see {@link Info#name}).
+ - Names that datacenters must have to match the filter (see I(name)).
+ - If unset or empty, datacenters with any name match the filter.
elements: str
type: list
session_timeout:
@@ -92,11 +96,11 @@ 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -130,8 +134,6 @@ PAYLOAD_FORMAT = {
},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -149,23 +151,23 @@ from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest imp
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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_datastore_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_datastore_info.py
index 7c388e4bc..aab450b0f 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_datastore_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_datastore_info.py
@@ -3,18 +3,14 @@
# 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"""
module: vcenter_datastore_info
-short_description: Retrieves information about the datastore indicated by {@param.name
- datastore}.
-description: Retrieves information about the datastore indicated by {@param.name datastore}.
+short_description: Retrieves information about the datastore indicated by datastore.
+description: Retrieves information about the datastore indicated by datastore.
options:
datacenters:
aliases:
@@ -22,16 +18,23 @@ options:
description:
- Datacenters that must contain the datastore for the datastore to match the
filter.
+ - If unset or empty, datastores in any datacenter match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_datacenter_info).
elements: str
type: list
datastore:
description:
- - Identifier of the datastore for which information should be retrieved. Required
- with I(state=['get'])
+ - Identifier of the datastore for which information should be retrieved.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_datastore_info).
+ Required with I(state=['get'])
type: str
datastores:
description:
- Identifiers of datastores that can match the filter.
+ - If unset or empty, datastores with any identifier match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_datastore_info).
elements: str
type: list
folders:
@@ -39,13 +42,17 @@ options:
- filter_folders
description:
- Folders that must contain the datastore for the datastore to match the filter.
+ - If unset or empty, datastores in any folder match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_folder_info).
elements: str
type: list
names:
aliases:
- filter_names
description:
- - Names that datastores must have to match the filter (see {@link Info#name}).
+ - Names that datastores must have to match the filter (see I(name)).
+ - If unset or empty, datastores with any name match the filter.
elements: str
type: list
session_timeout:
@@ -60,7 +67,8 @@ options:
aliases:
- filter_types
description:
- - Types that datastores must have to match the filter (see {@link Summary#type}).
+ - Types that datastores must have to match the filter (see I(type)).
+ - If unset or empty, datastores with any type match the filter.
elements: str
type: list
vcenter_hostname:
@@ -104,11 +112,11 @@ 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -157,8 +165,6 @@ PAYLOAD_FORMAT = {
},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -176,23 +182,23 @@ from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest imp
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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_folder_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_folder_info.py
index 927ab2f0b..e17bab127 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_folder_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_folder_info.py
@@ -3,25 +3,25 @@
# 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"""
module: vcenter_folder_info
short_description: Returns information about at most 1000 visible (subject to permission
- checks) folders in vCenter matching the {@link FilterSpec}.
+ checks) folders in vCenter matching the Folder.FilterSpec.
description: Returns information about at most 1000 visible (subject to permission
- checks) folders in vCenter matching the {@link FilterSpec}.
+ checks) folders in vCenter matching the Folder.FilterSpec.
options:
datacenters:
aliases:
- filter_datacenters
description:
- Datacenters that must contain the folder for the folder to match the filter.
+ - If unset or empty, folder in any datacenter match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_datacenter_info).
elements: str
type: list
folders:
@@ -29,18 +29,25 @@ options:
- filter_folders
description:
- Identifiers of folders that can match the filter.
+ - If unset or empty, folders with any identifier match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_folder_info).
elements: str
type: list
names:
aliases:
- filter_names
description:
- - Names that folders must have to match the filter (see {@link Summary#name}).
+ - Names that folders must have to match the filter (see I(name)).
+ - If unset or empty, folders with any name match the filter.
elements: str
type: list
parent_folders:
description:
- Folders that must contain the folder for the folder to match the filter.
+ - If unset or empty, folder in any folder match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_folder_info).
elements: str
type: list
session_timeout:
@@ -61,9 +68,9 @@ options:
- NETWORK
- VIRTUAL_MACHINE
description:
- - The C(type) defines the type of a vCenter Server folder. The type of a
- folder determines what what kinds of children can be contained in the
- folder.
+ - The I(type) enumerated type defines the type of a vCenter Server folder.
+ The type of a folder determines what what kinds of children can be contained
+ in the folder.
type: str
vcenter_hostname:
description:
@@ -106,11 +113,11 @@ 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -154,8 +161,6 @@ PAYLOAD_FORMAT = {
}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -170,26 +175,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_host.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_host.py
index ff00c6754..73f6e98ac 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_host.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_host.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"""
@@ -18,22 +15,29 @@ description: Add a new standalone host in the vCenter inventory. The newly conne
before adding the host to its inventory. In the case where the SSL certificate
cannot be verified because the Certificate Authority is not recognized or the
certificate is self signed, the vCenter Server will fall back to thumbprint verification
- mode as defined by {@link CreateSpec.ThumbprintVerification}.
+ mode as defined by Host.CreateSpec.ThumbprintVerification.
options:
folder:
description:
- Host and cluster folder in which the new standalone host should be created.
+ - This field is currently required. In the future, if this field is unset,
+ the system will attempt to choose a suitable folder for the host; if a
+ folder cannot be chosen, the host creation operation will fail.
+ - 'When clients pass a value of this structure as a parameter, the field must
+ be the id of a resource returned by M(vmware.vmware_rest.vcenter_folder_info). '
type: str
force_add:
description:
- Whether host should be added to the vCenter Server even if it is being managed
by another vCenter Server. The original vCenterServer loses connection
to the host.
+ - If unset, forceAdd is default to false.
type: bool
host:
description:
- - Identifier of the host to be disconnected. Required with I(state=['absent',
- 'connect', 'disconnect'])
+ - Identifier of the host to be disconnected.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_host_info).
+ Required with I(state=['absent', 'connect', 'disconnect'])
type: str
hostname:
description:
@@ -46,6 +50,7 @@ options:
port:
description:
- The port of the host.
+ - If unset, port 443 will be used.
type: int
session_timeout:
description:
@@ -70,14 +75,16 @@ options:
The thumbprint is always computed using the SHA1 hash and is the string
representation of that hash in the format: xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx
where, ''x'' represents a hexadecimal digit.'
+ - This field is optional and it is only relevant when the value of I(thumbprint_verification)
+ is THUMBPRINT.
type: str
thumbprint_verification:
choices:
- NONE
- THUMBPRINT
description:
- - The C(thumbprint_verification) defines the thumbprint verification schemes
- for a host's SSL certificate. Required with I(state=['present'])
+ - The I(thumbprint_verification) enumerated type defines the thumbprint verification
+ schemes for a host's SSL certificate. Required with I(state=['present'])
type: str
user_name:
description:
@@ -124,11 +131,11 @@ 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -152,9 +159,8 @@ value:
# This structure describes the format of the data expected by the end-points
PAYLOAD_FORMAT = {
- "delete": {"query": {}, "body": {}, "path": {"host": "host"}},
- "disconnect": {"query": {}, "body": {}, "path": {"host": "host"}},
"connect": {"query": {}, "body": {}, "path": {"host": "host"}},
+ "disconnect": {"query": {}, "body": {}, "path": {"host": "host"}},
"create": {
"query": {},
"body": {
@@ -169,10 +175,9 @@ PAYLOAD_FORMAT = {
},
"path": {},
},
+ "delete": {"query": {}, "body": {}, "path": {"host": "host"}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -187,26 +192,28 @@ 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",
@@ -286,7 +293,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
@@ -328,20 +334,20 @@ async def _connect(params, session):
async def _create(params, session):
-
lookup_url = per_id_url = build_url(params)
uniquity_keys = ["host"]
comp_func = None
async def lookup_with_filters(params, session, url):
- # e.g: for the datacenter resources
+ search_filter = ""
+
if "folder" not in params:
return
+ search_filter = f"&folders={params.get('folder')}"
+
if "name" not in params:
return
- async with session.get(
- f"{url}?names={params['name']}&folders={params['folder']}"
- ) as resp:
+ async with session.get(f"{url}?names={params['name']}{search_filter}") as resp:
_json = await resp.json()
if isinstance(_json, list) and len(_json) == 1:
return await get_device_info(session, url, _json[0]["host"])
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_host_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_host_info.py
index 129ca237e..febdf6a49 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_host_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_host_info.py
@@ -3,29 +3,31 @@
# 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"""
module: vcenter_host_info
short_description: Returns information about at most 2500 visible (subject to permission
- checks) hosts in vCenter matching the {@link FilterSpec}.
+ checks) hosts in vCenter matching the Host.FilterSpec.
description: Returns information about at most 2500 visible (subject to permission
- checks) hosts in vCenter matching the {@link FilterSpec}.
+ checks) hosts in vCenter matching the Host.FilterSpec.
options:
clusters:
description:
- Clusters that must contain the hosts for the hosts to match the filter.
+ - If unset or empty, hosts in any cluster and hosts that are not in a cluster
+ match the filter. If this field is not empty and I(standalone) is true,
+ no hosts will match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_cluster_info).
elements: str
type: list
connection_states:
description:
- - Connection states that a host must be in to match the filter (see {@link
- Summary#connectionState}.
+ - Connection states that a host must be in to match the filter (see I()
+ - If unset or empty, hosts in any connection state match the filter.
elements: str
type: list
datacenters:
@@ -33,6 +35,9 @@ options:
- filter_datacenters
description:
- Datacenters that must contain the hosts for the hosts to match the filter.
+ - If unset or empty, hosts in any datacenter match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_datacenter_info).
elements: str
type: list
folders:
@@ -40,18 +45,25 @@ options:
- filter_folders
description:
- Folders that must contain the hosts for the hosts to match the filter.
+ - If unset or empty, hosts in any folder match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_folder_info).
elements: str
type: list
hosts:
description:
- Identifiers of hosts that can match the filter.
+ - If unset or empty, hosts with any identifier match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_host_info).
elements: str
type: list
names:
aliases:
- filter_names
description:
- - Names that hosts must have to match the filter (see {@link Summary#name}).
+ - Names that hosts must have to match the filter (see I(name)).
+ - If unset or empty, hosts with any name match the filter.
elements: str
type: list
session_timeout:
@@ -67,6 +79,9 @@ options:
- If true, only hosts that are not part of a cluster can match the filter,
and if false, only hosts that are are part of a cluster can match the
filter.
+ - If unset Hosts can match filter independent of whether they are part of
+ a cluster or not. If this field is true and I(clusters) os not empty,
+ no hosts will match the filter.
type: bool
vcenter_hostname:
description:
@@ -109,11 +124,11 @@ 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -152,8 +167,6 @@ PAYLOAD_FORMAT = {
}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -171,23 +184,23 @@ from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest imp
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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_network_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_network_info.py
index cd1c83337..66b24cc1c 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_network_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_network_info.py
@@ -3,25 +3,25 @@
# 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"""
module: vcenter_network_info
short_description: Returns information about at most 1000 visible (subject to permission
- checks) networks in vCenter matching the {@link FilterSpec}.
+ checks) networks in vCenter matching the Network.FilterSpec.
description: Returns information about at most 1000 visible (subject to permission
- checks) networks in vCenter matching the {@link FilterSpec}.
+ checks) networks in vCenter matching the Network.FilterSpec.
options:
datacenters:
aliases:
- filter_datacenters
description:
- Datacenters that must contain the network for the network to match the filter.
+ - If unset or empty, networks in any datacenter match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_datacenter_info).
elements: str
type: list
folders:
@@ -29,18 +29,25 @@ options:
- filter_folders
description:
- Folders that must contain the network for the network to match the filter.
+ - If unset or empty, networks in any folder match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_folder_info).
elements: str
type: list
names:
aliases:
- filter_names
description:
- - Names that networks must have to match the filter (see {@link Summary#name}).
+ - Names that networks must have to match the filter (see I(name)).
+ - If unset or empty, networks with any name match the filter.
elements: str
type: list
networks:
description:
- Identifiers of networks that can match the filter.
+ - If unset or empty, networks with any identifier match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_network_info).
elements: str
type: list
session_timeout:
@@ -55,7 +62,8 @@ options:
aliases:
- filter_types
description:
- - Types that networks must have to match the filter (see {@link Summary#type}).
+ - Types that networks must have to match the filter (see I(type)).
+ - If unset, networks with any type match the filter.
elements: str
type: list
vcenter_hostname:
@@ -99,11 +107,11 @@ 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -150,8 +158,6 @@ PAYLOAD_FORMAT = {
}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -166,26 +172,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_ovf_libraryitem.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_ovf_libraryitem.py
index 261b9443f..06c4b8722 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_ovf_libraryitem.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_ovf_libraryitem.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"""
@@ -181,11 +178,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -281,6 +278,11 @@ value:
# This structure describes the format of the data expected by the end-points
PAYLOAD_FORMAT = {
+ "deploy": {
+ "query": {"client_token": "client_token"},
+ "body": {"deployment_spec": "deployment_spec", "target": "target"},
+ "path": {"ovf_library_item_id": "ovf_library_item_id"},
+ },
"filter": {
"query": {},
"body": {"target": "target"},
@@ -291,15 +293,8 @@ PAYLOAD_FORMAT = {
"body": {"create_spec": "create_spec", "source": "source", "target": "target"},
"path": {},
},
- "deploy": {
- "query": {"client_token": "client_token"},
- "body": {"deployment_spec": "deployment_spec", "target": "target"},
- "path": {"ovf_library_item_id": "ovf_library_item_id"},
- },
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -314,26 +309,28 @@ 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",
@@ -409,7 +406,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
@@ -426,7 +422,6 @@ async def entry_point(module, session):
async def _create(params, session):
-
library_id = (
params["target"]["library_id"] if "library_id" in params["target"] else None
)
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_resourcepool.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_resourcepool.py
index c0e9cabcf..5e5d77d68 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_resourcepool.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_resourcepool.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"""
@@ -18,81 +15,101 @@ options:
cpu_allocation:
description:
- Resource allocation for CPU.
+ - if unset or empty, the CPU allocation of the resource pool will not be changed.
- 'Valid attributes are:'
- ' - C(reservation) (int): Amount of resource that is guaranteed available
to a resource pool. Reserved resources are not wasted if they are not
used. If the utilization is less than the reservation, the resources can
be utilized by other running virtual machines. Units are MB fo memory,
- and MHz for CPU. ([''present''])'
+ and MHz for CPU.'
+ - If unset or empty, I(reservation) will be set to 0. (['present'])
- ' - C(expandable_reservation) (bool): In a resource pool with an expandable
reservation, the reservation can grow beyond the specified value, if the
parent resource pool has unreserved resources. A non-expandable reservation
- is called a fixed reservation. ([''present''])'
+ is called a fixed reservation.'
+ - If unset or empty, I(expandable_reservation) will be set to true. (['present'])
- ' - C(limit) (int): The utilization of a resource pool will not exceed this
limit, even if there are available resources. This is typically used to
ensure a consistent performance of resource pools independent of available
resources. If set to -1, then there is no fixed limit on resource usage
(only bounded by available resources and shares). Units are MB for memory,
- and MHz for CPU. ([''present''])'
+ and MHz for CPU.'
+ - If unset or empty, I(limit) will be set to -1. (['present'])
- ' - C(shares) (dict): Shares are used in case of resource contention. ([''present''])'
- ' - Accepted keys:'
- - ' - level (string): The C(level) defines the possible values for the
+ - ' - level (string): This option defines the possible values for the
allocation level.'
- 'Accepted value for this field:'
- ' - C(CUSTOM)'
- ' - C(HIGH)'
- ' - C(LOW)'
- ' - C(NORMAL)'
- - ' - shares (integer): When {@link #level} is set to CUSTOM, it is the
- number of shares allocated. Otherwise, this value is ignored. There is
- no unit for this value. It is a relative measure based on the settings
- for other resource pools.'
+ - ' - shares (integer): When I(level) is set to CUSTOM, it is the number
+ of shares allocated. Otherwise, this value is ignored. '
+ - ' There is no unit for this value. It is a relative measure based on the
+ settings for other resource pools.'
+ - ''
+ - This field is optional and it is only relevant when the value of I(level)
+ is CUSTOM.
type: dict
memory_allocation:
description:
- Resource allocation for CPU.
+ - if unset or empty, the CPU allocation of the resource pool will not be changed.
- 'Valid attributes are:'
- ' - C(reservation) (int): Amount of resource that is guaranteed available
to a resource pool. Reserved resources are not wasted if they are not
used. If the utilization is less than the reservation, the resources can
be utilized by other running virtual machines. Units are MB fo memory,
- and MHz for CPU. ([''present''])'
+ and MHz for CPU.'
+ - If unset or empty, I(reservation) will be set to 0. (['present'])
- ' - C(expandable_reservation) (bool): In a resource pool with an expandable
reservation, the reservation can grow beyond the specified value, if the
parent resource pool has unreserved resources. A non-expandable reservation
- is called a fixed reservation. ([''present''])'
+ is called a fixed reservation.'
+ - If unset or empty, I(expandable_reservation) will be set to true. (['present'])
- ' - C(limit) (int): The utilization of a resource pool will not exceed this
limit, even if there are available resources. This is typically used to
ensure a consistent performance of resource pools independent of available
resources. If set to -1, then there is no fixed limit on resource usage
(only bounded by available resources and shares). Units are MB for memory,
- and MHz for CPU. ([''present''])'
+ and MHz for CPU.'
+ - If unset or empty, I(limit) will be set to -1. (['present'])
- ' - C(shares) (dict): Shares are used in case of resource contention. ([''present''])'
- ' - Accepted keys:'
- - ' - level (string): The C(level) defines the possible values for the
+ - ' - level (string): This option defines the possible values for the
allocation level.'
- 'Accepted value for this field:'
- ' - C(CUSTOM)'
- ' - C(HIGH)'
- ' - C(LOW)'
- ' - C(NORMAL)'
- - ' - shares (integer): When {@link #level} is set to CUSTOM, it is the
- number of shares allocated. Otherwise, this value is ignored. There is
- no unit for this value. It is a relative measure based on the settings
- for other resource pools.'
+ - ' - shares (integer): When I(level) is set to CUSTOM, it is the number
+ of shares allocated. Otherwise, this value is ignored. '
+ - ' There is no unit for this value. It is a relative measure based on the
+ settings for other resource pools.'
+ - ''
+ - This field is optional and it is only relevant when the value of I(level)
+ is CUSTOM.
type: dict
name:
description:
- - Name of the resource pool. Required with I(state=['present'])
+ - Name of the resource pool.
+ - if unset or empty, the name of the resource pool will not be changed. Required
+ with I(state=['present'])
type: str
parent:
description:
- - Parent of the created resource pool. Required with I(state=['present'])
+ - Parent of the created resource pool.
+ - When clients pass a value of this structure as a parameter, the field must
+ be the id of a resource returned by M(vmware.vmware_rest.vcenter_resourcepool_info).
+ Required with I(state=['present'])
type: str
resource_pool:
description:
- - Identifier of the resource pool to be deleted. Required with I(state=['absent',
- 'present'])
+ - Identifier of the resource pool to be deleted.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_resourcepool_info).
+ Required with I(state=['absent', 'present'])
type: str
session_timeout:
description:
@@ -150,18 +167,17 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 0.3.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
- name: Get the existing resource pools
vmware.vmware_rest.vcenter_resourcepool_info:
register: resource_pools
-
- name: Create an Ad hoc resource pool
vmware.vmware_rest.vcenter_resourcepool:
name: my_resource_pool
@@ -179,18 +195,15 @@ EXAMPLES = r"""
shares:
level: NORMAL
register: my_resource_pool
-
- name: Remove a resource pool
vmware.vmware_rest.vcenter_resourcepool:
resource_pool: '{{ my_resource_pool.id }}'
state: absent
-
- name: Create a generic resource pool
vmware.vmware_rest.vcenter_resourcepool:
name: my_resource_pool
parent: '{{ resource_pools.value[0].resource_pool }}'
register: my_resource_pool
-
- name: Modify a resource pool
vmware.vmware_rest.vcenter_resourcepool:
resource_pool: '{{ my_resource_pool.id }}'
@@ -238,7 +251,6 @@ value:
# This structure describes the format of the data expected by the end-points
PAYLOAD_FORMAT = {
- "delete": {"query": {}, "body": {}, "path": {"resource_pool": "resource_pool"}},
"update": {
"query": {},
"body": {
@@ -258,10 +270,9 @@ PAYLOAD_FORMAT = {
},
"path": {},
},
+ "delete": {"query": {}, "body": {}, "path": {"resource_pool": "resource_pool"}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -276,26 +287,28 @@ 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",
@@ -368,7 +381,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
@@ -385,20 +397,16 @@ async def entry_point(module, session):
async def _create(params, session):
-
lookup_url = per_id_url = build_url(params)
uniquity_keys = ["resource_pool"]
comp_func = None
async def lookup_with_filters(params, session, url):
- # e.g: for the datacenter resources
- if "folder" not in params:
- return
+ search_filter = ""
+
if "name" not in params:
return
- async with session.get(
- f"{url}?names={params['name']}&folders={params['folder']}"
- ) as resp:
+ async with session.get(f"{url}?names={params['name']}{search_filter}") as resp:
_json = await resp.json()
if isinstance(_json, list) and len(_json) == 1:
return await get_device_info(session, url, _json[0]["resource_pool"])
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_resourcepool_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_resourcepool_info.py
index 84a4f6fc3..a4047e151 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_resourcepool_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_resourcepool_info.py
@@ -3,24 +3,22 @@
# 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"""
module: vcenter_resourcepool_info
-short_description: Retrieves information about the resource pool indicated by {@param.name
- resourcePool}.
-description: Retrieves information about the resource pool indicated by {@param.name
- resourcePool}.
+short_description: Retrieves information about the resource pool indicated by resourcePool.
+description: Retrieves information about the resource pool indicated by resourcePool.
options:
clusters:
description:
- Clusters that must contain the resource pool for the resource pool to match
the filter.
+ - If unset or empty, resource pools in any cluster match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_cluster_info).
elements: str
type: list
datacenters:
@@ -29,35 +27,49 @@ options:
description:
- Datacenters that must contain the resource pool for the resource pool to
match the filter.
+ - If unset or empty, resource pools in any datacenter match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_datacenter_info).
elements: str
type: list
hosts:
description:
- Hosts that must contain the resource pool for the resource pool to match
the filter.
+ - If unset or empty, resource pools in any host match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_host_info).
elements: str
type: list
names:
aliases:
- filter_names
description:
- - Names that resource pools must have to match the filter (see {@link Info#name}).
+ - Names that resource pools must have to match the filter (see I(name)).
+ - If unset or empty, resource pools with any name match the filter.
elements: str
type: list
parent_resource_pools:
description:
- Resource pools that must contain the resource pool for the resource pool
to match the filter.
+ - If unset or empty, resource pools in any resource pool match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_resourcepool_info).
elements: str
type: list
resource_pool:
description:
- Identifier of the resource pool for which information should be retrieved.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_resourcepool_info).
Required with I(state=['get'])
type: str
resource_pools:
description:
- Identifiers of resource pools that can match the filter.
+ - If unset or empty, resource pools with any identifier match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_resourcepool_info).
elements: str
type: list
session_timeout:
@@ -109,29 +121,26 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 0.3.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
- name: Get the existing resource pools
vmware.vmware_rest.vcenter_resourcepool_info:
register: resource_pools
-
- name: Get the existing resource pool
vmware.vmware_rest.vcenter_resourcepool_info:
resource_pool: '{{ resource_pools.value[0].resource_pool }}'
register: my_resource_pool
-
- name: Create a generic resource pool
vmware.vmware_rest.vcenter_resourcepool:
name: my_resource_pool
parent: '{{ resource_pools.value[0].resource_pool }}'
register: my_resource_pool
-
- name: Read details from a specific resource pool
vmware.vmware_rest.vcenter_resourcepool_info:
resource_pool: '{{ my_resource_pool.id }}'
@@ -183,8 +192,6 @@ PAYLOAD_FORMAT = {
},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -202,23 +209,23 @@ from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest imp
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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_storage_policies_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_storage_policies_info.py
index ad36661dd..eb9ccdee6 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_storage_policies_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_storage_policies_info.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"""
@@ -21,6 +18,9 @@ options:
policies:
description:
- Identifiers of storage policies that can match the filter.
+ - If unset or empty, storage policies with any identifiers match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_storage_policies).
elements: str
type: list
session_timeout:
@@ -72,11 +72,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 0.3.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -135,8 +135,6 @@ PAYLOAD_FORMAT = {
"list": {"query": {"policies": "policies"}, "body": {}, "path": {}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -151,26 +149,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm.py
index c71e80be0..af858bac2 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm.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"""
@@ -19,43 +16,51 @@ options:
description:
- 128-bit SMBIOS UUID of a virtual machine represented as a hexadecimal string
in "12345678-abcd-1234-cdef-123456789abc" format.
+ - If unset, will be generated.
type: str
boot:
description:
- Boot configuration.
+ - If unset, guest-specific default values will be used.
- 'Valid attributes are:'
- - ' - C(type) (str): The C(type) defines the valid firmware types for a virtual
+ - ' - C(type) (str): This option defines the valid firmware types for a virtual
machine. ([''present''])'
- ' - Accepted values:'
- ' - BIOS'
- ' - EFI'
- ' - C(efi_legacy_boot) (bool): Flag indicating whether to use EFI legacy
- boot mode. ([''present''])'
- - ' - C(network_protocol) (str): The C(network_protocol) defines the valid
- network boot protocols supported when booting a virtual machine with {@link
- Type#EFI} firmware over the network. ([''present''])'
+ boot mode.'
+ - If unset, defaults to value that is recommended for the guest OS and is
+ supported for the virtual hardware version. (['present'])
+ - ' - C(network_protocol) (str): This option defines the valid network boot
+ protocols supported when booting a virtual machine with EFI firmware over
+ the network. ([''present''])'
- ' - Accepted values:'
- ' - IPV4'
- ' - IPV6'
- ' - C(delay) (int): Delay in milliseconds before beginning the firmware
- boot process when the virtual machine is powered on. This delay may be
+ boot process when the virtual machine is powered on. This delay may be
used to provide a time window for users to connect to the virtual machine
- console and enter BIOS setup mode. ([''present''])'
+ console and enter BIOS setup mode.'
+ - If unset, default value is 0. (['present'])
- ' - C(retry) (bool): Flag indicating whether the virtual machine should
- automatically retry the boot process after a failure. ([''present''])'
+ automatically retry the boot process after a failure.'
+ - If unset, default value is false. (['present'])
- ' - C(retry_delay) (int): Delay in milliseconds before retrying the boot
- process after a failure; applicable only when {@link Info#retry} is true.
- ([''present''])'
+ process after a failure; applicable only when I(retry) is true.'
+ - If unset, default value is 10000. (['present'])
- ' - C(enter_setup_mode) (bool): Flag indicating whether the firmware boot
process should automatically enter setup mode the next time the virtual
- machine boots. Note that this flag will automatically be reset to false
- once the virtual machine enters setup mode. ([''present''])'
+ machine boots. Note that this flag will automatically be reset to false
+ once the virtual machine enters setup mode.'
+ - If unset, the value is unchanged. (['present'])
type: dict
boot_devices:
description:
- Boot device configuration.
+ - If unset, a server-specific boot sequence will be used.
- 'Valid attributes are:'
- - ' - C(type) (str): The C(type) defines the valid device types that may be
+ - ' - C(type) (str): This option defines the valid device types that may be
used as bootable devices. ([''present''])'
- ' This key is required with [''present''].'
- ' - Accepted values:'
@@ -68,168 +73,254 @@ options:
cdroms:
description:
- List of CD-ROMs.
+ - If unset, no CD-ROM devices will be created.
- 'Valid attributes are:'
- - ' - C(type) (str): The C(host_bus_adapter_type) defines the valid types
- of host bus adapters that may be used for attaching a Cdrom to a virtual
- machine. ([''present''])'
+ - ' - C(type) (str): This option defines the valid types of host bus adapters
+ that may be used for attaching a Cdrom to a virtual machine. ([''present''])'
- ' - Accepted values:'
- ' - IDE'
- ' - SATA'
- - ' - C(ide) (dict): Address for attaching the device to a virtual IDE adapter.
- ([''present''])'
+ - ' - C(ide) (dict): Address for attaching the device to a virtual IDE adapter.'
+ - If unset, the server will choose an available address; if none is available,
+ the request will fail. (['present'])
- ' - Accepted keys:'
- ' - primary (boolean): Flag specifying whether the device should be
attached to the primary or secondary IDE adapter of the virtual machine.'
+ - If unset, the server will choose a adapter with an available connection.
+ If no IDE connections are available, the request will be rejected.
- ' - master (boolean): Flag specifying whether the device should be the
master or slave device on the IDE adapter.'
- - ' - C(sata) (dict): Address for attaching the device to a virtual SATA adapter.
- ([''present''])'
+ - If unset, the server will choose an available connection type. If no IDE
+ connections are available, the request will be rejected.
+ - ' - C(sata) (dict): Address for attaching the device to a virtual SATA adapter.'
+ - If unset, the server will choose an available address; if none is available,
+ the request will fail. (['present'])
- ' - Accepted keys:'
- ' - bus (integer): Bus number of the adapter to which the device should
be attached.'
- ' - unit (integer): Unit number of the device.'
+ - If unset, the server will choose an available unit number on the specified
+ adapter. If there are no available connections on the adapter, the request
+ will be rejected.
- ' - C(backing) (dict): Physical resource backing for the virtual CD-ROM
- device. ([''present''])'
+ device.'
+ - If unset, defaults to automatic detection of a suitable host device. (['present'])
- ' - Accepted keys:'
- - ' - type (string): The C(backing_type) defines the valid backing types
- for a virtual CD-ROM device.'
+ - ' - type (string): This option defines the valid backing types for a
+ virtual CD-ROM device.'
- 'Accepted value for this field:'
- ' - C(CLIENT_DEVICE)'
- ' - C(HOST_DEVICE)'
- ' - C(ISO_FILE)'
- ' - iso_file (string): Path of the image file that should be used as
the virtual CD-ROM device backing.'
+ - This field is optional and it is only relevant when the value of I(type)
+ is ISO_FILE.
- ' - host_device (string): Name of the device that should be used as
the virtual CD-ROM device backing.'
- - ' - device_access_type (string): The C(device_access_type) defines the
- valid device access types for a physical device packing of a virtual CD-ROM
- device.'
+ - If unset, the virtual CD-ROM device will be configured to automatically
+ detect a suitable host device.
+ - ' - device_access_type (string): This option defines the valid device
+ access types for a physical device packing of a virtual CD-ROM device.'
- 'Accepted value for this field:'
- ' - C(EMULATION)'
- ' - C(PASSTHRU)'
- ' - C(PASSTHRU_EXCLUSIVE)'
- ' - C(start_connected) (bool): Flag indicating whether the virtual device
- should be connected whenever the virtual machine is powered on. ([''present''])'
+ should be connected whenever the virtual machine is powered on.'
+ - Defaults to false if unset. (['present'])
- ' - C(allow_guest_control) (bool): Flag indicating whether the guest can
- connect and disconnect the device. ([''present''])'
+ connect and disconnect the device.'
+ - Defaults to false if unset. (['present'])
elements: dict
type: list
cpu:
description:
- CPU configuration.
+ - If unset, guest-specific default values will be used.
- 'Valid attributes are:'
- - ' - C(count) (int): New number of CPU cores. The number of CPU cores in
- the virtual machine must be a multiple of the number of cores per socket.
- The supported range of CPU counts is constrained by the configured guest
- operating system and virtual hardware version of the virtual machine.
- If the virtual machine is running, the number of CPU cores may only be
- increased if {@link Info#hotAddEnabled} is true, and may only be decreased
- if {@link Info#hotRemoveEnabled} is true. ([''present''])'
- - ' - C(cores_per_socket) (int): New number of CPU cores per socket. The
- number of CPU cores in the virtual machine must be a multiple of the number
- of cores per socket. ([''present''])'
+ - ' - C(count) (int): New number of CPU cores. The number of CPU cores in
+ the virtual machine must be a multiple of the number of cores per socket. '
+ - ' The supported range of CPU counts is constrained by the configured guest
+ operating system and virtual hardware version of the virtual machine. '
+ - ''
+ - ' If the virtual machine is running, the number of CPU cores may only be
+ increased if I(hot_add_enabled) is true, and may only be decreased if
+ I(hot_remove_enabled) is true.'
+ - ''
+ - If unset, the value is unchanged. (['present'])
+ - ' - C(cores_per_socket) (int): New number of CPU cores per socket. The number
+ of CPU cores in the virtual machine must be a multiple of the number of
+ cores per socket.'
+ - If unset, the value is unchanged. (['present'])
- ' - C(hot_add_enabled) (bool): Flag indicating whether adding CPUs while
- the virtual machine is running is enabled. This field may only be modified
- if the virtual machine is powered off. ([''present''])'
+ the virtual machine is running is enabled. '
+ - ' This field may only be modified if the virtual machine is powered off.'
+ - ''
+ - If unset, the value is unchanged. (['present'])
- ' - C(hot_remove_enabled) (bool): Flag indicating whether removing CPUs
- while the virtual machine is running is enabled. This field may only be
- modified if the virtual machine is powered off. ([''present''])'
+ while the virtual machine is running is enabled. '
+ - ' This field may only be modified if the virtual machine is powered off.'
+ - ''
+ - If unset, the value is unchanged. (['present'])
type: dict
datastore:
description:
- Identifier of the datastore on which the virtual machine's configuration
state is stored.
+ - If unset, I(path) must also be unset and I(datastore_path) must be set.
+ - 'When clients pass a value of this structure as a parameter, the field must
+ be the id of a resource returned by M(vmware.vmware_rest.vcenter_datastore_info). '
type: str
datastore_path:
description:
- Datastore path for the virtual machine's configuration file in the format
- "[datastore name] path". For example "[storage1] Test-VM/Test-VM.vmx".
+ "[datastore name] path". For example "[storage1] Test-VM/Test-VM.vmx".
+ - If unset, both I(datastore) and I(path) must be set.
type: str
disconnect_all_nics:
description:
- Indicates whether all NICs on the destination virtual machine should be
disconnected from the newtwork
+ - If unset, connection status of all NICs on the destination virtual machine
+ will be the same as on the source virtual machine.
type: bool
disks:
description:
- Individual disk relocation map.
+ - If unset, all disks will migrate to the datastore specified in the I(datastore)
+ field of I()
+ - 'When clients pass a value of this structure as a parameter, the key in
+ the field map must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_hardware_disk). '
- 'Valid attributes are:'
- - ' - C(type) (str): The C(host_bus_adapter_type) defines the valid types
- of host bus adapters that may be used for attaching a virtual storage
- device to a virtual machine. ([''present''])'
+ - ' - C(type) (str): This option defines the valid types of host bus adapters
+ that may be used for attaching a virtual storage device to a virtual machine.
+ ([''present''])'
- ' - Accepted values:'
- ' - IDE'
+ - ' - NVME'
- ' - SATA'
- ' - SCSI'
- - ' - C(ide) (dict): Address for attaching the device to a virtual IDE adapter.
- ([''present''])'
+ - ' - C(ide) (dict): Address for attaching the device to a virtual IDE adapter.'
+ - If unset, the server will choose an available address; if none is available,
+ the request will fail. (['present'])
- ' - Accepted keys:'
- ' - primary (boolean): Flag specifying whether the device should be
attached to the primary or secondary IDE adapter of the virtual machine.'
+ - If unset, the server will choose a adapter with an available connection.
+ If no IDE connections are available, the request will be rejected.
- ' - master (boolean): Flag specifying whether the device should be the
master or slave device on the IDE adapter.'
- - ' - C(scsi) (dict): Address for attaching the device to a virtual SCSI adapter.
- ([''present''])'
+ - If unset, the server will choose an available connection type. If no IDE
+ connections are available, the request will be rejected.
+ - ' - C(scsi) (dict): Address for attaching the device to a virtual SCSI adapter.'
+ - If unset, the server will choose an available address; if none is available,
+ the request will fail. (['present'])
- ' - Accepted keys:'
- ' - bus (integer): Bus number of the adapter to which the device should
be attached.'
- ' - unit (integer): Unit number of the device.'
- - ' - C(sata) (dict): Address for attaching the device to a virtual SATA adapter.
- ([''present''])'
+ - If unset, the server will choose an available unit number on the specified
+ adapter. If there are no available connections on the adapter, the request
+ will be rejected.
+ - ' - C(sata) (dict): Address for attaching the device to a virtual SATA adapter.'
+ - If unset, the server will choose an available address; if none is available,
+ the request will fail. (['present'])
+ - ' - Accepted keys:'
+ - ' - bus (integer): Bus number of the adapter to which the device should
+ be attached.'
+ - ' - unit (integer): Unit number of the device.'
+ - If unset, the server will choose an available unit number on the specified
+ adapter. If there are no available connections on the adapter, the request
+ will be rejected.
+ - ' - C(nvme) (dict): Address for attaching the device to a virtual NVMe adapter.'
+ - If unset, the server will choose an available address; if none is available,
+ the request will fail. (['present'])
- ' - Accepted keys:'
- ' - bus (integer): Bus number of the adapter to which the device should
be attached.'
- ' - unit (integer): Unit number of the device.'
+ - If unset, the server will choose an available unit number on the specified
+ adapter. If there are no available connections on the adapter, the request
+ will be rejected.
- ' - C(backing) (dict): Existing physical resource backing for the virtual
- disk. Exactly one of C(#backing) or C(#new_vmdk) must be specified. ([''present''])'
+ disk. Exactly one of I(backing) or I(new_vmdk) must be specified.'
+ - If unset, the virtual disk will not be connected to an existing backing.
+ (['present'])
- ' - Accepted keys:'
- - ' - type (string): The C(backing_type) defines the valid backing types
- for a virtual disk.'
+ - ' - type (string): This option defines the valid backing types for a
+ virtual disk.'
- 'Accepted value for this field:'
- ' - C(VMDK_FILE)'
- ' - vmdk_file (string): Path of the VMDK file backing the virtual disk.'
+ - This field is optional and it is only relevant when the value of I(type)
+ is VMDK_FILE.
- ' - C(new_vmdk) (dict): Specification for creating a new VMDK backing for
- the virtual disk. Exactly one of C(#backing) or C(#new_vmdk) must be
- specified. ([''present''])'
+ the virtual disk. Exactly one of I(backing) or I(new_vmdk) must be specified.'
+ - If unset, a new VMDK backing will not be created. (['present'])
- ' - Accepted keys:'
- - ' - name (string): Base name of the VMDK file. The name should not
- include the ''.vmdk'' file extension.'
+ - ' - name (string): Base name of the VMDK file. The name should not include
+ the ''.vmdk'' file extension.'
+ - If unset, a name (derived from the name of the virtual machine) will be
+ chosen by the server.
- ' - capacity (integer): Capacity of the virtual disk backing in bytes.'
- - ' - storage_policy (object): The C(storage_policy_spec) {@term structure}
- contains information about the storage policy that is to be associated
- the with VMDK file.'
+ - If unset, defaults to a guest-specific capacity.
+ - ' - storage_policy (object): The I(storage_policy_spec) structure contains
+ information about the storage policy that is to be associated the with
+ VMDK file.'
+ - 'If unset the default storage policy of the target datastore (if applicable)
+ is applied. Currently a default storage policy is only supported by object
+ based datastores : VVol & vSAN. For non- object datastores, if unset then
+ no storage policy would be associated with the VMDK file.'
elements: dict
type: list
disks_to_remove:
description:
- Set of Disks to Remove.
+ - If unset, all disks will be copied. If the same identifier is in I(disks_to_update)
+ InvalidArgument fault will be returned.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_vm_hardware_disk).
elements: str
type: list
disks_to_update:
description:
- Map of Disks to Update.
+ - If unset, all disks will copied to the datastore specified in the I(datastore)
+ field of I() If the same identifier is in I(disks_to_remove) InvalidArgument
+ fault will be thrown.
+ - 'When clients pass a value of this structure as a parameter, the key in
+ the field map must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_hardware_disk). '
type: dict
floppies:
description:
- List of floppy drives.
+ - If unset, no floppy drives will be created.
- 'Valid attributes are:'
- ' - C(backing) (dict): Physical resource backing for the virtual floppy
- drive. ([''present''])'
+ drive.'
+ - If unset, defaults to automatic detection of a suitable host device. (['present'])
- ' - Accepted keys:'
- - ' - type (string): The C(backing_type) defines the valid backing types
- for a virtual floppy drive.'
+ - ' - type (string): This option defines the valid backing types for a
+ virtual floppy drive.'
- 'Accepted value for this field:'
- ' - C(CLIENT_DEVICE)'
- ' - C(HOST_DEVICE)'
- ' - C(IMAGE_FILE)'
- ' - image_file (string): Path of the image file that should be used
as the virtual floppy drive backing.'
+ - This field is optional and it is only relevant when the value of I(type)
+ is IMAGE_FILE.
- ' - host_device (string): Name of the device that should be used as
the virtual floppy drive backing.'
+ - If unset, the virtual floppy drive will be configured to automatically detect
+ a suitable host device.
- ' - C(start_connected) (bool): Flag indicating whether the virtual device
- should be connected whenever the virtual machine is powered on. ([''present''])'
+ should be connected whenever the virtual machine is powered on.'
+ - Defaults to false if unset. (['present'])
- ' - C(allow_guest_control) (bool): Flag indicating whether the guest can
- connect and disconnect the device. ([''present''])'
+ connect and disconnect the device.'
+ - Defaults to false if unset. (['present'])
elements: dict
type: list
guest_OS:
@@ -416,15 +507,17 @@ options:
- WIN_XP_PRO
- WIN_XP_PRO_64
description:
- - The C(guest_o_s) defines the valid guest operating system types used for
- configuring a virtual machine. Required with I(state=['present'])
+ - The GuestOS enumerated type defines the valid guest operating system types
+ used for configuring a virtual machine. Required with I(state=['present'])
type: str
guest_customization_spec:
description:
- Guest customization spec to apply to the virtual machine after the virtual
machine is deployed.
+ - If unset, the guest operating system is not customized after clone.
- 'Valid attributes are:'
- - ' - C(name) (str): Name of the customization specification. ([''clone''])'
+ - ' - C(name) (str): Name of the customization specification.'
+ - If unset, no guest customization is performed. (['clone'])
type: dict
hardware_version:
choices:
@@ -445,38 +538,48 @@ options:
- VMX_18
- VMX_19
description:
- - The C(version) defines the valid virtual hardware versions for a virtual
- machine. See https://kb.vmware.com/s/article/1003746 (Virtual machine
- hardware versions (1003746)).
+ - The I(version) enumerated type defines the valid virtual hardware versions
+ for a virtual machine. See https://kb.vmware.com/s/article/1003746 (Virtual
+ machine hardware versions (1003746)).
type: str
memory:
description:
- Memory configuration.
+ - If unset, guest-specific default values will be used.
- 'Valid attributes are:'
- - ' - C(size_MiB) (int): New memory size in mebibytes. The supported range
- of memory sizes is constrained by the configured guest operating system
- and virtual hardware version of the virtual machine. If the virtual machine
- is running, this value may only be changed if {@link Info#hotAddEnabled}
+ - ' - C(size_MiB) (int): New memory size in mebibytes. '
+ - ' The supported range of memory sizes is constrained by the configured guest
+ operating system and virtual hardware version of the virtual machine. '
+ - ''
+ - ' If the virtual machine is running, this value may only be changed if I(hot_add_enabled)
is true, and the new memory size must satisfy the constraints specified
- by {@link Info#hotAddIncrementSizeMiB} and {@link Info#hotAddLimitMiB}.
- ([''present''])'
+ by I(hot_add_increment_size_mib) and I()'
+ - ''
+ - If unset, the value is unchanged. (['present'])
- ' - C(hot_add_enabled) (bool): Flag indicating whether adding memory while
- the virtual machine is running should be enabled. Some guest operating
- systems may consume more resources or perform less efficiently when they
- run on hardware that supports adding memory while the machine is running.
- This field may only be modified if the virtual machine is not powered
- on. ([''present''])'
+ the virtual machine is running should be enabled. '
+ - ' Some guest operating systems may consume more resources or perform less
+ efficiently when they run on hardware that supports adding memory while
+ the machine is running. '
+ - ''
+ - ' This field may only be modified if the virtual machine is not powered
+ on.'
+ - ''
+ - If unset, the value is unchanged. (['present'])
type: dict
name:
description:
- - Name of the new virtual machine.
+ - Virtual machine name.
+ - If unset, the display name from the virtual machine's configuration file
+ will be used.
type: str
nics:
description:
- List of Ethernet adapters.
+ - If unset, no Ethernet adapters will be created.
- 'Valid attributes are:'
- - ' - C(type) (str): The C(emulation_type) defines the valid emulation types
- for a virtual Ethernet adapter. ([''present''])'
+ - ' - C(type) (str): This option defines the valid emulation types for a virtual
+ Ethernet adapter. ([''present''])'
- ' - Accepted values:'
- ' - E1000'
- ' - E1000E'
@@ -485,25 +588,31 @@ options:
- ' - VMXNET2'
- ' - VMXNET3'
- ' - C(upt_compatibility_enabled) (bool): Flag indicating whether Universal
- Pass-Through (UPT) compatibility is enabled on this virtual Ethernet adapter.
- ([''present''])'
- - ' - C(mac_type) (str): The C(mac_address_type) defines the valid MAC address
- origins for a virtual Ethernet adapter. ([''present''])'
+ Pass-Through (UPT) compatibility is enabled on this virtual Ethernet adapter.'
+ - If unset, defaults to false. (['present'])
+ - ' - C(mac_type) (str): This option defines the valid MAC address origins
+ for a virtual Ethernet adapter. ([''present''])'
- ' - Accepted values:'
- ' - ASSIGNED'
- ' - GENERATED'
- ' - MANUAL'
- - ' - C(mac_address) (str): MAC address. ([''present''])'
+ - ' - C(mac_address) (str): MAC address.'
+ - Workaround for PR1459647 (['present'])
- ' - C(pci_slot_number) (int): Address of the virtual Ethernet adapter on
- the PCI bus. If the PCI address is invalid, the server will change when
- it the VM is started or as the device is hot added. ([''present''])'
+ the PCI bus. If the PCI address is invalid, the server will change when
+ it the VM is started or as the device is hot added.'
+ - If unset, the server will choose an available address when the virtual machine
+ is powered on. (['present'])
- ' - C(wake_on_lan_enabled) (bool): Flag indicating whether wake-on-LAN is
- enabled on this virtual Ethernet adapter. ([''present''])'
+ enabled on this virtual Ethernet adapter.'
+ - Defaults to false if unset. (['present'])
- ' - C(backing) (dict): Physical resource backing for the virtual Ethernet
- adapter. ([''present''])'
+ adapter.'
+ - If unset, the system may try to find an appropriate backing. If one is not
+ found, the request will fail. (['present'])
- ' - Accepted keys:'
- - ' - type (string): The C(backing_type) defines the valid backing types
- for a virtual Ethernet adapter.'
+ - ' - type (string): This option defines the valid backing types for a
+ virtual Ethernet adapter.'
- 'Accepted value for this field:'
- ' - C(DISTRIBUTED_PORTGROUP)'
- ' - C(HOST_DEVICE)'
@@ -511,115 +620,208 @@ options:
- ' - C(STANDARD_PORTGROUP)'
- ' - network (string): Identifier of the network that backs the virtual
Ethernet adapter.'
+ - This field is optional and it is only relevant when the value of I(type)
+ is one of STANDARD_PORTGROUP, DISTRIBUTED_PORTGROUP, or OPAQUE_NETWORK.
+ - 'When clients pass a value of this structure as a parameter, the field must
+ be the id of a resource returned by M(vmware.vmware_rest.vcenter_network_info). '
- ' - distributed_port (string): Key of the distributed virtual port that
- backs the virtual Ethernet adapter. Depending on the type of the Portgroup,
+ backs the virtual Ethernet adapter. Depending on the type of the Portgroup,
the port may be specified using this field. If the portgroup type is early-binding
(also known as static), a port is assigned when the Ethernet adapter is
configured to use the port. The port may be either automatically or specifically
assigned based on the value of this field. If the portgroup type is ephemeral,
the port is created and assigned to a virtual machine when it is powered
- on and the Ethernet adapter is connected. This field cannot be specified
+ on and the Ethernet adapter is connected. This field cannot be specified
as no free ports exist before use.'
+ - May be used to specify a port when the network specified on the I(network)
+ field is a static or early binding distributed portgroup. If unset, the
+ port will be automatically assigned to the Ethernet adapter based on the
+ policy embodied by the portgroup type.
- ' - C(start_connected) (bool): Flag indicating whether the virtual device
- should be connected whenever the virtual machine is powered on. ([''present''])'
+ should be connected whenever the virtual machine is powered on.'
+ - Defaults to false if unset. (['present'])
- ' - C(allow_guest_control) (bool): Flag indicating whether the guest can
- connect and disconnect the device. ([''present''])'
+ connect and disconnect the device.'
+ - Defaults to false if unset. (['present'])
elements: dict
type: list
nics_to_update:
description:
- Map of NICs to update.
+ - If unset, no NICs will be updated.
+ - 'When clients pass a value of this structure as a parameter, the key in
+ the field map must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_hardware_ethernet). '
type: dict
+ nvme_adapters:
+ description:
+ - List of NVMe adapters.
+ - If unset, any adapters necessary to connect the virtual machine's storage
+ devices will be created; this includes any devices that explicitly specify
+ a NVMe host bus adapter, as well as any devices that do not specify a
+ host bus adapter if the guest's preferred adapter type is NVMe.
+ - 'Valid attributes are:'
+ - ' - C(bus) (int): NVMe bus number.'
+ - If unset, the server will choose an available bus number; if none is available,
+ the request will fail. (['present'])
+ - ' - C(pci_slot_number) (int): Address of the NVMe adapter on the PCI bus.'
+ - If unset, the server will choose an available address when the virtual machine
+ is powered on. (['present'])
+ elements: dict
+ type: list
parallel_ports:
description:
- List of parallel ports.
+ - If unset, no parallel ports will be created.
- 'Valid attributes are:'
- ' - C(backing) (dict): Physical resource backing for the virtual parallel
- port. ([''present''])'
+ port.'
+ - If unset, defaults to automatic detection of a suitable host device. (['present'])
- ' - Accepted keys:'
- - ' - type (string): The C(backing_type) defines the valid backing types
- for a virtual parallel port.'
+ - ' - type (string): This option defines the valid backing types for a
+ virtual parallel port.'
- 'Accepted value for this field:'
- ' - C(FILE)'
- ' - C(HOST_DEVICE)'
- ' - file (string): Path of the file that should be used as the virtual
parallel port backing.'
+ - This field is optional and it is only relevant when the value of I(type)
+ is FILE.
- ' - host_device (string): Name of the device that should be used as
the virtual parallel port backing.'
+ - If unset, the virtual parallel port will be configured to automatically
+ detect a suitable host device.
- ' - C(start_connected) (bool): Flag indicating whether the virtual device
- should be connected whenever the virtual machine is powered on. ([''present''])'
+ should be connected whenever the virtual machine is powered on.'
+ - Defaults to false if unset. (['present'])
- ' - C(allow_guest_control) (bool): Flag indicating whether the guest can
- connect and disconnect the device. ([''present''])'
+ connect and disconnect the device.'
+ - Defaults to false if unset. (['present'])
elements: dict
type: list
parallel_ports_to_update:
description:
- Map of parallel ports to Update.
+ - If unset, no parallel ports will be updated.
+ - 'When clients pass a value of this structure as a parameter, the key in
+ the field map must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_hardware_parallel). '
type: dict
path:
description:
- 'Path to the virtual machine''s configuration file on the datastore corresponding
to {@link #datastore).'
+ - If unset, I(datastore) must also be unset and I(datastore_path) must be
+ set.
type: str
placement:
description:
- Virtual machine placement information.
+ - If this field is unset, the system will use the values from the source virtual
+ machine. If specified, each field will be used for placement. If the fields
+ result in disjoint placement the operation will fail. If the fields along
+ with the other existing placement of the virtual machine result in disjoint
+ placement the operation will fail.
- 'Valid attributes are:'
- ' - C(folder) (str): Virtual machine folder into which the virtual machine
- should be placed. ([''clone'', ''instant_clone'', ''present'', ''register'',
- ''relocate''])'
+ should be placed.'
+ - If this field is unset, the virtual machine will stay in the current folder.
+ - When clients pass a value of this structure as a parameter, the field must
+ be the id of a resource returned by M(vmware.vmware_rest.vcenter_folder_info).
+ (['clone', 'instant_clone', 'present', 'register', 'relocate'])
- ' - C(resource_pool) (str): Resource pool into which the virtual machine
- should be placed. ([''clone'', ''instant_clone'', ''present'', ''register'',
- ''relocate''])'
- - ' - C(host) (str): Host onto which the virtual machine should be placed.
- If C(#host) and C(#resource_pool) are both specified, C(#resource_pool)
- must belong to C(#host). If C(#host) and C(#cluster) are both specified,
- C(#host) must be a member of C(#cluster). ([''clone'', ''present'', ''register'',
- ''relocate''])'
- - ' - C(cluster) (str): Cluster into which the virtual machine should be placed.
- If C(#cluster) and C(#resource_pool) are both specified, C(#resource_pool)
- must belong to C(#cluster). If C(#cluster) and C(#host) are both specified,
- C(#host) must be a member of C(#cluster). ([''clone'', ''present'', ''register'',
- ''relocate''])'
+ should be placed.'
+ - If this field is unset, the virtual machine will stay in the current resource
+ pool.
+ - When clients pass a value of this structure as a parameter, the field must
+ be the id of a resource returned by M(vmware.vmware_rest.vcenter_resourcepool_info).
+ (['clone', 'instant_clone', 'present', 'register', 'relocate'])
+ - ' - C(host) (str): Host onto which the virtual machine should be placed. '
+ - ' If I(host) and I(resource_pool) are both specified, I(resource_pool) must
+ belong to I(host). '
+ - ''
+ - ' If I(host) and I(cluster) are both specified, I(host) must be a member
+ of I(cluster).'
+ - ''
+ - If this field is unset, if I(resource_pool) is unset, the virtual machine
+ will remain on the current host. if I(resource_pool) is set, and the target
+ is a standalone host, the host is used. if I(resource_pool) is set, and
+ the target is a DRS cluster, a host will be picked by DRS. if I(resource_pool)
+ is set, and the target is a cluster without DRS, InvalidArgument will
+ be thrown.
+ - When clients pass a value of this structure as a parameter, the field must
+ be the id of a resource returned by M(vmware.vmware_rest.vcenter_host_info).
+ (['clone', 'present', 'register', 'relocate'])
+ - ' - C(cluster) (str): Cluster into which the virtual machine should be placed. '
+ - ' If I(cluster) and I(resource_pool) are both specified, I(resource_pool)
+ must belong to I(cluster). '
+ - ''
+ - ' If I(cluster) and I(host) are both specified, I(host) must be a member
+ of I(cluster).'
+ - ''
+ - If I(resource_pool) or I(host) is specified, it is recommended that this
+ field be unset.
+ - When clients pass a value of this structure as a parameter, the field must
+ be the id of a resource returned by M(vmware.vmware_rest.vcenter_cluster_info).
+ (['clone', 'present', 'register', 'relocate'])
- ' - C(datastore) (str): Datastore on which the virtual machine''s configuration
- state should be stored. This datastore will also be used for any virtual
+ state should be stored. This datastore will also be used for any virtual
disks that are associated with the virtual machine, unless individually
- overridden. ([''clone'', ''instant_clone'', ''present'', ''relocate''])'
+ overridden.'
+ - If this field is unset, the virtual machine will remain on the current datastore.
+ - When clients pass a value of this structure as a parameter, the field must
+ be the id of a resource returned by M(vmware.vmware_rest.vcenter_datastore_info).
+ (['clone', 'instant_clone', 'present', 'relocate'])
type: dict
power_on:
description:
- - 'Attempt to perform a {@link #powerOn} after clone.'
+ - Attempt to perform a I(power_on) after clone.
+ - If unset, the virtual machine will not be powered on.
type: bool
sata_adapters:
description:
- List of SATA adapters.
+ - If unset, any adapters necessary to connect the virtual machine's storage
+ devices will be created; this includes any devices that explicitly specify
+ a SATA host bus adapter, as well as any devices that do not specify a
+ host bus adapter if the guest's preferred adapter type is SATA.
- 'Valid attributes are:'
- - ' - C(type) (str): The C(type) defines the valid emulation types for a virtual
+ - ' - C(type) (str): This option defines the valid emulation types for a virtual
SATA adapter. ([''present''])'
- ' - Accepted values:'
- ' - AHCI'
- - ' - C(bus) (int): SATA bus number. ([''present''])'
- - ' - C(pci_slot_number) (int): Address of the SATA adapter on the PCI bus.
- ([''present''])'
+ - ' - C(bus) (int): SATA bus number.'
+ - If unset, the server will choose an available bus number; if none is available,
+ the request will fail. (['present'])
+ - ' - C(pci_slot_number) (int): Address of the SATA adapter on the PCI bus.'
+ - If unset, the server will choose an available address when the virtual machine
+ is powered on. (['present'])
elements: dict
type: list
scsi_adapters:
description:
- List of SCSI adapters.
+ - If unset, any adapters necessary to connect the virtual machine's storage
+ devices will be created; this includes any devices that explicitly specify
+ a SCSI host bus adapter, as well as any devices that do not specify a
+ host bus adapter if the guest's preferred adapter type is SCSI. The type
+ of the SCSI adapter will be a guest-specific default type.
- 'Valid attributes are:'
- - ' - C(type) (str): The C(type) defines the valid emulation types for a virtual
+ - ' - C(type) (str): This option defines the valid emulation types for a virtual
SCSI adapter. ([''present''])'
- ' - Accepted values:'
- ' - BUSLOGIC'
- ' - LSILOGIC'
- ' - LSILOGICSAS'
- ' - PVSCSI'
- - ' - C(bus) (int): SCSI bus number. ([''present''])'
- - ' - C(pci_slot_number) (int): Address of the SCSI adapter on the PCI bus. If
- the PCI address is invalid, the server will change it when the VM is started
- or as the device is hot added. ([''present''])'
- - ' - C(sharing) (str): The C(sharing) defines the valid bus sharing modes
- for a virtual SCSI adapter. ([''present''])'
+ - ' - C(bus) (int): SCSI bus number.'
+ - If unset, the server will choose an available bus number; if none is available,
+ the request will fail. (['present'])
+ - ' - C(pci_slot_number) (int): Address of the SCSI adapter on the PCI bus.
+ If the PCI address is invalid, the server will change it when the VM is
+ started or as the device is hot added.'
+ - If unset, the server will choose an available address when the virtual machine
+ is powered on. (['present'])
+ - ' - C(sharing) (str): This option defines the valid bus sharing modes for
+ a virtual SCSI adapter. ([''present''])'
- ' - Accepted values:'
- ' - NONE'
- ' - PHYSICAL'
@@ -629,17 +831,20 @@ options:
serial_ports:
description:
- List of serial ports.
+ - If unset, no serial ports will be created.
- 'Valid attributes are:'
- ' - C(yield_on_poll) (bool): CPU yield behavior. If set to true, the virtual
machine will periodically relinquish the processor if its sole task is
polling the virtual serial port. The amount of time it takes to regain
the processor will depend on the degree of other virtual machine activity
- on the host. ([''present''])'
+ on the host.'
+ - If unset, defaults to false. (['present'])
- ' - C(backing) (dict): Physical resource backing for the virtual serial
- port. ([''present''])'
+ port.'
+ - If unset, defaults to automatic detection of a suitable host device. (['present'])
- ' - Accepted keys:'
- - ' - type (string): The C(backing_type) defines the valid backing types
- for a virtual serial port.'
+ - ' - type (string): This option defines the valid backing types for a
+ virtual serial port.'
- 'Accepted value for this field:'
- ' - C(FILE)'
- ' - C(HOST_DEVICE)'
@@ -648,33 +853,51 @@ options:
- ' - C(PIPE_CLIENT)'
- ' - C(PIPE_SERVER)'
- ' - file (string): Path of the file backing the virtual serial port.'
+ - This field is optional and it is only relevant when the value of I(type)
+ is FILE.
- ' - host_device (string): Name of the device backing the virtual serial
- port. <p>'
+ port. '
+ - ''
+ - ''
+ - If unset, the virtual serial port will be configured to automatically detect
+ a suitable host device.
- ' - pipe (string): Name of the pipe backing the virtual serial port.'
+ - This field is optional and it is only relevant when the value of I(type)
+ is one of PIPE_SERVER or PIPE_CLIENT.
- ' - no_rx_loss (boolean): Flag that enables optimized data transfer
over the pipe. When the value is true, the host buffers data to prevent
- data overrun. This allows the virtual machine to read all of the data
+ data overrun. This allows the virtual machine to read all of the data
transferred over the pipe with no data loss.'
+ - If unset, defaults to false.
- ' - network_location (string): URI specifying the location of the network
- service backing the virtual serial port. <ul> <li>If {@link #type} is
- {@link BackingType#NETWORK_SERVER}, this field is the location used by
- clients to connect to this server. The hostname part of the URI should
- either be empty or should specify the address of the host on which the
- virtual machine is running.</li> <li>If {@link #type} is {@link BackingType#NETWORK_CLIENT},
- this field is the location used by the virtual machine to connect to the
- remote server.</li> </ul>'
+ service backing the virtual serial port. '
+ - ' - If I(type) is NETWORK_SERVER, this field is the location used by clients
+ to connect to this server. The hostname part of the URI should either
+ be empty or should specify the address of the host on which the virtual
+ machine is running.'
+ - ' - If I(type) is NETWORK_CLIENT, this field is the location used by the
+ virtual machine to connect to the remote server.'
+ - ' '
+ - This field is optional and it is only relevant when the value of I(type)
+ is one of NETWORK_SERVER or NETWORK_CLIENT.
- ' - proxy (string): Proxy service that provides network access to the
- network backing. If set, the virtual machine initiates a connection with
+ network backing. If set, the virtual machine initiates a connection with
the proxy service and forwards the traffic to the proxy.'
+ - If unset, no proxy service should be used.
- ' - C(start_connected) (bool): Flag indicating whether the virtual device
- should be connected whenever the virtual machine is powered on. ([''present''])'
+ should be connected whenever the virtual machine is powered on.'
+ - Defaults to false if unset. (['present'])
- ' - C(allow_guest_control) (bool): Flag indicating whether the guest can
- connect and disconnect the device. ([''present''])'
+ connect and disconnect the device.'
+ - Defaults to false if unset. (['present'])
elements: dict
type: list
serial_ports_to_update:
description:
- Map of serial ports to Update.
+ - If unset, no serial ports will be updated.
+ - 'When clients pass a value of this structure as a parameter, the key in
+ the field map must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_hardware_serial). '
type: dict
session_timeout:
description:
@@ -686,7 +909,10 @@ options:
version_added: 2.1.0
source:
description:
- - Virtual machine to InstantClone from. Required with I(state=['clone', 'instant_clone'])
+ - Virtual machine to InstantClone from.
+ - When clients pass a value of this structure as a parameter, the field must
+ be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_info).
+ Required with I(state=['clone', 'instant_clone'])
type: str
state:
choices:
@@ -702,12 +928,19 @@ options:
type: str
storage_policy:
description:
- - The C(storage_policy_spec) {@term structure} contains information about
- the storage policy that is to be associated with the virtual machine home
- (which contains the configuration and log files). Required with I(state=['present'])
+ - The I(storage_policy_spec) structure contains information about the storage
+ policy that is to be associated with the virtual machine home (which contains
+ the configuration and log files).
+ - 'If unset the datastore default storage policy (if applicable) is applied.
+ Currently a default storage policy is only supported by object datastores
+ : VVol and vSAN. For non-object datastores, if unset then no storage policy
+ would be associated with the virtual machine home. Required with I(state=[''present''])'
- 'Valid attributes are:'
- ' - C(policy) (str): Identifier of the storage policy which should be associated
- with the virtual machine. ([''present''])'
+ with the virtual machine.'
+ - When clients pass a value of this structure as a parameter, the field must
+ be the id of a resource returned by M(vmware.vmware_rest.vcenter_storage_policies).
+ (['present'])
- ' This key is required with [''present''].'
type: dict
vcenter_hostname:
@@ -749,18 +982,19 @@ options:
type: bool
vm:
description:
- - Identifier of the virtual machine to be unregistered. Required with I(state=['absent',
- 'relocate', 'unregister'])
+ - Identifier of the virtual machine to be unregistered.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_info).
+ Required with I(state=['absent', 'relocate', 'unregister'])
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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -1016,6 +1250,24 @@ value:
# This structure describes the format of the data expected by the end-points
PAYLOAD_FORMAT = {
+ "clone": {
+ "query": {},
+ "body": {
+ "disks_to_remove": "disks_to_remove",
+ "disks_to_update": "disks_to_update",
+ "guest_customization_spec": "guest_customization_spec",
+ "name": "name",
+ "placement": "placement",
+ "power_on": "power_on",
+ "source": "source",
+ },
+ "path": {},
+ },
+ "relocate": {
+ "query": {},
+ "body": {"disks": "disks", "placement": "placement"},
+ "path": {"vm": "vm"},
+ },
"register": {
"query": {},
"body": {
@@ -1027,6 +1279,7 @@ PAYLOAD_FORMAT = {
},
"path": {},
},
+ "unregister": {"query": {}, "body": {}, "path": {"vm": "vm"}},
"create": {
"query": {},
"body": {
@@ -1041,6 +1294,7 @@ PAYLOAD_FORMAT = {
"memory": "memory",
"name": "name",
"nics": "nics",
+ "nvme_adapters": "nvme_adapters",
"parallel_ports": "parallel_ports",
"placement": "placement",
"sata_adapters": "sata_adapters",
@@ -1050,25 +1304,7 @@ PAYLOAD_FORMAT = {
},
"path": {},
},
- "relocate": {
- "query": {},
- "body": {"disks": "disks", "placement": "placement"},
- "path": {"vm": "vm"},
- },
"delete": {"query": {}, "body": {}, "path": {"vm": "vm"}},
- "clone": {
- "query": {},
- "body": {
- "disks_to_remove": "disks_to_remove",
- "disks_to_update": "disks_to_update",
- "guest_customization_spec": "guest_customization_spec",
- "name": "name",
- "placement": "placement",
- "power_on": "power_on",
- "source": "source",
- },
- "path": {},
- },
"instant_clone": {
"query": {},
"body": {
@@ -1083,11 +1319,8 @@ PAYLOAD_FORMAT = {
},
"path": {},
},
- "unregister": {"query": {}, "body": {}, "path": {"vm": "vm"}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -1102,26 +1335,28 @@ 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",
@@ -1371,6 +1606,7 @@ def prepare_argument_spec():
argument_spec["name"] = {"type": "str"}
argument_spec["nics"] = {"type": "list", "elements": "dict"}
argument_spec["nics_to_update"] = {"type": "dict"}
+ argument_spec["nvme_adapters"] = {"type": "list", "elements": "dict"}
argument_spec["parallel_ports"] = {"type": "list", "elements": "dict"}
argument_spec["parallel_ports_to_update"] = {"type": "dict"}
argument_spec["path"] = {"type": "str"}
@@ -1433,7 +1669,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
@@ -1450,20 +1685,16 @@ async def entry_point(module, session):
async def _clone(params, session):
-
lookup_url = per_id_url = build_url(params)
uniquity_keys = ["vm"]
comp_func = None
async def lookup_with_filters(params, session, url):
- # e.g: for the datacenter resources
- if "folder" not in params:
- return
+ search_filter = ""
+
if "name" not in params:
return
- async with session.get(
- f"{url}?names={params['name']}&folders={params['folder']}"
- ) as resp:
+ async with session.get(f"{url}?names={params['name']}{search_filter}") as resp:
_json = await resp.json()
if isinstance(_json, list) and len(_json) == 1:
return await get_device_info(session, url, _json[0]["vm"])
@@ -1526,20 +1757,16 @@ async def _clone(params, session):
async def _create(params, session):
-
lookup_url = per_id_url = build_url(params)
uniquity_keys = ["vm"]
comp_func = None
async def lookup_with_filters(params, session, url):
- # e.g: for the datacenter resources
- if "folder" not in params:
- return
+ search_filter = ""
+
if "name" not in params:
return
- async with session.get(
- f"{url}?names={params['name']}&folders={params['folder']}"
- ) as resp:
+ async with session.get(f"{url}?names={params['name']}{search_filter}") as resp:
_json = await resp.json()
if isinstance(_json, list) and len(_json) == 1:
return await get_device_info(session, url, _json[0]["vm"])
@@ -1620,20 +1847,16 @@ async def _delete(params, session):
async def _instant_clone(params, session):
-
lookup_url = per_id_url = build_url(params)
uniquity_keys = ["vm"]
comp_func = None
async def lookup_with_filters(params, session, url):
- # e.g: for the datacenter resources
- if "folder" not in params:
- return
+ search_filter = ""
+
if "name" not in params:
return
- async with session.get(
- f"{url}?names={params['name']}&folders={params['folder']}"
- ) as resp:
+ async with session.get(f"{url}?names={params['name']}{search_filter}") as resp:
_json = await resp.json()
if isinstance(_json, list) and len(_json) == 1:
return await get_device_info(session, url, _json[0]["vm"])
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_customization.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_customization.py
index bfc5b5001..66a139f2f 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_customization.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_customization.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"""
@@ -25,50 +22,86 @@ options:
is mandatory.
- 'Valid attributes are:'
- ' - C(windows_config) (dict): Guest customization specification for a Windows
- guest operating system ([''set''])'
+ guest operating system'
+ - If unset, ConfigurationSpec.linux-config or ConfigurationSpec.cloud-config
+ must be set. Otherwise, an appropriate fault will be thrown. (['set'])
- ' - Accepted keys:'
- - ' - reboot (string): The C(reboot_option) specifies what should be done
- to the guest after the customization.'
+ - ' - reboot (string): This option specifies what should be done to the
+ guest after the customization.'
- 'Accepted value for this field:'
- ' - C(NO_REBOOT)'
- ' - C(REBOOT)'
- ' - C(SHUTDOWN)'
- ' - sysprep (object): Customization settings like user details, administrator
- details, etc for the windows guest operating system. Exactly one of C(#sysprep)
- or C(#sysprep_xml) must be specified.'
+ details, etc for the windows guest operating system. Exactly one of WindowsConfiguration.sysprep
+ or WindowsConfiguration.sysprep-xml must be specified.'
+ - If unset, sysprep settings will not be applied to the windows guest operating
+ system.
- ' - sysprep_xml (string): All settings specified in a XML format. This
is the content of a typical answer.xml file that is used by System administrators
during the Windows image customization. Check https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/update-windows-settings-and-scripts-create-your-own-answer-file-sxs
- Exactly one of C(#sysprep) or C(#sysprep_xml) must be specified.'
+ Exactly one of WindowsConfiguration.sysprep or WindowsConfiguration.sysprep-xml
+ must be specified.'
+ - If unset, sysprep settings will not be applied to the windows guest operating
+ system.
- ' - C(linux_config) (dict): Guest customization specification for a linux
- guest operating system ([''set''])'
+ guest operating system'
+ - If unset, ConfigurationSpec.windows-config or ConfigurationSpec.cloud-config
+ must be set. Otherwise, an appropriate fault will be thrown. (['set'])
- ' - Accepted keys:'
- ' - hostname (object): The computer name of the (Windows) virtual machine.
A computer name may contain letters (A-Z), numbers(0-9) and hyphens (-)
but no spaces or periods (.). The name may not consist entirely of digits.
A computer name is restricted to 15 characters in length. If the computer
name is longer than 15 characters, it will be truncated to 15 characters.
- Check {@link HostnameGenerator} for various options.'
+ Check HostnameGenerator for various options.'
- ' - domain (string): The fully qualified domain name.'
- ' - time_zone (string): The case-sensitive time zone, such as Europe/Sofia.
Valid time zone values are based on the tz (time zone) database used by
- Linux. The values are strings in the form "Area/Location," in which Area
- is a continent or ocean name, and Location is the city, island, or other
- regional designation. See the https://kb.vmware.com/kb/2145518 for a list
- of supported time zones for different versions in Linux.'
+ Linux. The values are strings (string) in the form "Area/Location," in
+ which Area is a continent or ocean name, and Location is the city, island,
+ or other regional designation. '
+ - ' See the https://kb.vmware.com/kb/2145518 for a list of supported time
+ zones for different versions in Linux.'
+ - ''
+ - If unset, time zone is not modified inside guest operating system.
- ' - script_text (string): The script to run before and after Linux guest
- customization.<br> The max size of the script is 1500 bytes. As long as
- the script (shell, perl, python...) has the right "#!" in the header,
- it is supported. The caller should not assume any environment variables
- when the script is run. The script is invoked by the customization engine
- using the command line: 1) with argument "precustomization" before customization,
- 2) with argument "postcustomization" after customization. The script should
- parse this argument and implement pre-customization or post-customization
- task code details in the corresponding block. A Linux shell script example:
- <code> #!/bin/sh<br> if [ x$1 == x"precustomization" ]; then<br> echo
- "Do Precustomization tasks"<br> #code for pre-customization actions...<br>
- elif [ x$1 == x"postcustomization" ]; then<br> echo "Do Postcustomization
- tasks"<br> #code for post-customization actions...<br> fi<br> </code>'
+ customization.'
+ - ' The max size of the script is 1500 bytes. As long as the script (shell,
+ perl, python...) has the right "#!" in the header, it is supported. The
+ caller should not assume any environment variables when the script is
+ run. '
+ - ' The script is invoked by the customization engine using the command line:
+ 1) with argument "precustomization" before customization, 2) with argument
+ "postcustomization" after customization. The script should parse this
+ argument and implement pre-customization or post-customization task code
+ details in the corresponding block. '
+ - ''
+ - ' A Linux shell script example: '
+ - ''
+ - ' #!/bin/sh'
+ - ' if [ x$1 == x"precustomization" ]; then'
+ - ' echo "Do Precustomization tasks"'
+ - ' #code for pre-customization actions...'
+ - ' elif [ x$1 == x"postcustomization" ]; then'
+ - ' echo "Do Postcustomization tasks"'
+ - ' #code for post-customization actions...'
+ - ' fi'
+ - ' '
+ - ''
+ - If unset, no script will be executed.
+ - ' - C(cloud_config) (dict): Guest customization specification with cloud
+ configuration.'
+ - If unset, ConfigurationSpec.windows-config or ConfigurationSpec.linux-config
+ must be set. Otherwise, an appropriate fault will be thrown. (['set'])
+ - ' - Accepted keys:'
+ - ' - type (string): This option specifies different types of the cloud
+ configuration.'
+ - 'Accepted value for this field:'
+ - ' - C(CLOUDINIT)'
+ - ' - cloudinit (object): cloud-init configuration'
+ - This field is optional and it is only relevant when the value of CloudConfiguration.type
+ is CLOUDINIT.
required: true
type: dict
global_DNS_settings:
@@ -79,36 +112,43 @@ options:
- ' - C(dns_suffix_list) (list): List of name resolution suffixes for the
virtual network adapter. This list applies to both Windows and Linux guest
customization. For Linux, this setting is global, whereas in Windows,
- this setting is listed on a per-adapter basis. ([''set''])'
+ this setting is listed on a per-adapter basis.'
+ - If unset, no DNS suffixes are set. (['set'])
- ' - C(dns_servers) (list): List of DNS servers, for a virtual network adapter
with a static IP address. If this list is empty, then the guest operating
system is expected to use a DHCP server to get its DNS server settings.
These settings configure the virtual machine to use the specified DNS
- servers. These DNS server settings are listed in the order of preference.
- ([''set''])'
+ servers. These DNS server settings are listed in the order of preference.'
+ - If unset, no DNS servers are set. (['set'])
required: true
type: dict
interfaces:
description:
- IP settings that are specific to a particular virtual network adapter. The
- {@link AdapterMapping} {@term structure} maps a network adapter's MAC
- address to its {@link IPSettings}. May be empty if there are no network
- adapters, else should match number of network adapters configured for
- the VM. This parameter is mandatory.
+ AdapterMapping structure maps a network adapter's MAC address to its IPSettings.
+ May be empty if there are no network adapters, else should match number
+ of network adapters configured for the VM. This parameter is mandatory.
- 'Valid attributes are:'
- - ' - C(mac_address) (str): The MAC address of a network adapter being customized.
- ([''set''])'
+ - ' - C(mac_address) (str): The MAC address of a network adapter being customized.'
+ - If unset, the customization process maps the the settings from the list
+ of I(i_p_settings) in the CustomizationSpec.interfaces to the virtual
+ machine's network adapters, in PCI slot order. The first virtual network
+ adapter on the PCI bus is assigned interfaces[0].IPSettings, the second
+ adapter is assigned interfaces[1].IPSettings, and so on. (['set'])
- ' - C(adapter) (dict): The IP settings for the associated virtual network
adapter. ([''set''])'
- ' This key is required with [''set''].'
- ' - Accepted keys:'
- ' - ipv4 (object): Specification to configure IPv4 address, subnet mask
and gateway info for this virtual network adapter.'
+ - If unset, no IPv4 addresses are set.
- ' - ipv6 (object): Specification to configure IPv6 address, subnet mask
and gateway info for this virtual network adapter.'
+ - If unset, no IPv6 addresses are set.
- ' - windows (object): Windows settings to be configured for this specific
virtual Network adapter. This is valid only for Windows guest operating
systems.'
+ - If unset, no specific Windows settings are set.
elements: dict
required: true
type: list
@@ -120,6 +160,12 @@ options:
- The default value is 300s.
type: float
version_added: 2.1.0
+ state:
+ choices:
+ - set
+ default: set
+ description: []
+ type: str
vcenter_hostname:
description:
- The hostname or IP address of the vSphere vCenter
@@ -160,6 +206,7 @@ options:
vm:
description:
- The unique identifier of the virtual machine that needs to be customized.
+ - 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
@@ -167,11 +214,11 @@ 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -220,8 +267,6 @@ PAYLOAD_FORMAT = {
}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -236,26 +281,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",
@@ -284,6 +330,7 @@ def prepare_argument_spec():
argument_spec["configuration_spec"] = {"required": True, "type": "dict"}
argument_spec["global_DNS_settings"] = {"required": True, "type": "dict"}
argument_spec["interfaces"] = {"required": True, "type": "list", "elements": "dict"}
+ argument_spec["state"] = {"type": "str", "choices": ["set"], "default": "set"}
argument_spec["vm"] = {"required": True, "type": "str"}
return argument_spec
@@ -324,8 +371,17 @@ def build_url(params):
async def entry_point(module, session):
+ if module.params["state"] == "present":
+ if "_create" in globals():
+ operation = "create"
+ else:
+ operation = "update"
+ elif module.params["state"] == "absent":
+ operation = "delete"
+ else:
+ operation = module.params["state"]
- func = globals()["_set"]
+ func = globals()["_" + operation]
return await func(module.params, session)
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_filesystem_directories.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_filesystem_directories.py
index 4fe1bd528..9fb6ee330 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_filesystem_directories.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_filesystem_directories.py
@@ -3,32 +3,30 @@
# 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"""
module: vcenter_vm_guest_filesystem_directories
short_description: Creates a directory in the guest operating system
-description: Creates a directory in the guest operating system. <p>
+description: 'Creates a directory in the guest operating system. '
options:
create_parents:
description:
- - Whether any parent directories should be created. If any failure occurs,
+ - Whether any parent directories should be created. If any failure occurs,
some parent directories could be left behind.
+ - If unset parent directories are not created.
type: bool
credentials:
description:
- The guest authentication data. This parameter is mandatory.
- 'Valid attributes are:'
- - ' - C(interactive_session) (bool): If {@term set}, theoperation will interact
- with the logged-in desktop session in the guest. This requires that the
- logged-on user matches the user specified by the {@link Credentials}.
- This is currently only supported for {@link Type#USERNAME_PASSWORD}. ([''absent'',
- ''create_temporary'', ''move'', ''present''])'
+ - ' - C(interactive_session) (bool): If set, the operation will interact with
+ the logged-in desktop session in the guest. This requires that the logged-on
+ user matches the user specified by the Credentials. This is currently
+ only supported for USERNAME_PASSWORD. ([''absent'', ''create_temporary'',
+ ''move'', ''present''])'
- ' This key is required with [''absent'', ''create_temporary'', ''move'',
''present''].'
- ' - C(type) (str): Types of guest credentials ([''absent'', ''create_temporary'',
@@ -38,14 +36,18 @@ options:
- ' - Accepted values:'
- ' - SAML_BEARER_TOKEN'
- ' - USERNAME_PASSWORD'
- - ' - C(user_name) (str): For {@link Type#SAML_BEARER_TOKEN}, this is the
- guest user to be associated with the credentials. For {@link Type#USERNAME_PASSWORD}
- this is the guest username. ([''absent'', ''create_temporary'', ''move'',
- ''present''])'
- - ' - C(password) (str): password ([''absent'', ''create_temporary'', ''move'',
- ''present''])'
- - ' - C(saml_token) (str): SAML Bearer Token ([''absent'', ''create_temporary'',
- ''move'', ''present''])'
+ - ' - C(user_name) (str): For SAML_BEARER_TOKEN, this is the guest user to
+ be associated with the credentials. For USERNAME_PASSWORD this is the
+ guest username.'
+ - If no user is specified for SAML_BEARER_TOKEN, a guest dependent mapping
+ will decide what guest user account is applied. (['absent', 'create_temporary',
+ 'move', 'present'])
+ - ' - C(password) (str): password'
+ - This field is optional and it is only relevant when the value of Credentials.type
+ is USERNAME_PASSWORD. (['absent', 'create_temporary', 'move', 'present'])
+ - ' - C(saml_token) (str): SAML Bearer Token'
+ - This field is optional and it is only relevant when the value of Credentials.type
+ is SAML_BEARER_TOKEN. (['absent', 'create_temporary', 'move', 'present'])
required: true
type: dict
new_path:
@@ -57,6 +59,7 @@ options:
parent_path:
description:
- The complete path to the directory in which to create the new directory.
+ - Directory If unset a guest-specific default will be used.
type: str
path:
description:
@@ -71,6 +74,7 @@ options:
description:
- If true, all files and subdirectories are also deleted. If false, the directory
must be empty for the operation to succeed.
+ - If unset, any directory content is not deleted.
type: bool
session_timeout:
description:
@@ -132,18 +136,20 @@ options:
type: bool
vm:
description:
- - Virtual Machine to perform the operation on. This parameter is mandatory.
+ - Virtual Machine to perform the operation on.
+ - 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: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -202,38 +208,36 @@ PAYLOAD_FORMAT = {
"body": {"credentials": "credentials", "new_path": "new_path", "path": "path"},
"path": {"vm": "vm"},
},
- "create": {
+ "create_temporary": {
"query": {},
"body": {
- "create_parents": "create_parents",
"credentials": "credentials",
- "path": "path",
+ "parent_path": "parent_path",
+ "prefix": "prefix",
+ "suffix": "suffix",
},
"path": {"vm": "vm"},
},
- "delete": {
+ "create": {
"query": {},
"body": {
+ "create_parents": "create_parents",
"credentials": "credentials",
"path": "path",
- "recursive": "recursive",
},
"path": {"vm": "vm"},
},
- "create_temporary": {
+ "delete": {
"query": {},
"body": {
"credentials": "credentials",
- "parent_path": "parent_path",
- "prefix": "prefix",
- "suffix": "suffix",
+ "path": "path",
+ "recursive": "recursive",
},
"path": {"vm": "vm"},
},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -248,26 +252,28 @@ 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",
@@ -347,7 +353,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
@@ -364,7 +369,6 @@ async def entry_point(module, session):
async def _create(params, session):
-
uniquity_keys = []
payload = prepare_payload(params, PAYLOAD_FORMAT["create"])
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_identity_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_identity_info.py
index 59395db35..2fd8b2141 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_identity_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_identity_info.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"""
@@ -62,17 +59,19 @@ options:
type: bool
vm:
description:
- - Identifier of the virtual machine. Required with I(state=['get'])
+ - Identifier of the virtual machine.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_info).
+ Required with I(state=['get'])
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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -114,8 +113,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {"vm": "vm"}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -130,26 +127,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_localfilesystem_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_localfilesystem_info.py
index a4159aecc..a95254c33 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_localfilesystem_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_localfilesystem_info.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"""
@@ -63,17 +60,19 @@ options:
type: bool
vm:
description:
- - Identifier of the virtual machine. Required with I(state=['get'])
+ - Identifier of the virtual machine.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_info).
+ Required with I(state=['get'])
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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -116,8 +115,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {"vm": "vm"}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -132,26 +129,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_networking_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_networking_info.py
index 466bc8db1..320629306 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_networking_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_networking_info.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"""
@@ -64,17 +61,19 @@ options:
type: bool
vm:
description:
- - Virtual machine ID Required with I(state=['get'])
+ - Virtual machine ID
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_info).
+ Required with I(state=['get'])
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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -117,8 +116,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {"vm": "vm"}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -133,26 +130,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_networking_interfaces_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_networking_interfaces_info.py
index 838fea679..7f7c56eb7 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_networking_interfaces_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_networking_interfaces_info.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"""
@@ -64,17 +61,19 @@ options:
type: bool
vm:
description:
- - Virtual machine ID Required with I(state=['list'])
+ - Virtual machine ID
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_info).
+ Required with I(state=['list'])
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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -113,8 +112,6 @@ PAYLOAD_FORMAT = {
"list": {"query": {}, "body": {}, "path": {"vm": "vm"}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -129,26 +126,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_networking_routes_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_networking_routes_info.py
index ab7ad241f..2133a89b4 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_networking_routes_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_networking_routes_info.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"""
@@ -63,17 +60,19 @@ options:
type: bool
vm:
description:
- - Virtual machine ID Required with I(state=['list'])
+ - Virtual machine ID
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_info).
+ Required with I(state=['list'])
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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -108,8 +107,6 @@ PAYLOAD_FORMAT = {
"list": {"query": {}, "body": {}, "path": {"vm": "vm"}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -124,26 +121,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_operations_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_operations_info.py
index 78799f24f..75651456b 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_operations_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_operations_info.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"""
@@ -62,17 +59,19 @@ options:
type: bool
vm:
description:
- - Identifier of the virtual machine. Required with I(state=['get'])
+ - Identifier of the virtual machine.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_info).
+ Required with I(state=['get'])
type: str
author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.0.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -86,8 +85,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {"vm": "vm"}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -102,26 +99,24 @@ 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",
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"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_power_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_power_info.py
index bcb7fef6f..e6e1a8352 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_power_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_guest_power_info.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"""
@@ -62,17 +59,19 @@ options:
type: bool
vm:
description:
- - Identifier of the virtual machine. Required with I(state=['get'])
+ - Identifier of the virtual machine.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_info).
+ Required with I(state=['get'])
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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -130,8 +129,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {"vm": "vm"}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -146,26 +143,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware.py
index 3e8f8ad87..81ace5eba 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware.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"""
@@ -36,8 +33,8 @@ options:
- ALWAYS
- NEVER
description:
- - The C(upgrade_policy) defines the valid virtual hardware upgrade policies
- for a virtual machine.
+ - The I(upgrade_policy) enumerated type defines the valid virtual hardware
+ upgrade policies for a virtual machine.
type: str
upgrade_version:
choices:
@@ -58,9 +55,9 @@ options:
- VMX_18
- VMX_19
description:
- - The C(version) defines the valid virtual hardware versions for a virtual
- machine. See https://kb.vmware.com/s/article/1003746 (Virtual machine
- hardware versions (1003746)).
+ - The I(version) enumerated type defines the valid virtual hardware versions
+ for a virtual machine. See https://kb.vmware.com/s/article/1003746 (Virtual
+ machine hardware versions (1003746)).
type: str
vcenter_hostname:
description:
@@ -118,24 +115,26 @@ options:
- VMX_18
- VMX_19
description:
- - The C(version) defines the valid virtual hardware versions for a virtual
- machine. See https://kb.vmware.com/s/article/1003746 (Virtual machine
- hardware versions (1003746)).
+ - The I(version) enumerated type defines the valid virtual hardware versions
+ for a virtual machine. See https://kb.vmware.com/s/article/1003746 (Virtual
+ machine hardware versions (1003746)).
type: str
vm:
description:
- - Virtual machine identifier. This parameter is mandatory.
+ - Virtual machine identifier.
+ - 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -174,8 +173,6 @@ PAYLOAD_FORMAT = {
"upgrade": {"query": {}, "body": {"version": "version"}, "path": {"vm": "vm"}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -190,26 +187,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",
@@ -326,7 +324,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_adapter_sata.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_adapter_sata.py
index 080c7a54e..854ab20b5 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_adapter_sata.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_adapter_sata.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"""
@@ -17,12 +14,17 @@ description: Adds a virtual SATA adapter to the virtual machine.
options:
adapter:
description:
- - Virtual SATA adapter identifier. Required with I(state=['absent'])
+ - Virtual SATA adapter identifier.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_hardware_adapter_sata).
+ Required with I(state=['absent'])
type: str
bus:
description:
- SATA bus number.
+ - If unset, the server will choose an available bus number; if none is available,
+ the request will fail.
type: int
+ default: 0
label:
description:
- The name of the item
@@ -30,6 +32,8 @@ options:
pci_slot_number:
description:
- Address of the SATA adapter on the PCI bus.
+ - If unset, the server will choose an available address when the virtual machine
+ is powered on.
type: int
session_timeout:
description:
@@ -50,7 +54,8 @@ options:
choices:
- AHCI
description:
- - The C(type) defines the valid emulation types for a virtual SATA adapter.
+ - The I(type) enumerated type defines the valid emulation types for a virtual
+ SATA adapter.
type: str
vcenter_hostname:
description:
@@ -91,18 +96,20 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. This parameter is mandatory.
+ - Virtual machine identifier.
+ - 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -158,8 +165,6 @@ PAYLOAD_FORMAT = {
"delete": {"query": {}, "body": {}, "path": {"adapter": "adapter", "vm": "vm"}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -174,26 +179,28 @@ 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",
@@ -269,7 +276,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
@@ -286,20 +292,16 @@ async def entry_point(module, session):
async def _create(params, session):
-
lookup_url = per_id_url = build_url(params)
uniquity_keys = ["adapter"]
comp_func = None
async def lookup_with_filters(params, session, url):
- # e.g: for the datacenter resources
- if "folder" not in params:
- return
+ search_filter = ""
+
if "name" not in params:
return
- async with session.get(
- f"{url}?names={params['name']}&folders={params['folder']}"
- ) as resp:
+ async with session.get(f"{url}?names={params['name']}{search_filter}") as resp:
_json = await resp.json()
if isinstance(_json, list) and len(_json) == 1:
return await get_device_info(session, url, _json[0]["adapter"])
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_adapter_sata_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_adapter_sata_info.py
index d2912eaab..5836cfa0f 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_adapter_sata_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_adapter_sata_info.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"""
@@ -17,7 +14,9 @@ description: Returns information about a virtual SATA adapter.
options:
adapter:
description:
- - Virtual SATA adapter identifier. Required with I(state=['get'])
+ - Virtual SATA adapter identifier.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_hardware_adapter_sata).
+ Required with I(state=['get'])
type: str
label:
description:
@@ -70,18 +69,20 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. This parameter is mandatory.
+ - Virtual machine identifier.
+ - 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -130,8 +131,6 @@ PAYLOAD_FORMAT = {
"list": {"query": {}, "body": {}, "path": {"vm": "vm"}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -149,23 +148,23 @@ from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest imp
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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_adapter_scsi.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_adapter_scsi.py
index 3509c904d..25521695c 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_adapter_scsi.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_adapter_scsi.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"""
@@ -17,21 +14,28 @@ description: Adds a virtual SCSI adapter to the virtual machine.
options:
adapter:
description:
- - Virtual SCSI adapter identifier. Required with I(state=['absent', 'present'])
+ - Virtual SCSI adapter identifier.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_hardware_adapter_scsi).
+ Required with I(state=['absent', 'present'])
type: str
bus:
description:
- SCSI bus number.
+ - If unset, the server will choose an available bus number; if none is available,
+ the request will fail.
type: int
+ default: 0
label:
description:
- The name of the item
type: str
pci_slot_number:
description:
- - Address of the SCSI adapter on the PCI bus. If the PCI address is invalid,
+ - Address of the SCSI adapter on the PCI bus. If the PCI address is invalid,
the server will change it when the VM is started or as the device is hot
added.
+ - If unset, the server will choose an available address when the virtual machine
+ is powered on.
type: int
session_timeout:
description:
@@ -47,7 +51,8 @@ options:
- PHYSICAL
- VIRTUAL
description:
- - The C(sharing) defines the valid bus sharing modes for a virtual SCSI adapter.
+ - The I(sharing) enumerated type defines the valid bus sharing modes for a
+ virtual SCSI adapter.
type: str
state:
choices:
@@ -63,7 +68,8 @@ options:
- LSILOGICSAS
- PVSCSI
description:
- - The C(type) defines the valid emulation types for a virtual SCSI adapter.
+ - The I(type) enumerated type defines the valid emulation types for a virtual
+ SCSI adapter.
type: str
vcenter_hostname:
description:
@@ -104,18 +110,20 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. This parameter is mandatory.
+ - Virtual machine identifier.
+ - 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -167,7 +175,6 @@ value:
# This structure describes the format of the data expected by the end-points
PAYLOAD_FORMAT = {
- "delete": {"query": {}, "body": {}, "path": {"adapter": "adapter", "vm": "vm"}},
"update": {
"query": {},
"body": {"sharing": "sharing"},
@@ -183,10 +190,9 @@ PAYLOAD_FORMAT = {
},
"path": {"vm": "vm"},
},
+ "delete": {"query": {}, "body": {}, "path": {"adapter": "adapter", "vm": "vm"}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -201,26 +207,28 @@ 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",
@@ -303,7 +311,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
@@ -320,20 +327,16 @@ async def entry_point(module, session):
async def _create(params, session):
-
lookup_url = per_id_url = build_url(params)
uniquity_keys = ["adapter"]
comp_func = None
async def lookup_with_filters(params, session, url):
- # e.g: for the datacenter resources
- if "folder" not in params:
- return
+ search_filter = ""
+
if "name" not in params:
return
- async with session.get(
- f"{url}?names={params['name']}&folders={params['folder']}"
- ) as resp:
+ async with session.get(f"{url}?names={params['name']}{search_filter}") as resp:
_json = await resp.json()
if isinstance(_json, list) and len(_json) == 1:
return await get_device_info(session, url, _json[0]["adapter"])
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_adapter_scsi_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_adapter_scsi_info.py
index c64df425a..ddb324276 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_adapter_scsi_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_adapter_scsi_info.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"""
@@ -17,7 +14,9 @@ description: Returns information about a virtual SCSI adapter.
options:
adapter:
description:
- - Virtual SCSI adapter identifier. Required with I(state=['get'])
+ - Virtual SCSI adapter identifier.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_hardware_adapter_scsi).
+ Required with I(state=['get'])
type: str
label:
description:
@@ -70,18 +69,20 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. This parameter is mandatory.
+ - Virtual machine identifier.
+ - 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -118,8 +119,6 @@ PAYLOAD_FORMAT = {
"list": {"query": {}, "body": {}, "path": {"vm": "vm"}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -137,23 +136,23 @@ from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest imp
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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_boot.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_boot.py
index 76f92ab3f..afc4d62e1 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_boot.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_boot.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"""
@@ -18,39 +15,43 @@ options:
delay:
description:
- Delay in milliseconds before beginning the firmware boot process when the
- virtual machine is powered on. This delay may be used to provide a time
+ virtual machine is powered on. This delay may be used to provide a time
window for users to connect to the virtual machine console and enter BIOS
setup mode.
+ - If unset, the value is unchanged.
type: int
efi_legacy_boot:
description:
- Flag indicating whether to use EFI legacy boot mode.
+ - If unset, the value is unchanged.
type: bool
enter_setup_mode:
description:
- Flag indicating whether the firmware boot process should automatically enter
- setup mode the next time the virtual machine boots. Note that this flag
+ setup mode the next time the virtual machine boots. Note that this flag
will automatically be reset to false once the virtual machine enters setup
mode.
+ - If unset, the value is unchanged.
type: bool
network_protocol:
choices:
- IPV4
- IPV6
description:
- - The C(network_protocol) defines the valid network boot protocols supported
- when booting a virtual machine with {@link Type#EFI} firmware over the
- network.
+ - The I(network_protocol) enumerated type defines the valid network boot protocols
+ supported when booting a virtual machine with EFI firmware over the network.
type: str
retry:
description:
- Flag indicating whether the virtual machine should automatically retry the
boot process after a failure.
+ - If unset, the value is unchanged.
type: bool
retry_delay:
description:
- Delay in milliseconds before retrying the boot process after a failure;
- applicable only when {@link Info#retry} is true.
+ applicable only when I(retry) is true.
+ - If unset, the value is unchanged.
type: int
session_timeout:
description:
@@ -71,7 +72,8 @@ options:
- BIOS
- EFI
description:
- - The C(type) defines the valid firmware types for a virtual machine.
+ - The I(type) enumerated type defines the valid firmware types for a virtual
+ machine.
type: str
vcenter_hostname:
description:
@@ -112,18 +114,20 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. This parameter is mandatory.
+ - Virtual machine identifier.
+ - 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -177,8 +181,6 @@ PAYLOAD_FORMAT = {
}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -193,26 +195,24 @@ 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",
@@ -290,7 +290,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_boot_device.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_boot_device.py
index b555747b8..fd2ea75b6 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_boot_device.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_boot_device.py
@@ -3,29 +3,25 @@
# 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"""
module: vcenter_vm_hardware_boot_device
short_description: Sets the virtual devices that will be used to boot the virtual
machine
-description: Sets the virtual devices that will be used to boot the virtual machine. The
- virtual machine will check the devices in order, attempting to boot from each,
- until the virtual machine boots successfully. If the {@term list} is empty, the
- virtual machine will use a default boot sequence. There should be no more than
- one instance of {@link Entry} for a given device type except {@link Device.Type#ETHERNET}
- in the {@term list}.
+description: Sets the virtual devices that will be used to boot the virtual machine.
+ The virtual machine will check the devices in order, attempting to boot from each,
+ until the virtual machine boots successfully. If the list is empty, the virtual
+ machine will use a default boot sequence. There should be no more than one instance
+ of Device.Entry for a given device type except ETHERNET in the list.
options:
devices:
description:
- Ordered list of boot devices. This parameter is mandatory.
- 'Valid attributes are:'
- - ' - C(type) (str): The C(type) defines the valid device types that may be
+ - ' - C(type) (str): This option defines the valid device types that may be
used as bootable devices. ([''set''])'
- ' This key is required with [''set''].'
- ' - Accepted values:'
@@ -34,9 +30,19 @@ options:
- ' - ETHERNET'
- ' - FLOPPY'
- ' - C(nic) (str): Virtual Ethernet device. Ethernet device to use as boot
- device for this entry. ([''set''])'
+ device for this entry.'
+ - This field is optional and it is only relevant when the value of I(type)
+ is ETHERNET.
+ - When clients pass a value of this structure as a parameter, the field must
+ be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_hardware_ethernet).
+ (['set'])
- ' - C(disks) (list): Virtual disk device. List of virtual disks in boot
- order. ([''set''])'
+ order.'
+ - This field is optional and it is only relevant when the value of I(type)
+ is DISK.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_vm_hardware_disk).
+ (['set'])
elements: dict
required: true
type: list
@@ -93,18 +99,20 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. This parameter is mandatory.
+ - Virtual machine identifier.
+ - 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -141,8 +149,6 @@ PAYLOAD_FORMAT = {
"set": {"query": {}, "body": {"devices": "devices"}, "path": {"vm": "vm"}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -157,26 +163,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",
@@ -244,7 +251,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_boot_device_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_boot_device_info.py
index e4d037bab..d01e67850 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_boot_device_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_boot_device_info.py
@@ -3,18 +3,15 @@
# 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"""
module: vcenter_vm_hardware_boot_device_info
short_description: Returns an ordered list of boot devices for the virtual machine
description: Returns an ordered list of boot devices for the virtual machine. If the
- {@term list} is empty, the virtual machine uses a default boot sequence.
+ list is empty, the virtual machine uses a default boot sequence.
options:
session_timeout:
description:
@@ -63,17 +60,19 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. Required with I(state=['get'])
+ - Virtual machine identifier.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_info).
+ Required with I(state=['get'])
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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -114,8 +113,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {"vm": "vm"}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -130,26 +127,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_boot_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_boot_info.py
index 66fcac5f7..d719b8a7b 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_boot_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_boot_info.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"""
@@ -62,17 +59,19 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. Required with I(state=['get'])
+ - Virtual machine identifier.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_info).
+ Required with I(state=['get'])
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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -111,8 +110,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {"vm": "vm"}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -127,26 +124,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_cdrom.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_cdrom.py
index 131a5b0d9..b3185f1c1 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_cdrom.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_cdrom.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"""
@@ -18,25 +15,31 @@ options:
allow_guest_control:
description:
- Flag indicating whether the guest can connect and disconnect the device.
+ - If unset, the value is unchanged.
type: bool
backing:
description:
- - Physical resource backing for the virtual CD-ROM device. Required with I(state=['present'])
+ - Physical resource backing for the virtual CD-ROM device.
+ - If unset, defaults to automatic detection of a suitable host device. Required
+ with I(state=['present'])
- 'Valid attributes are:'
- - ' - C(type) (str): The C(backing_type) defines the valid backing types for
- a virtual CD-ROM device. ([''present''])'
+ - ' - C(type) (str): This option defines the valid backing types for a virtual
+ CD-ROM device. ([''present''])'
- ' This key is required with [''present''].'
- ' - Accepted values:'
- ' - CLIENT_DEVICE'
- ' - HOST_DEVICE'
- ' - ISO_FILE'
- ' - C(iso_file) (str): Path of the image file that should be used as the
- virtual CD-ROM device backing. ([''present''])'
+ virtual CD-ROM device backing.'
+ - This field is optional and it is only relevant when the value of I(type)
+ is ISO_FILE. (['present'])
- ' - C(host_device) (str): Name of the device that should be used as the
- virtual CD-ROM device backing. ([''present''])'
- - ' - C(device_access_type) (str): The C(device_access_type) defines the valid
- device access types for a physical device packing of a virtual CD-ROM
- device. ([''present''])'
+ virtual CD-ROM device backing.'
+ - If unset, the virtual CD-ROM device will be configured to automatically
+ detect a suitable host device. (['present'])
+ - ' - C(device_access_type) (str): This option defines the valid device access
+ types for a physical device packing of a virtual CD-ROM device. ([''present''])'
- ' - Accepted values:'
- ' - EMULATION'
- ' - PASSTHRU'
@@ -44,17 +47,24 @@ options:
type: dict
cdrom:
description:
- - Virtual CD-ROM device identifier. Required with I(state=['absent', 'connect',
- 'disconnect', 'present'])
+ - Virtual CD-ROM device identifier.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_hardware_cdrom).
+ Required with I(state=['absent', 'connect', 'disconnect', 'present'])
type: str
ide:
description:
- Address for attaching the device to a virtual IDE adapter.
+ - If unset, the server will choose an available address; if none is available,
+ the request will fail.
- 'Valid attributes are:'
- ' - C(primary) (bool): Flag specifying whether the device should be attached
- to the primary or secondary IDE adapter of the virtual machine. ([''present''])'
+ to the primary or secondary IDE adapter of the virtual machine.'
+ - If unset, the server will choose a adapter with an available connection.
+ If no IDE connections are available, the request will be rejected. (['present'])
- ' - C(master) (bool): Flag specifying whether the device should be the master
- or slave device on the IDE adapter. ([''present''])'
+ or slave device on the IDE adapter.'
+ - If unset, the server will choose an available connection type. If no IDE
+ connections are available, the request will be rejected. (['present'])
type: dict
label:
description:
@@ -62,13 +72,17 @@ options:
type: str
sata:
description:
- - Address for attaching the device to a virtual SATA adapter. Required with
- I(state=['present'])
+ - Address for attaching the device to a virtual SATA adapter.
+ - If unset, the server will choose an available address; if none is available,
+ the request will fail. Required with I(state=['present'])
- 'Valid attributes are:'
- ' - C(bus) (int): Bus number of the adapter to which the device should be
attached. ([''present''])'
- ' This key is required with [''present''].'
- - ' - C(unit) (int): Unit number of the device. ([''present''])'
+ - ' - C(unit) (int): Unit number of the device.'
+ - If unset, the server will choose an available unit number on the specified
+ adapter. If there are no available connections on the adapter, the request
+ will be rejected. (['present'])
type: dict
session_timeout:
description:
@@ -82,6 +96,7 @@ options:
description:
- Flag indicating whether the virtual device should be connected whenever
the virtual machine is powered on.
+ - If unset, the value is unchanged.
type: bool
state:
choices:
@@ -97,8 +112,9 @@ options:
- IDE
- SATA
description:
- - The C(host_bus_adapter_type) defines the valid types of host bus adapters
- that may be used for attaching a Cdrom to a virtual machine.
+ - The I(host_bus_adapter_type) enumerated type defines the valid types of
+ host bus adapters that may be used for attaching a Cdrom to a virtual
+ machine.
type: str
vcenter_hostname:
description:
@@ -139,18 +155,20 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. This parameter is mandatory.
+ - Virtual machine identifier.
+ - 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -206,6 +224,8 @@ value:
# This structure describes the format of the data expected by the end-points
PAYLOAD_FORMAT = {
+ "connect": {"query": {}, "body": {}, "path": {"cdrom": "cdrom", "vm": "vm"}},
+ "disconnect": {"query": {}, "body": {}, "path": {"cdrom": "cdrom", "vm": "vm"}},
"update": {
"query": {},
"body": {
@@ -228,12 +248,8 @@ PAYLOAD_FORMAT = {
"path": {"vm": "vm"},
},
"delete": {"query": {}, "body": {}, "path": {"cdrom": "cdrom", "vm": "vm"}},
- "disconnect": {"query": {}, "body": {}, "path": {"cdrom": "cdrom", "vm": "vm"}},
- "connect": {"query": {}, "body": {}, "path": {"cdrom": "cdrom", "vm": "vm"}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -248,26 +264,28 @@ 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",
@@ -346,7 +364,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
@@ -390,20 +407,16 @@ async def _connect(params, session):
async def _create(params, session):
-
lookup_url = per_id_url = build_url(params)
uniquity_keys = ["cdrom"]
comp_func = None
async def lookup_with_filters(params, session, url):
- # e.g: for the datacenter resources
- if "folder" not in params:
- return
+ search_filter = ""
+
if "name" not in params:
return
- async with session.get(
- f"{url}?names={params['name']}&folders={params['folder']}"
- ) as resp:
+ async with session.get(f"{url}?names={params['name']}{search_filter}") as resp:
_json = await resp.json()
if isinstance(_json, list) and len(_json) == 1:
return await get_device_info(session, url, _json[0]["cdrom"])
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_cdrom_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_cdrom_info.py
index ea51baa3a..b76fd9afa 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_cdrom_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_cdrom_info.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"""
@@ -17,7 +14,9 @@ description: Returns information about a virtual CD-ROM device.
options:
cdrom:
description:
- - Virtual CD-ROM device identifier. Required with I(state=['get'])
+ - Virtual CD-ROM device identifier.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_hardware_cdrom).
+ Required with I(state=['get'])
type: str
label:
description:
@@ -70,18 +69,20 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. This parameter is mandatory.
+ - Virtual machine identifier.
+ - 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -117,8 +118,6 @@ PAYLOAD_FORMAT = {
"list": {"query": {}, "body": {}, "path": {"vm": "vm"}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -136,23 +135,23 @@ from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest imp
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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_cpu.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_cpu.py
index ff96dde18..3d3a56b4a 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_cpu.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_cpu.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"""
@@ -17,30 +14,38 @@ description: Updates the CPU-related settings of a virtual machine.
options:
cores_per_socket:
description:
- - New number of CPU cores per socket. The number of CPU cores in the virtual
+ - New number of CPU cores per socket. The number of CPU cores in the virtual
machine must be a multiple of the number of cores per socket.
+ - If unset, the value is unchanged.
type: int
count:
description:
- - New number of CPU cores. The number of CPU cores in the virtual machine
- must be a multiple of the number of cores per socket. The supported range
- of CPU counts is constrained by the configured guest operating system
- and virtual hardware version of the virtual machine. If the virtual machine
- is running, the number of CPU cores may only be increased if {@link Info#hotAddEnabled}
- is true, and may only be decreased if {@link Info#hotRemoveEnabled} is
- true.
+ - 'New number of CPU cores. The number of CPU cores in the virtual machine
+ must be a multiple of the number of cores per socket. '
+ - ' The supported range of CPU counts is constrained by the configured guest
+ operating system and virtual hardware version of the virtual machine. '
+ - ''
+ - ' If the virtual machine is running, the number of CPU cores may only be
+ increased if I(hot_add_enabled) is true, and may only be decreased if
+ I(hot_remove_enabled) is true.'
+ - ''
+ - If unset, the value is unchanged.
type: int
hot_add_enabled:
description:
- - Flag indicating whether adding CPUs while the virtual machine is running
- is enabled. This field may only be modified if the virtual machine is
- powered off.
+ - 'Flag indicating whether adding CPUs while the virtual machine is running
+ is enabled. '
+ - ' This field may only be modified if the virtual machine is powered off.'
+ - ''
+ - If unset, the value is unchanged.
type: bool
hot_remove_enabled:
description:
- - Flag indicating whether removing CPUs while the virtual machine is running
- is enabled. This field may only be modified if the virtual machine is
- powered off.
+ - 'Flag indicating whether removing CPUs while the virtual machine is running
+ is enabled. '
+ - ' This field may only be modified if the virtual machine is powered off.'
+ - ''
+ - If unset, the value is unchanged.
type: bool
session_timeout:
description:
@@ -95,18 +100,20 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. This parameter is mandatory.
+ - Virtual machine identifier.
+ - 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -160,8 +167,6 @@ PAYLOAD_FORMAT = {
}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -176,26 +181,24 @@ 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",
@@ -270,7 +273,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_cpu_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_cpu_info.py
index 7901d02ad..01786eecd 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_cpu_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_cpu_info.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"""
@@ -62,17 +59,19 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. Required with I(state=['get'])
+ - Virtual machine identifier.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_info).
+ Required with I(state=['get'])
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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -111,8 +110,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {"vm": "vm"}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -127,26 +124,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_disk.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_disk.py
index 2d27e32ac..d627a1550 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_disk.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_disk.py
@@ -3,45 +3,53 @@
# 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"""
module: vcenter_vm_hardware_disk
short_description: Adds a virtual disk to the virtual machine
-description: Adds a virtual disk to the virtual machine. While adding the virtual
+description: Adds a virtual disk to the virtual machine. While adding the virtual
disk, a new VMDK file may be created or an existing VMDK file may be used to back
the virtual disk.
options:
backing:
description:
- Existing physical resource backing for the virtual disk. Exactly one of
- C(#backing) or C(#new_vmdk) must be specified. Required with I(state=['present'])
+ I(backing) or I(new_vmdk) must be specified.
+ - If unset, the virtual disk will not be connected to an existing backing.
+ Required with I(state=['present'])
- 'Valid attributes are:'
- - ' - C(type) (str): The C(backing_type) defines the valid backing types for
- a virtual disk. ([''present''])'
+ - ' - C(type) (str): This option defines the valid backing types for a virtual
+ disk. ([''present''])'
- ' This key is required with [''present''].'
- ' - Accepted values:'
- ' - VMDK_FILE'
- - ' - C(vmdk_file) (str): Path of the VMDK file backing the virtual disk.
- ([''present''])'
+ - ' - C(vmdk_file) (str): Path of the VMDK file backing the virtual disk.'
+ - This field is optional and it is only relevant when the value of I(type)
+ is VMDK_FILE. (['present'])
type: dict
disk:
description:
- - Virtual disk identifier. Required with I(state=['absent', 'present'])
+ - Virtual disk identifier.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_hardware_disk).
+ Required with I(state=['absent', 'present'])
type: str
ide:
description:
- Address for attaching the device to a virtual IDE adapter.
+ - If unset, the server will choose an available address; if none is available,
+ the request will fail.
- 'Valid attributes are:'
- ' - C(primary) (bool): Flag specifying whether the device should be attached
- to the primary or secondary IDE adapter of the virtual machine. ([''present''])'
+ to the primary or secondary IDE adapter of the virtual machine.'
+ - If unset, the server will choose a adapter with an available connection.
+ If no IDE connections are available, the request will be rejected. (['present'])
- ' - C(master) (bool): Flag specifying whether the device should be the master
- or slave device on the IDE adapter. ([''present''])'
+ or slave device on the IDE adapter.'
+ - If unset, the server will choose an available connection type. If no IDE
+ connections are available, the request will be rejected. (['present'])
type: dict
label:
description:
@@ -49,38 +57,70 @@ options:
type: str
new_vmdk:
description:
- - Specification for creating a new VMDK backing for the virtual disk. Exactly
- one of C(#backing) or C(#new_vmdk) must be specified.
+ - Specification for creating a new VMDK backing for the virtual disk. Exactly
+ one of I(backing) or I(new_vmdk) must be specified.
+ - If unset, a new VMDK backing will not be created.
- 'Valid attributes are:'
- - ' - C(name) (str): Base name of the VMDK file. The name should not include
- the ''.vmdk'' file extension. ([''present''])'
- - ' - C(capacity) (int): Capacity of the virtual disk backing in bytes. ([''present''])'
- - ' - C(storage_policy) (dict): The C(storage_policy_spec) {@term structure}
- contains information about the storage policy that is to be associated
- the with VMDK file. ([''present''])'
+ - ' - C(name) (str): Base name of the VMDK file. The name should not include
+ the ''.vmdk'' file extension.'
+ - If unset, a name (derived from the name of the virtual machine) will be
+ chosen by the server. (['present'])
+ - ' - C(capacity) (int): Capacity of the virtual disk backing in bytes.'
+ - If unset, defaults to a guest-specific capacity. (['present'])
+ - ' - C(storage_policy) (dict): The I(storage_policy_spec) structure contains
+ information about the storage policy that is to be associated the with
+ VMDK file.'
+ - 'If unset the default storage policy of the target datastore (if applicable)
+ is applied. Currently a default storage policy is only supported by object
+ based datastores : VVol & vSAN. For non- object datastores, if unset then
+ no storage policy would be associated with the VMDK file. ([''present''])'
- ' - Accepted keys:'
- ' - policy (string): Identifier of the storage policy which should be
associated with the VMDK file.'
+ - 'When clients pass a value of this structure as a parameter, the field must
+ be the id of a resource returned by M(vmware.vmware_rest.vcenter_storage_policies). '
+ type: dict
+ nvme:
+ description:
+ - Address for attaching the device to a virtual NVMe adapter.
+ - If unset, the server will choose an available address; if none is available,
+ the request will fail. Required with I(state=['present'])
+ - 'Valid attributes are:'
+ - ' - C(bus) (int): Bus number of the adapter to which the device should be
+ attached. ([''present''])'
+ - ' This key is required with [''present''].'
+ - ' - C(unit) (int): Unit number of the device.'
+ - If unset, the server will choose an available unit number on the specified
+ adapter. If there are no available connections on the adapter, the request
+ will be rejected. (['present'])
type: dict
sata:
description:
- - Address for attaching the device to a virtual SATA adapter. Required with
- I(state=['present'])
+ - Address for attaching the device to a virtual SATA adapter.
+ - If unset, the server will choose an available address; if none is available,
+ the request will fail. Required with I(state=['present'])
- 'Valid attributes are:'
- ' - C(bus) (int): Bus number of the adapter to which the device should be
attached. ([''present''])'
- ' This key is required with [''present''].'
- - ' - C(unit) (int): Unit number of the device. ([''present''])'
+ - ' - C(unit) (int): Unit number of the device.'
+ - If unset, the server will choose an available unit number on the specified
+ adapter. If there are no available connections on the adapter, the request
+ will be rejected. (['present'])
type: dict
scsi:
description:
- - Address for attaching the device to a virtual SCSI adapter. Required with
- I(state=['present'])
+ - Address for attaching the device to a virtual SCSI adapter.
+ - If unset, the server will choose an available address; if none is available,
+ the request will fail. Required with I(state=['present'])
- 'Valid attributes are:'
- ' - C(bus) (int): Bus number of the adapter to which the device should be
attached. ([''present''])'
- ' This key is required with [''present''].'
- - ' - C(unit) (int): Unit number of the device. ([''present''])'
+ - ' - C(unit) (int): Unit number of the device.'
+ - If unset, the server will choose an available unit number on the specified
+ adapter. If there are no available connections on the adapter, the request
+ will be rejected. (['present'])
type: dict
session_timeout:
description:
@@ -100,11 +140,13 @@ options:
type:
choices:
- IDE
+ - NVME
- SATA
- SCSI
description:
- - The C(host_bus_adapter_type) defines the valid types of host bus adapters
- that may be used for attaching a virtual storage device to a virtual machine.
+ - The I(host_bus_adapter_type) enumerated type defines the valid types of
+ host bus adapters that may be used for attaching a virtual storage device
+ to a virtual machine.
type: str
vcenter_hostname:
description:
@@ -145,18 +187,20 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. This parameter is mandatory.
+ - Virtual machine identifier.
+ - 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -212,7 +256,6 @@ value:
# This structure describes the format of the data expected by the end-points
PAYLOAD_FORMAT = {
- "delete": {"query": {}, "body": {}, "path": {"disk": "disk", "vm": "vm"}},
"update": {
"query": {},
"body": {"backing": "backing"},
@@ -224,16 +267,16 @@ PAYLOAD_FORMAT = {
"backing": "backing",
"ide": "ide",
"new_vmdk": "new_vmdk",
+ "nvme": "nvme",
"sata": "sata",
"scsi": "scsi",
"type": "type",
},
"path": {"vm": "vm"},
},
+ "delete": {"query": {}, "body": {}, "path": {"disk": "disk", "vm": "vm"}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -248,26 +291,28 @@ 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",
@@ -298,6 +343,7 @@ def prepare_argument_spec():
argument_spec["ide"] = {"type": "dict"}
argument_spec["label"] = {"type": "str"}
argument_spec["new_vmdk"] = {"type": "dict"}
+ argument_spec["nvme"] = {"type": "dict"}
argument_spec["sata"] = {"type": "dict"}
argument_spec["scsi"] = {"type": "dict"}
argument_spec["state"] = {
@@ -305,7 +351,7 @@ def prepare_argument_spec():
"choices": ["absent", "present"],
"default": "present",
}
- argument_spec["type"] = {"type": "str", "choices": ["IDE", "SATA", "SCSI"]}
+ argument_spec["type"] = {"type": "str", "choices": ["IDE", "NVME", "SATA", "SCSI"]}
argument_spec["vm"] = {"required": True, "type": "str"}
return argument_spec
@@ -346,7 +392,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
@@ -363,20 +408,16 @@ async def entry_point(module, session):
async def _create(params, session):
-
lookup_url = per_id_url = build_url(params)
uniquity_keys = ["disk"]
comp_func = None
async def lookup_with_filters(params, session, url):
- # e.g: for the datacenter resources
- if "folder" not in params:
- return
+ search_filter = ""
+
if "name" not in params:
return
- async with session.get(
- f"{url}?names={params['name']}&folders={params['folder']}"
- ) as resp:
+ async with session.get(f"{url}?names={params['name']}{search_filter}") as resp:
_json = await resp.json()
if isinstance(_json, list) and len(_json) == 1:
return await get_device_info(session, url, _json[0]["disk"])
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_disk_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_disk_info.py
index 481e25896..dbfe3ba9b 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_disk_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_disk_info.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"""
@@ -17,7 +14,9 @@ description: Returns information about a virtual disk.
options:
disk:
description:
- - Virtual disk identifier. Required with I(state=['get'])
+ - Virtual disk identifier.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_hardware_disk).
+ Required with I(state=['get'])
type: str
label:
description:
@@ -70,18 +69,20 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. This parameter is mandatory.
+ - Virtual machine identifier.
+ - 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -137,8 +138,6 @@ PAYLOAD_FORMAT = {
"list": {"query": {}, "body": {}, "path": {"vm": "vm"}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -156,23 +155,23 @@ from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest imp
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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_ethernet.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_ethernet.py
index f92a0c4df..758e406fc 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_ethernet.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_ethernet.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"""
@@ -18,14 +15,16 @@ options:
allow_guest_control:
description:
- Flag indicating whether the guest can connect and disconnect the device.
+ - If unset, the value is unchanged.
type: bool
backing:
description:
- - Physical resource backing for the virtual Ethernet adapter. Required with
- I(state=['present'])
+ - Physical resource backing for the virtual Ethernet adapter.
+ - If unset, the system may try to find an appropriate backing. If one is not
+ found, the request will fail. Required with I(state=['present'])
- 'Valid attributes are:'
- - ' - C(type) (str): The C(backing_type) defines the valid backing types for
- a virtual Ethernet adapter. ([''present''])'
+ - ' - C(type) (str): This option defines the valid backing types for a virtual
+ Ethernet adapter. ([''present''])'
- ' This key is required with [''present''].'
- ' - Accepted values:'
- ' - DISTRIBUTED_PORTGROUP'
@@ -33,16 +32,25 @@ options:
- ' - OPAQUE_NETWORK'
- ' - STANDARD_PORTGROUP'
- ' - C(network) (str): Identifier of the network that backs the virtual Ethernet
- adapter. ([''present''])'
+ adapter.'
+ - This field is optional and it is only relevant when the value of I(type)
+ is one of STANDARD_PORTGROUP, DISTRIBUTED_PORTGROUP, or OPAQUE_NETWORK.
+ - When clients pass a value of this structure as a parameter, the field must
+ be the id of a resource returned by M(vmware.vmware_rest.vcenter_network_info).
+ (['present'])
- ' - C(distributed_port) (str): Key of the distributed virtual port that
- backs the virtual Ethernet adapter. Depending on the type of the Portgroup,
+ backs the virtual Ethernet adapter. Depending on the type of the Portgroup,
the port may be specified using this field. If the portgroup type is early-binding
(also known as static), a port is assigned when the Ethernet adapter is
configured to use the port. The port may be either automatically or specifically
assigned based on the value of this field. If the portgroup type is ephemeral,
the port is created and assigned to a virtual machine when it is powered
- on and the Ethernet adapter is connected. This field cannot be specified
- as no free ports exist before use. ([''present''])'
+ on and the Ethernet adapter is connected. This field cannot be specified
+ as no free ports exist before use.'
+ - May be used to specify a port when the network specified on the I(network)
+ field is a static or early binding distributed portgroup. If unset, the
+ port will be automatically assigned to the Ethernet adapter based on the
+ policy embodied by the portgroup type. (['present'])
type: dict
label:
description:
@@ -50,8 +58,12 @@ options:
type: str
mac_address:
description:
- - MAC address. This field may be modified at any time, and changes will be
- applied the next time the virtual machine is powered on.
+ - 'MAC address. '
+ - ' This field may be modified at any time, and changes will be applied the
+ next time the virtual machine is powered on.'
+ - ''
+ - If unset, the value is unchanged. Must be specified if I(mac_type) is MANUAL.
+ Must be unset if the MAC address type is not MANUAL.
type: str
mac_type:
choices:
@@ -59,19 +71,22 @@ options:
- GENERATED
- MANUAL
description:
- - The C(mac_address_type) defines the valid MAC address origins for a virtual
- Ethernet adapter.
+ - The I(mac_address_type) enumerated type defines the valid MAC address origins
+ for a virtual Ethernet adapter.
type: str
nic:
description:
- - Virtual Ethernet adapter identifier. Required with I(state=['absent', 'connect',
- 'disconnect', 'present'])
+ - Virtual Ethernet adapter identifier.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_hardware_ethernet).
+ Required with I(state=['absent', 'connect', 'disconnect', 'present'])
type: str
pci_slot_number:
description:
- - Address of the virtual Ethernet adapter on the PCI bus. If the PCI address
+ - Address of the virtual Ethernet adapter on the PCI bus. If the PCI address
is invalid, the server will change when it the VM is started or as the
device is hot added.
+ - If unset, the server will choose an available address when the virtual machine
+ is powered on.
type: int
session_timeout:
description:
@@ -85,6 +100,7 @@ options:
description:
- Flag indicating whether the virtual device should be connected whenever
the virtual machine is powered on.
+ - If unset, the value is unchanged.
type: bool
state:
choices:
@@ -104,15 +120,18 @@ options:
- VMXNET2
- VMXNET3
description:
- - The C(emulation_type) defines the valid emulation types for a virtual Ethernet
- adapter.
+ - The I(emulation_type) enumerated type defines the valid emulation types
+ for a virtual Ethernet adapter.
type: str
upt_compatibility_enabled:
description:
- - Flag indicating whether Universal Pass-Through (UPT) compatibility should
- be enabled on this virtual Ethernet adapter. This field may be modified
- at any time, and changes will be applied the next time the virtual machine
- is powered on.
+ - 'Flag indicating whether Universal Pass-Through (UPT) compatibility should
+ be enabled on this virtual Ethernet adapter. '
+ - ' This field may be modified at any time, and changes will be applied the
+ next time the virtual machine is powered on.'
+ - ''
+ - If unset, the value is unchanged. Must be unset if the emulation type of
+ the virtual Ethernet adapter is not VMXNET3.
type: bool
vcenter_hostname:
description:
@@ -153,24 +172,29 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. This parameter is mandatory.
+ - Virtual machine identifier.
+ - 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
wake_on_lan_enabled:
description:
- - Flag indicating whether wake-on-LAN shoud be enabled on this virtual Ethernet
- adapter. This field may be modified at any time, and changes will be applied
- the next time the virtual machine is powered on.
+ - 'Flag indicating whether wake-on-LAN shoud be enabled on this virtual Ethernet
+ adapter. '
+ - ' This field may be modified at any time, and changes will be applied the
+ next time the virtual machine is powered on.'
+ - ''
+ - If unset, the value is unchanged.
type: bool
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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -281,6 +305,8 @@ value:
# This structure describes the format of the data expected by the end-points
PAYLOAD_FORMAT = {
+ "connect": {"query": {}, "body": {}, "path": {"nic": "nic", "vm": "vm"}},
+ "disconnect": {"query": {}, "body": {}, "path": {"nic": "nic", "vm": "vm"}},
"update": {
"query": {},
"body": {
@@ -310,12 +336,8 @@ PAYLOAD_FORMAT = {
"path": {"vm": "vm"},
},
"delete": {"query": {}, "body": {}, "path": {"nic": "nic", "vm": "vm"}},
- "disconnect": {"query": {}, "body": {}, "path": {"nic": "nic", "vm": "vm"}},
- "connect": {"query": {}, "body": {}, "path": {"nic": "nic", "vm": "vm"}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -330,26 +352,28 @@ 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",
@@ -437,7 +461,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
@@ -481,20 +504,16 @@ async def _connect(params, session):
async def _create(params, session):
-
lookup_url = per_id_url = build_url(params)
uniquity_keys = ["nic"]
comp_func = None
async def lookup_with_filters(params, session, url):
- # e.g: for the datacenter resources
- if "folder" not in params:
- return
+ search_filter = ""
+
if "name" not in params:
return
- async with session.get(
- f"{url}?names={params['name']}&folders={params['folder']}"
- ) as resp:
+ async with session.get(f"{url}?names={params['name']}{search_filter}") as resp:
_json = await resp.json()
if isinstance(_json, list) and len(_json) == 1:
return await get_device_info(session, url, _json[0]["nic"])
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_ethernet_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_ethernet_info.py
index d0764425e..c474552f8 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_ethernet_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_ethernet_info.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"""
@@ -21,7 +18,9 @@ options:
type: str
nic:
description:
- - Virtual Ethernet adapter identifier. Required with I(state=['get'])
+ - Virtual Ethernet adapter identifier.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_hardware_ethernet).
+ Required with I(state=['get'])
type: str
session_timeout:
description:
@@ -70,18 +69,20 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. This parameter is mandatory.
+ - Virtual machine identifier.
+ - 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -122,8 +123,6 @@ PAYLOAD_FORMAT = {
"list": {"query": {}, "body": {}, "path": {"vm": "vm"}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -141,23 +140,23 @@ from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest imp
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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_floppy.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_floppy.py
index 98e04233a..41d9f6177 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_floppy.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_floppy.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"""
@@ -18,27 +15,35 @@ options:
allow_guest_control:
description:
- Flag indicating whether the guest can connect and disconnect the device.
+ - If unset, the value is unchanged.
type: bool
backing:
description:
- - Physical resource backing for the virtual floppy drive. Required with I(state=['present'])
+ - Physical resource backing for the virtual floppy drive.
+ - If unset, defaults to automatic detection of a suitable host device. Required
+ with I(state=['present'])
- 'Valid attributes are:'
- - ' - C(type) (str): The C(backing_type) defines the valid backing types for
- a virtual floppy drive. ([''present''])'
+ - ' - C(type) (str): This option defines the valid backing types for a virtual
+ floppy drive. ([''present''])'
- ' This key is required with [''present''].'
- ' - Accepted values:'
- ' - CLIENT_DEVICE'
- ' - HOST_DEVICE'
- ' - IMAGE_FILE'
- ' - C(image_file) (str): Path of the image file that should be used as the
- virtual floppy drive backing. ([''present''])'
+ virtual floppy drive backing.'
+ - This field is optional and it is only relevant when the value of I(type)
+ is IMAGE_FILE. (['present'])
- ' - C(host_device) (str): Name of the device that should be used as the
- virtual floppy drive backing. ([''present''])'
+ virtual floppy drive backing.'
+ - If unset, the virtual floppy drive will be configured to automatically detect
+ a suitable host device. (['present'])
type: dict
floppy:
description:
- - Virtual floppy drive identifier. Required with I(state=['absent', 'connect',
- 'disconnect', 'present'])
+ - Virtual floppy drive identifier.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_hardware_floppy).
+ Required with I(state=['absent', 'connect', 'disconnect', 'present'])
type: str
label:
description:
@@ -56,6 +61,7 @@ options:
description:
- Flag indicating whether the virtual device should be connected whenever
the virtual machine is powered on.
+ - If unset, the value is unchanged.
type: bool
state:
choices:
@@ -105,18 +111,20 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. This parameter is mandatory.
+ - Virtual machine identifier.
+ - 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -169,6 +177,8 @@ value:
# This structure describes the format of the data expected by the end-points
PAYLOAD_FORMAT = {
+ "connect": {"query": {}, "body": {}, "path": {"floppy": "floppy", "vm": "vm"}},
+ "disconnect": {"query": {}, "body": {}, "path": {"floppy": "floppy", "vm": "vm"}},
"update": {
"query": {},
"body": {
@@ -188,12 +198,8 @@ PAYLOAD_FORMAT = {
"path": {"vm": "vm"},
},
"delete": {"query": {}, "body": {}, "path": {"floppy": "floppy", "vm": "vm"}},
- "disconnect": {"query": {}, "body": {}, "path": {"floppy": "floppy", "vm": "vm"}},
- "connect": {"query": {}, "body": {}, "path": {"floppy": "floppy", "vm": "vm"}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -208,26 +214,28 @@ 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",
@@ -303,7 +311,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
@@ -347,20 +354,16 @@ async def _connect(params, session):
async def _create(params, session):
-
lookup_url = per_id_url = build_url(params)
uniquity_keys = ["floppy"]
comp_func = None
async def lookup_with_filters(params, session, url):
- # e.g: for the datacenter resources
- if "folder" not in params:
- return
+ search_filter = ""
+
if "name" not in params:
return
- async with session.get(
- f"{url}?names={params['name']}&folders={params['folder']}"
- ) as resp:
+ async with session.get(f"{url}?names={params['name']}{search_filter}") as resp:
_json = await resp.json()
if isinstance(_json, list) and len(_json) == 1:
return await get_device_info(session, url, _json[0]["floppy"])
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_floppy_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_floppy_info.py
index 221083299..b5833071a 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_floppy_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_floppy_info.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"""
@@ -17,7 +14,9 @@ description: Returns information about a virtual floppy drive.
options:
floppy:
description:
- - Virtual floppy drive identifier. Required with I(state=['get'])
+ - Virtual floppy drive identifier.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_hardware_floppy).
+ Required with I(state=['get'])
type: str
label:
description:
@@ -70,18 +69,20 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. This parameter is mandatory.
+ - Virtual machine identifier.
+ - 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -117,8 +118,6 @@ PAYLOAD_FORMAT = {
"list": {"query": {}, "body": {}, "path": {"vm": "vm"}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -136,23 +135,23 @@ from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest imp
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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_info.py
index 96cd40fd8..54fb4e5b6 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_info.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"""
@@ -62,17 +59,19 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. Required with I(state=['get'])
+ - Virtual machine identifier.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_info).
+ Required with I(state=['get'])
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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -105,8 +104,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {"vm": "vm"}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -121,26 +118,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_memory.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_memory.py
index 912c3604c..ce91b03db 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_memory.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_memory.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"""
@@ -17,11 +14,16 @@ description: Updates the memory-related settings of a virtual machine.
options:
hot_add_enabled:
description:
- - Flag indicating whether adding memory while the virtual machine is running
- should be enabled. Some guest operating systems may consume more resources
- or perform less efficiently when they run on hardware that supports adding
- memory while the machine is running. This field may only be modified if
- the virtual machine is not powered on.
+ - 'Flag indicating whether adding memory while the virtual machine is running
+ should be enabled. '
+ - ' Some guest operating systems may consume more resources or perform less
+ efficiently when they run on hardware that supports adding memory while
+ the machine is running. '
+ - ''
+ - ' This field may only be modified if the virtual machine is not powered
+ on.'
+ - ''
+ - If unset, the value is unchanged.
type: bool
session_timeout:
description:
@@ -33,12 +35,15 @@ options:
version_added: 2.1.0
size_MiB:
description:
- - New memory size in mebibytes. The supported range of memory sizes is constrained
- by the configured guest operating system and virtual hardware version
- of the virtual machine. If the virtual machine is running, this value
- may only be changed if {@link Info#hotAddEnabled} is true, and the new
- memory size must satisfy the constraints specified by {@link Info#hotAddIncrementSizeMiB}
- and {@link Info#hotAddLimitMiB}.
+ - 'New memory size in mebibytes. '
+ - ' The supported range of memory sizes is constrained by the configured guest
+ operating system and virtual hardware version of the virtual machine. '
+ - ''
+ - ' If the virtual machine is running, this value may only be changed if I(hot_add_enabled)
+ is true, and the new memory size must satisfy the constraints specified
+ by I(hot_add_increment_size_mib) and I()'
+ - ''
+ - If unset, the value is unchanged.
type: int
state:
choices:
@@ -85,18 +90,20 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. This parameter is mandatory.
+ - Virtual machine identifier.
+ - 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -141,8 +148,6 @@ PAYLOAD_FORMAT = {
}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -157,26 +162,24 @@ 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",
@@ -249,7 +252,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_memory_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_memory_info.py
index 503f78dd0..0087744db 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_memory_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_memory_info.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"""
@@ -62,17 +59,19 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. Required with I(state=['get'])
+ - Virtual machine identifier.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_info).
+ Required with I(state=['get'])
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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -109,8 +108,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {"vm": "vm"}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -125,26 +122,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_parallel.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_parallel.py
index 5bb5559a2..ec7076e2c 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_parallel.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_parallel.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"""
@@ -18,21 +15,28 @@ options:
allow_guest_control:
description:
- Flag indicating whether the guest can connect and disconnect the device.
+ - If unset, the value is unchanged.
type: bool
backing:
description:
- - Physical resource backing for the virtual parallel port. Required with I(state=['present'])
+ - Physical resource backing for the virtual parallel port.
+ - If unset, defaults to automatic detection of a suitable host device. Required
+ with I(state=['present'])
- 'Valid attributes are:'
- - ' - C(type) (str): The C(backing_type) defines the valid backing types for
- a virtual parallel port. ([''present''])'
+ - ' - C(type) (str): This option defines the valid backing types for a virtual
+ parallel port. ([''present''])'
- ' This key is required with [''present''].'
- ' - Accepted values:'
- ' - FILE'
- ' - HOST_DEVICE'
- ' - C(file) (str): Path of the file that should be used as the virtual parallel
- port backing. ([''present''])'
+ port backing.'
+ - This field is optional and it is only relevant when the value of I(type)
+ is FILE. (['present'])
- ' - C(host_device) (str): Name of the device that should be used as the
- virtual parallel port backing. ([''present''])'
+ virtual parallel port backing.'
+ - If unset, the virtual parallel port will be configured to automatically
+ detect a suitable host device. (['present'])
type: dict
label:
description:
@@ -40,8 +44,9 @@ options:
type: str
port:
description:
- - Virtual parallel port identifier. Required with I(state=['absent', 'connect',
- 'disconnect', 'present'])
+ - Virtual parallel port identifier.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_hardware_parallel).
+ Required with I(state=['absent', 'connect', 'disconnect', 'present'])
type: str
session_timeout:
description:
@@ -55,6 +60,7 @@ options:
description:
- Flag indicating whether the virtual device should be connected whenever
the virtual machine is powered on.
+ - If unset, the value is unchanged.
type: bool
state:
choices:
@@ -104,18 +110,20 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. This parameter is mandatory.
+ - Virtual machine identifier.
+ - 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -161,6 +169,8 @@ value:
# This structure describes the format of the data expected by the end-points
PAYLOAD_FORMAT = {
+ "connect": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}},
+ "disconnect": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}},
"update": {
"query": {},
"body": {
@@ -180,12 +190,8 @@ PAYLOAD_FORMAT = {
"path": {"vm": "vm"},
},
"delete": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}},
- "disconnect": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}},
- "connect": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -200,26 +206,28 @@ 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",
@@ -295,7 +303,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
@@ -339,20 +346,16 @@ async def _connect(params, session):
async def _create(params, session):
-
lookup_url = per_id_url = build_url(params)
uniquity_keys = ["port"]
comp_func = None
async def lookup_with_filters(params, session, url):
- # e.g: for the datacenter resources
- if "folder" not in params:
- return
+ search_filter = ""
+
if "name" not in params:
return
- async with session.get(
- f"{url}?names={params['name']}&folders={params['folder']}"
- ) as resp:
+ async with session.get(f"{url}?names={params['name']}{search_filter}") as resp:
_json = await resp.json()
if isinstance(_json, list) and len(_json) == 1:
return await get_device_info(session, url, _json[0]["port"])
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_parallel_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_parallel_info.py
index b8f3457ab..d2d2f7f37 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_parallel_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_parallel_info.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"""
@@ -21,7 +18,9 @@ options:
type: str
port:
description:
- - Virtual parallel port identifier. Required with I(state=['get'])
+ - Virtual parallel port identifier.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_hardware_parallel).
+ Required with I(state=['get'])
type: str
session_timeout:
description:
@@ -70,18 +69,20 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. This parameter is mandatory.
+ - Virtual machine identifier.
+ - 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -117,8 +118,6 @@ PAYLOAD_FORMAT = {
"list": {"query": {}, "body": {}, "path": {"vm": "vm"}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -136,23 +135,23 @@ from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest imp
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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_serial.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_serial.py
index 0d953a6c6..3da5807bd 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_serial.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_serial.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"""
@@ -18,13 +15,16 @@ options:
allow_guest_control:
description:
- Flag indicating whether the guest can connect and disconnect the device.
+ - If unset, the value is unchanged.
type: bool
backing:
description:
- - Physical resource backing for the virtual serial port. Required with I(state=['present'])
+ - Physical resource backing for the virtual serial port.
+ - If unset, defaults to automatic detection of a suitable host device. Required
+ with I(state=['present'])
- 'Valid attributes are:'
- - ' - C(type) (str): The C(backing_type) defines the valid backing types for
- a virtual serial port. ([''present''])'
+ - ' - C(type) (str): This option defines the valid backing types for a virtual
+ serial port. ([''present''])'
- ' This key is required with [''present''].'
- ' - Accepted values:'
- ' - FILE'
@@ -33,25 +33,38 @@ options:
- ' - NETWORK_SERVER'
- ' - PIPE_CLIENT'
- ' - PIPE_SERVER'
- - ' - C(file) (str): Path of the file backing the virtual serial port. ([''present''])'
+ - ' - C(file) (str): Path of the file backing the virtual serial port.'
+ - This field is optional and it is only relevant when the value of I(type)
+ is FILE. (['present'])
- ' - C(host_device) (str): Name of the device backing the virtual serial
- port. ([''present''])'
- - ' - C(pipe) (str): Name of the pipe backing the virtual serial port. ([''present''])'
+ port. '
+ - ''
+ - ''
+ - If unset, the virtual serial port will be configured to automatically detect
+ a suitable host device. (['present'])
+ - ' - C(pipe) (str): Name of the pipe backing the virtual serial port.'
+ - This field is optional and it is only relevant when the value of I(type)
+ is one of PIPE_SERVER or PIPE_CLIENT. (['present'])
- ' - C(no_rx_loss) (bool): Flag that enables optimized data transfer over
the pipe. When the value is true, the host buffers data to prevent data
- overrun. This allows the virtual machine to read all of the data transferred
- over the pipe with no data loss. ([''present''])'
+ overrun. This allows the virtual machine to read all of the data transferred
+ over the pipe with no data loss.'
+ - If unset, defaults to false. (['present'])
- ' - C(network_location) (str): URI specifying the location of the network
- service backing the virtual serial port. <ul> <li>If {@link #type} is
- {@link BackingType#NETWORK_SERVER}, this field is the location used by
- clients to connect to this server. The hostname part of the URI should
- either be empty or should specify the address of the host on which the
- virtual machine is running.</li> <li>If {@link #type} is {@link BackingType#NETWORK_CLIENT},
- this field is the location used by the virtual machine to connect to the
- remote server.</li> </ul> ([''present''])'
+ service backing the virtual serial port. '
+ - ' - If I(type) is NETWORK_SERVER, this field is the location used by clients
+ to connect to this server. The hostname part of the URI should either
+ be empty or should specify the address of the host on which the virtual
+ machine is running.'
+ - ' - If I(type) is NETWORK_CLIENT, this field is the location used by the
+ virtual machine to connect to the remote server.'
+ - ' '
+ - This field is optional and it is only relevant when the value of I(type)
+ is one of NETWORK_SERVER or NETWORK_CLIENT. (['present'])
- ' - C(proxy) (str): Proxy service that provides network access to the network
- backing. If set, the virtual machine initiates a connection with the
- proxy service and forwards the traffic to the proxy. ([''present''])'
+ backing. If set, the virtual machine initiates a connection with the proxy
+ service and forwards the traffic to the proxy.'
+ - If unset, no proxy service should be used. (['present'])
type: dict
label:
description:
@@ -59,8 +72,9 @@ options:
type: str
port:
description:
- - Virtual serial port identifier. Required with I(state=['absent', 'connect',
- 'disconnect', 'present'])
+ - Virtual serial port identifier.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_hardware_serial).
+ Required with I(state=['absent', 'connect', 'disconnect', 'present'])
type: str
session_timeout:
description:
@@ -74,6 +88,7 @@ options:
description:
- Flag indicating whether the virtual device should be connected whenever
the virtual machine is powered on.
+ - If unset, the value is unchanged.
type: bool
state:
choices:
@@ -123,27 +138,31 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. This parameter is mandatory.
+ - Virtual machine identifier.
+ - 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
yield_on_poll:
description:
- - CPU yield behavior. If set to true, the virtual machine will periodically
+ - 'CPU yield behavior. If set to true, the virtual machine will periodically
relinquish the processor if its sole task is polling the virtual serial
port. The amount of time it takes to regain the processor will depend
- on the degree of other virtual machine activity on the host. This field
- may be modified at any time, and changes applied to a connected virtual
- serial port take effect immediately.
+ on the degree of other virtual machine activity on the host. '
+ - ' This field may be modified at any time, and changes applied to a connected
+ virtual serial port take effect immediately.'
+ - ''
+ - If unset, the value is unchanged.
type: bool
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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -225,6 +244,8 @@ value:
# This structure describes the format of the data expected by the end-points
PAYLOAD_FORMAT = {
+ "connect": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}},
+ "disconnect": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}},
"update": {
"query": {},
"body": {
@@ -246,12 +267,8 @@ PAYLOAD_FORMAT = {
"path": {"vm": "vm"},
},
"delete": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}},
- "disconnect": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}},
- "connect": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -266,26 +283,28 @@ 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",
@@ -362,7 +381,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
@@ -406,20 +424,16 @@ async def _connect(params, session):
async def _create(params, session):
-
lookup_url = per_id_url = build_url(params)
uniquity_keys = ["port"]
comp_func = None
async def lookup_with_filters(params, session, url):
- # e.g: for the datacenter resources
- if "folder" not in params:
- return
+ search_filter = ""
+
if "name" not in params:
return
- async with session.get(
- f"{url}?names={params['name']}&folders={params['folder']}"
- ) as resp:
+ async with session.get(f"{url}?names={params['name']}{search_filter}") as resp:
_json = await resp.json()
if isinstance(_json, list) and len(_json) == 1:
return await get_device_info(session, url, _json[0]["port"])
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_serial_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_serial_info.py
index f79e9e8f3..1f7357f6d 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_serial_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_hardware_serial_info.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"""
@@ -21,7 +18,9 @@ options:
type: str
port:
description:
- - Virtual serial port identifier. Required with I(state=['get'])
+ - Virtual serial port identifier.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_hardware_serial).
+ Required with I(state=['get'])
type: str
session_timeout:
description:
@@ -70,18 +69,20 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. This parameter is mandatory.
+ - Virtual machine identifier.
+ - 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -137,8 +138,6 @@ PAYLOAD_FORMAT = {
"list": {"query": {}, "body": {}, "path": {"vm": "vm"}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -156,23 +155,23 @@ from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest imp
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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_info.py
index 464b5cad8..145e169f2 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_info.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"""
@@ -19,6 +16,9 @@ options:
description:
- Clusters that must contain the virtual machine for the virtual machine to
match the filter.
+ - If unset or empty, virtual machines in any cluster match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_cluster_info).
elements: str
type: list
datacenters:
@@ -27,6 +27,9 @@ options:
description:
- Datacenters that must contain the virtual machine for the virtual machine
to match the filter.
+ - If unset or empty, virtual machines in any datacenter match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_datacenter_info).
elements: str
type: list
folders:
@@ -35,31 +38,42 @@ options:
description:
- Folders that must contain the virtual machine for the virtual machine to
match the filter.
+ - If unset or empty, virtual machines in any folder match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_folder_info).
elements: str
type: list
hosts:
description:
- Hosts that must contain the virtual machine for the virtual machine to match
the filter.
+ - If unset or empty, virtual machines on any host match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_host_info).
elements: str
type: list
names:
aliases:
- filter_names
description:
- - Names that virtual machines must have to match the filter (see {@link Info#name}).
+ - Names that virtual machines must have to match the filter (see I(name)).
+ - If unset or empty, virtual machines with any name match the filter.
elements: str
type: list
power_states:
description:
- Power states that a virtual machine must be in to match the filter (see
- {@link I(info)#state}.
+ I()
+ - If unset or empty, virtual machines in any power state match the filter.
elements: str
type: list
resource_pools:
description:
- Resource pools that must contain the virtual machine for the virtual machine
to match the filter.
+ - If unset or empty, virtual machines in any resource pool match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_resourcepool_info).
elements: str
type: list
session_timeout:
@@ -109,22 +123,27 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. Required with I(state=['get'])
+ - Virtual machine identifier.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_info).
+ Required with I(state=['get'])
type: str
vms:
description:
- Identifiers of virtual machines that can match the filter.
+ - If unset or empty, virtual machines with any identifier match the filter.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_vm_info).
elements: str
type: list
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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -310,8 +329,6 @@ PAYLOAD_FORMAT = {
},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -329,23 +346,23 @@ from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest imp
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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_libraryitem_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_libraryitem_info.py
index 9a70f5f2d..2b3f20537 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_libraryitem_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_libraryitem_info.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"""
@@ -64,17 +61,19 @@ options:
type: bool
vm:
description:
- - Identifier of the virtual machine. Required with I(state=['get'])
+ - Identifier of the virtual machine.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_info).
+ Required with I(state=['get'])
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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -109,8 +108,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {"vm": "vm"}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -125,26 +122,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_power.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_power.py
index 27139045d..5007a07f3 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_power.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_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"""
@@ -74,14 +71,16 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. This parameter is mandatory.
+ - Virtual machine identifier.
+ - 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:
@@ -89,7 +88,7 @@ seealso:
a soft shutdown, standby (suspend) or soft reboot
module: vmware.vmware_rest.vcenter_vm_guest_power
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -232,14 +231,12 @@ results:
# This structure describes the format of the data expected by the end-points
PAYLOAD_FORMAT = {
- "suspend": {"query": {}, "body": {}, "path": {"vm": "vm"}},
"reset": {"query": {}, "body": {}, "path": {"vm": "vm"}},
- "stop": {"query": {}, "body": {}, "path": {"vm": "vm"}},
"start": {"query": {}, "body": {}, "path": {"vm": "vm"}},
+ "stop": {"query": {}, "body": {}, "path": {"vm": "vm"}},
+ "suspend": {"query": {}, "body": {}, "path": {"vm": "vm"}},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -254,26 +251,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",
@@ -342,7 +340,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_power_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_power_info.py
index a482d8cf2..2e05118f9 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_power_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_power_info.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"""
@@ -62,17 +59,19 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. Required with I(state=['get'])
+ - Virtual machine identifier.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_info).
+ Required with I(state=['get'])
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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -108,8 +107,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {"vm": "vm"}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -124,26 +121,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_storage_policy.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_storage_policy.py
index 63659925e..bdeaac92d 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_storage_policy.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_storage_policy.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"""
@@ -21,6 +18,9 @@ options:
description:
- Storage policy or policies to be used when reconfiguring virtual machine
diks.
+ - if unset the current storage policy is retained.
+ - 'When clients pass a value of this structure as a parameter, the key in
+ the field map must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_hardware_disk). '
type: dict
session_timeout:
description:
@@ -75,33 +75,39 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. This parameter is mandatory.
+ - Virtual machine identifier.
+ - 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
vm_home:
description:
- - Storage policy to be used when reconfiguring the virtual machine home. This
- parameter is mandatory.
+ - Storage policy to be used when reconfiguring the virtual machine home.
+ - if unset the current storage policy is retained. This parameter is mandatory.
- 'Valid attributes are:'
- - ' - C(type) (str): The C(policy_type) defines the choices for how to specify
- the policy to be associated with the virtual machine home''s directory.
- ([''present''])'
+ - ' - C(type) (str): This option defines the choices for how to specify the
+ policy to be associated with the virtual machine home''s directory. ([''present''])'
- ' This key is required with [''present''].'
- ' - Accepted values:'
- ' - USE_DEFAULT_POLICY'
- ' - USE_SPECIFIED_POLICY'
- - ' - C(policy) (str): Storage Policy identification. ([''present''])'
+ - ' - C(policy) (str): Storage Policy identification.'
+ - This field is optional and it is only relevant when the value of I(type)
+ is USE_SPECIFIED_POLICY.
+ - When clients pass a value of this structure as a parameter, the field must
+ be the id of a resource returned by M(vmware.vmware_rest.vcenter_storage_policies).
+ (['present'])
required: true
type: dict
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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -152,8 +158,6 @@ PAYLOAD_FORMAT = {
}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -168,26 +172,24 @@ 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",
@@ -260,7 +262,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_storage_policy_compliance.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_storage_policy_compliance.py
index 081417e81..9ef117d64 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_storage_policy_compliance.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_storage_policy_compliance.py
@@ -3,24 +3,24 @@
# 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"""
module: vcenter_vm_storage_policy_compliance
-short_description: Returns the storage policy Compliance {@link Info} of a virtual
+short_description: Returns the storage policy Compliance Compliance.Info of a virtual
machine after explicitly re-computing compliance check.
-description: Returns the storage policy Compliance {@link Info} of a virtual machine
+description: Returns the storage policy Compliance Compliance.Info of a virtual machine
after explicitly re-computing compliance check.
options:
disks:
description:
- Identifiers of the virtual machine's virtual disks for which compliance
should be checked.
+ - If unset or empty, compliance check is invoked on all the associated disks.
+ - When clients pass a value of this structure as a parameter, the field must
+ contain the id of resources returned by M(vmware.vmware_rest.vcenter_vm_hardware_disk).
elements: str
type: list
session_timeout:
@@ -76,7 +76,9 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. This parameter is mandatory.
+ - Virtual machine identifier.
+ - 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
vm_home:
@@ -89,11 +91,11 @@ 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -111,8 +113,6 @@ PAYLOAD_FORMAT = {
}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -127,26 +127,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",
@@ -215,7 +216,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_storage_policy_compliance_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_storage_policy_compliance_info.py
index fa6f4e1c3..70d371fcd 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_storage_policy_compliance_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_storage_policy_compliance_info.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"""
@@ -64,17 +61,19 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier. Required with I(state=['get'])
+ - Virtual machine identifier.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_info).
+ Required with I(state=['get'])
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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -116,8 +115,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {"vm": "vm"}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -132,26 +129,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_storage_policy_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_storage_policy_info.py
index 94ead680c..131fa709d 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_storage_policy_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_storage_policy_info.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"""
@@ -64,17 +61,19 @@ options:
type: bool
vm:
description:
- - Virtual machine identifier Required with I(state=['get'])
+ - Virtual machine identifier
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_info).
+ Required with I(state=['get'])
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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -110,8 +109,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {"vm": "vm"}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -126,26 +123,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_tools.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_tools.py
index 464f83f43..cc7b59b25 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_tools.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_tools.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"""
@@ -19,6 +16,7 @@ options:
description:
- Command line options passed to the installer to modify the installation
procedure for Tools.
+ - Set if any additional options are desired.
type: str
session_timeout:
description:
@@ -40,8 +38,8 @@ options:
- MANUAL
- UPGRADE_AT_POWER_CYCLE
description:
- - The C(upgrade_policy) defines when Tools are auto-upgraded for a virtual
- machine.
+ - The I(upgrade_policy) enumerated type defines when Tools are auto-upgraded
+ for a virtual machine.
type: str
vcenter_hostname:
description:
@@ -82,18 +80,20 @@ 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -162,8 +162,6 @@ PAYLOAD_FORMAT = {
},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -178,26 +176,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",
@@ -271,7 +270,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_tools_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_tools_info.py
index ff87ed923..f1a2f202b 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_tools_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_tools_info.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"""
@@ -62,17 +59,19 @@ options:
type: bool
vm:
description:
- - Identifier of the virtual machine. Required with I(state=['get'])
+ - Identifier of the virtual machine.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_info).
+ Required with I(state=['get'])
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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -173,8 +172,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {"vm": "vm"}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -189,26 +186,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_tools_installer.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_tools_installer.py
index e42fe66f7..376ce6e31 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_tools_installer.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_tools_installer.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"""
@@ -18,10 +15,10 @@ description: Connects the VMware Tools CD installer as a CD-ROM for the guest op
system. On Windows guest operating systems with autorun, this should cause the
installer to initiate the Tools installation which will need user input to complete.
On other (non-Windows) guest operating systems this will make the Tools installation
- available, and a a user will need to do guest-specific actions. On Linux, this
+ available, and a a user will need to do guest-specific actions. On Linux, this
includes opening an archive and running the installer. To monitor the status of
- the Tools install, clients should check the {@name vcenter.vm.Tools.Info#versionStatus}
- and {@name vcenter.vm.Tools.Info#runState} from {@link vcenter.vm.Tools#get}
+ the Tools install, clients should check the Tools.Info.version-status and Tools.Info.run-state
+ from Tools.get
options:
session_timeout:
description:
@@ -77,18 +74,20 @@ options:
type: bool
vm:
description:
- - Virtual machine ID This parameter is mandatory.
+ - Virtual machine ID
+ - 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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -142,12 +141,10 @@ value:
# This structure describes the format of the data expected by the end-points
PAYLOAD_FORMAT = {
- "disconnect": {"query": {}, "body": {}, "path": {"vm": "vm"}},
"connect": {"query": {}, "body": {}, "path": {"vm": "vm"}},
+ "disconnect": {"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"
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_tools_installer_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_tools_installer_info.py
index 37401ebef..c88b22c95 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_tools_installer_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vm_tools_installer_info.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"""
@@ -62,17 +59,19 @@ options:
type: bool
vm:
description:
- - Identifier of the virtual machine. Required with I(state=['get'])
+ - Identifier of the virtual machine.
+ - The parameter must be the id of a resource returned by M(vmware.vmware_rest.vcenter_vm_info).
+ Required with I(state=['get'])
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
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -129,8 +128,6 @@ PAYLOAD_FORMAT = {
"get": {"query": {}, "body": {}, "path": {"vm": "vm"}}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -145,26 +142,24 @@ 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",
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vmtemplate_libraryitems.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vmtemplate_libraryitems.py
index c2ced6ab7..0eb18f625 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vmtemplate_libraryitems.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vmtemplate_libraryitems.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"""
@@ -186,11 +183,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.2.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -312,39 +309,37 @@ value:
# This structure describes the format of the data expected by the end-points
PAYLOAD_FORMAT = {
- "create": {
+ "deploy": {
"query": {},
"body": {
"description": "description",
"disk_storage": "disk_storage",
"disk_storage_overrides": "disk_storage_overrides",
- "library": "library",
+ "guest_customization": "guest_customization",
+ "hardware_customization": "hardware_customization",
"name": "name",
"placement": "placement",
- "source_vm": "source_vm",
+ "powered_on": "powered_on",
"vm_home_storage": "vm_home_storage",
},
- "path": {},
+ "path": {"template_library_item": "template_library_item"},
},
- "deploy": {
+ "create": {
"query": {},
"body": {
"description": "description",
"disk_storage": "disk_storage",
"disk_storage_overrides": "disk_storage_overrides",
- "guest_customization": "guest_customization",
- "hardware_customization": "hardware_customization",
+ "library": "library",
"name": "name",
"placement": "placement",
- "powered_on": "powered_on",
+ "source_vm": "source_vm",
"vm_home_storage": "vm_home_storage",
},
- "path": {"template_library_item": "template_library_item"},
+ "path": {},
},
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -359,26 +354,28 @@ 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",
@@ -460,7 +457,6 @@ def build_url(params):
async def entry_point(module, session):
-
if module.params["state"] == "present":
if "_create" in globals():
operation = "create"
@@ -477,7 +473,6 @@ async def entry_point(module, session):
async def _create(params, session):
-
lookup_url = "https://{vcenter_hostname}/api/content/library/item?library_id={library}".format(
**params
)
diff --git a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vmtemplate_libraryitems_info.py b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vmtemplate_libraryitems_info.py
index 70d9bd27e..b5f78c3d1 100644
--- a/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vmtemplate_libraryitems_info.py
+++ b/ansible_collections/vmware/vmware_rest/plugins/modules/vcenter_vmtemplate_libraryitems_info.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"""
@@ -71,11 +68,11 @@ author:
- Ansible Cloud Team (@ansible-collections)
version_added: 2.2.0
requirements:
-- vSphere 7.0.2 or greater
+- vSphere 7.0.3 or greater
- python >= 3.6
- aiohttp
notes:
-- Tested on vSphere 7.0.2
+- Tested on vSphere 7.0.3
"""
EXAMPLES = r"""
@@ -93,8 +90,6 @@ PAYLOAD_FORMAT = {
}
} # pylint: disable=line-too-long
-import json
-import socket
from ansible.module_utils.basic import env_fallback
try:
@@ -109,26 +104,24 @@ 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",