From 28d5a80078ab728ce8c0e31acadc3347fd296f40 Mon Sep 17 00:00:00 2001 From: Ondra Machacek Date: Mon, 25 Mar 2024 14:22:17 +0100 Subject: [PATCH] Release 3.0.1 (#489) Release 3.0.1 Release 3.0.1 Reviewed-by: Mario Lenz Reviewed-by: GomathiselviS Reviewed-by: Alina Buzachis --- CHANGELOG.rst | 20 +++ README.md | 2 +- changelogs/changelog.yaml | 17 +++ ...20240105-bugfix-lookup-options-parsing.yml | 4 - .../20240305-network-moid-docs-update.yml | 3 - changelogs/fragments/463_fix_library_url.yaml | 3 - ...vmware.vmware_rest.cluster_moid_lookup.rst | 23 ++- ...are.vmware_rest.datacenter_moid_lookup.rst | 23 ++- ...ware.vmware_rest.datastore_moid_lookup.rst | 23 ++- .../vmware.vmware_rest.folder_moid_lookup.rst | 23 ++- docs/vmware.vmware_rest.host_moid_lookup.rst | 23 ++- ...vmware.vmware_rest.network_moid_lookup.rst | 24 ++- ....vmware_rest.resource_pool_moid_lookup.rst | 23 ++- ...st.vcenter_vm_hardware_ethernet_module.rst | 14 -- docs/vmware.vmware_rest.vcenter_vm_module.rst | 14 -- docs/vmware.vmware_rest.vm_moid_lookup.rst | 23 ++- meta/runtime.yml | 137 +++++++++++++++++- plugins/lookup/cluster_moid.py | 2 +- plugins/lookup/datacenter_moid.py | 2 +- plugins/lookup/datastore_moid.py | 2 +- plugins/lookup/folder_moid.py | 2 +- plugins/lookup/host_moid.py | 2 +- plugins/lookup/network_moid.py | 2 +- plugins/lookup/resource_pool_moid.py | 2 +- plugins/lookup/vm_moid.py | 2 +- .../modules/appliance_access_consolecli.py | 1 - .../appliance_access_consolecli_info.py | 1 - plugins/modules/appliance_access_dcui.py | 1 - plugins/modules/appliance_access_dcui_info.py | 1 - plugins/modules/appliance_access_shell.py | 1 - .../modules/appliance_access_shell_info.py | 1 - plugins/modules/appliance_access_ssh.py | 1 - plugins/modules/appliance_access_ssh_info.py | 1 - .../modules/appliance_health_applmgmt_info.py | 1 - .../modules/appliance_health_database_info.py | 1 - .../appliance_health_databasestorage_info.py | 1 - plugins/modules/appliance_health_load_info.py | 1 - plugins/modules/appliance_health_mem_info.py | 1 - .../appliance_health_softwarepackages_info.py | 1 - .../modules/appliance_health_storage_info.py | 1 - plugins/modules/appliance_health_swap_info.py | 1 - .../modules/appliance_health_system_info.py | 1 - .../modules/appliance_infraprofile_configs.py | 1 - .../appliance_infraprofile_configs_info.py | 1 - .../appliance_localaccounts_globalpolicy.py | 1 - ...pliance_localaccounts_globalpolicy_info.py | 1 - .../modules/appliance_localaccounts_info.py | 1 - plugins/modules/appliance_monitoring_info.py | 1 - plugins/modules/appliance_monitoring_query.py | 1 - plugins/modules/appliance_networking.py | 1 - .../appliance_networking_dns_domains.py | 3 +- .../appliance_networking_dns_domains_info.py | 1 - .../appliance_networking_dns_hostname.py | 3 +- .../appliance_networking_dns_hostname_info.py | 1 - .../appliance_networking_dns_servers.py | 5 +- .../appliance_networking_dns_servers_info.py | 1 - .../appliance_networking_firewall_inbound.py | 1 - ...liance_networking_firewall_inbound_info.py | 1 - plugins/modules/appliance_networking_info.py | 1 - .../appliance_networking_interfaces_info.py | 1 - .../appliance_networking_interfaces_ipv4.py | 1 - ...pliance_networking_interfaces_ipv4_info.py | 1 - .../appliance_networking_interfaces_ipv6.py | 1 - ...pliance_networking_interfaces_ipv6_info.py | 1 - .../modules/appliance_networking_noproxy.py | 1 - .../appliance_networking_noproxy_info.py | 1 - plugins/modules/appliance_networking_proxy.py | 13 +- .../appliance_networking_proxy_info.py | 1 - plugins/modules/appliance_ntp.py | 3 +- plugins/modules/appliance_ntp_info.py | 1 - plugins/modules/appliance_services.py | 3 +- plugins/modules/appliance_services_info.py | 1 - plugins/modules/appliance_shutdown.py | 3 +- plugins/modules/appliance_shutdown_info.py | 1 - .../modules/appliance_system_globalfips.py | 1 - .../appliance_system_globalfips_info.py | 1 - plugins/modules/appliance_system_storage.py | 3 +- .../modules/appliance_system_storage_info.py | 1 - plugins/modules/appliance_system_time_info.py | 1 - .../modules/appliance_system_time_timezone.py | 1 - .../appliance_system_time_timezone_info.py | 1 - .../modules/appliance_system_version_info.py | 1 - plugins/modules/appliance_timesync.py | 1 - plugins/modules/appliance_timesync_info.py | 1 - plugins/modules/appliance_update_info.py | 1 - plugins/modules/appliance_vmon_service.py | 5 +- .../modules/appliance_vmon_service_info.py | 1 - plugins/modules/content_configuration.py | 1 - plugins/modules/content_configuration_info.py | 1 - plugins/modules/content_library_item_info.py | 1 - plugins/modules/content_locallibrary.py | 13 +- plugins/modules/content_locallibrary_info.py | 1 - plugins/modules/content_subscribedlibrary.py | 21 ++- .../modules/content_subscribedlibrary_info.py | 1 - plugins/modules/vcenter_cluster_info.py | 1 - plugins/modules/vcenter_datacenter.py | 12 +- plugins/modules/vcenter_datacenter_info.py | 1 - plugins/modules/vcenter_datastore_info.py | 1 - plugins/modules/vcenter_folder_info.py | 1 - plugins/modules/vcenter_host.py | 14 +- plugins/modules/vcenter_host_info.py | 1 - plugins/modules/vcenter_network_info.py | 1 - plugins/modules/vcenter_ovf_libraryitem.py | 11 +- plugins/modules/vcenter_resourcepool.py | 12 +- plugins/modules/vcenter_resourcepool_info.py | 1 - .../modules/vcenter_storage_policies_info.py | 1 - plugins/modules/vcenter_vm.py | 62 ++++---- .../modules/vcenter_vm_guest_customization.py | 1 - ...vcenter_vm_guest_filesystem_directories.py | 19 ++- .../modules/vcenter_vm_guest_identity_info.py | 1 - .../vcenter_vm_guest_localfilesystem_info.py | 1 - .../vcenter_vm_guest_networking_info.py | 1 - ...ter_vm_guest_networking_interfaces_info.py | 1 - ...vcenter_vm_guest_networking_routes_info.py | 1 - .../vcenter_vm_guest_operations_info.py | 1 - plugins/modules/vcenter_vm_guest_power.py | 3 +- .../modules/vcenter_vm_guest_power_info.py | 1 - plugins/modules/vcenter_vm_hardware.py | 1 - .../vcenter_vm_hardware_adapter_sata.py | 12 +- .../vcenter_vm_hardware_adapter_sata_info.py | 1 - .../vcenter_vm_hardware_adapter_scsi.py | 12 +- .../vcenter_vm_hardware_adapter_scsi_info.py | 1 - plugins/modules/vcenter_vm_hardware_boot.py | 1 - .../vcenter_vm_hardware_boot_device.py | 1 - .../vcenter_vm_hardware_boot_device_info.py | 1 - .../modules/vcenter_vm_hardware_boot_info.py | 1 - plugins/modules/vcenter_vm_hardware_cdrom.py | 30 ++-- .../modules/vcenter_vm_hardware_cdrom_info.py | 1 - plugins/modules/vcenter_vm_hardware_cpu.py | 1 - .../modules/vcenter_vm_hardware_cpu_info.py | 1 - plugins/modules/vcenter_vm_hardware_disk.py | 12 +- .../modules/vcenter_vm_hardware_disk_info.py | 1 - .../modules/vcenter_vm_hardware_ethernet.py | 28 ++-- .../vcenter_vm_hardware_ethernet_info.py | 1 - plugins/modules/vcenter_vm_hardware_floppy.py | 24 ++- .../vcenter_vm_hardware_floppy_info.py | 1 - plugins/modules/vcenter_vm_hardware_info.py | 1 - plugins/modules/vcenter_vm_hardware_memory.py | 1 - .../vcenter_vm_hardware_memory_info.py | 1 - .../modules/vcenter_vm_hardware_parallel.py | 24 ++- .../vcenter_vm_hardware_parallel_info.py | 1 - plugins/modules/vcenter_vm_hardware_serial.py | 24 ++- .../vcenter_vm_hardware_serial_info.py | 1 - plugins/modules/vcenter_vm_info.py | 1 - .../modules/vcenter_vm_libraryitem_info.py | 1 - plugins/modules/vcenter_vm_power.py | 5 +- plugins/modules/vcenter_vm_power_info.py | 1 - plugins/modules/vcenter_vm_storage_policy.py | 1 - .../vcenter_vm_storage_policy_compliance.py | 1 - ...enter_vm_storage_policy_compliance_info.py | 1 - .../modules/vcenter_vm_storage_policy_info.py | 1 - plugins/modules/vcenter_vm_tools.py | 1 - plugins/modules/vcenter_vm_tools_info.py | 1 - plugins/modules/vcenter_vm_tools_installer.py | 3 +- .../vcenter_vm_tools_installer_info.py | 1 - .../vcenter_vmtemplate_libraryitems.py | 19 ++- .../vcenter_vmtemplate_libraryitems_info.py | 1 - 157 files changed, 431 insertions(+), 488 deletions(-) delete mode 100644 changelogs/fragments/20240105-bugfix-lookup-options-parsing.yml delete mode 100644 changelogs/fragments/20240305-network-moid-docs-update.yml delete mode 100644 changelogs/fragments/463_fix_library_url.yaml diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 590bf645c..01532c8e9 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,26 @@ vmware.vmware_rest Release Notes .. contents:: Topics +v3.0.1 +====== + +Release Summary +---------------- + +This release brings some minor changes and bugfixes. + +Minor Changes +------------- + +- Add requires_ansible to manifest (https://github.com/ansible-community/ansible.content_builder/pull/76). +- Generate action_groups for the vmware.vmware_rest collection (https://github.com/ansible-community/ansible.content_builder/issues/75). +- Use folder attribute for host and dc module only (https://github.com/ansible-community/ansible.content_builder/pull/79). + +Bugfixes +-------- + +- content_library_item_info - fixed error with unsupported property +- lookup plugins - Refactor to use native options configuration via doc_fragment, which ensures that vcenter_validate_certs=false is honored (https://github.com/ansible-collections/vmware.vmware_rest/issues/425). v3.0.0 ====== diff --git a/README.md b/README.md index fe0f995c2..b8d732a62 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ The collection depends on ``aiohttp`` has [requirement](https://docs.aiohttp.org ## vSphere compatibility -The 2.0.0 version of this collection requires vSphere 7.0.2 or greater. +The 3.0.0 version of this collection requires vSphere 7.0.3 or greater. ## Known limitations diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index 1be6aeb75..f9cc57c8d 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -671,3 +671,20 @@ releases: - start_gha_4_sanity_tests.yaml - use_7.0.3_spec.yaml release_date: '2023-11-27' + 3.0.1: + changes: + bugfixes: + - content_library_item_info - fixed error with unsupported property + - lookup plugins - Refactor to use native options configuration via doc_fragment, + which ensures that vcenter_validate_certs=false is honored (https://github.com/ansible-collections/vmware.vmware_rest/issues/425). + minor_changes: + - Add requires_ansible to manifest (https://github.com/ansible-community/ansible.content_builder/pull/76). + - Generate action_groups for the vmware.vmware_rest collection (https://github.com/ansible-community/ansible.content_builder/issues/75). + - Use folder attribute for host and dc module only (https://github.com/ansible-community/ansible.content_builder/pull/79). + fragments: + - 20240105-bugfix-lookup-options-parsing.yml + - 20240305-network-moid-docs-update.yml + - 463_fix_library_url.yaml + - 75-vmware_rest-action_groups.yaml + - 76-vmware_rest-dont_use_folder.yaml + release_date: '2024-03-21' diff --git a/changelogs/fragments/20240105-bugfix-lookup-options-parsing.yml b/changelogs/fragments/20240105-bugfix-lookup-options-parsing.yml deleted file mode 100644 index 200fbc376..000000000 --- a/changelogs/fragments/20240105-bugfix-lookup-options-parsing.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -bugfixes: - - lookup plugins - Refactor to use native options configuration via doc_fragment, which ensures that vcenter_validate_certs=false is honored - (https://github.com/ansible-collections/vmware.vmware_rest/issues/425). diff --git a/changelogs/fragments/20240305-network-moid-docs-update.yml b/changelogs/fragments/20240305-network-moid-docs-update.yml deleted file mode 100644 index db1062956..000000000 --- a/changelogs/fragments/20240305-network-moid-docs-update.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -trivial: - - network_moid lookup - Update docs to reflect unique network name requirement (https://github.com/ansible-collections/vmware.vmware_rest/issues/467). diff --git a/changelogs/fragments/463_fix_library_url.yaml b/changelogs/fragments/463_fix_library_url.yaml deleted file mode 100644 index 99252692c..000000000 --- a/changelogs/fragments/463_fix_library_url.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -bugfixes: - - "content_library_item_info - fixed error with unsupported property" diff --git a/docs/vmware.vmware_rest.cluster_moid_lookup.rst b/docs/vmware.vmware_rest.cluster_moid_lookup.rst index c706e3d76..1af5dd5c5 100644 --- a/docs/vmware.vmware_rest.cluster_moid_lookup.rst +++ b/docs/vmware.vmware_rest.cluster_moid_lookup.rst @@ -48,7 +48,7 @@ Parameters _terms
- - + string / required
@@ -73,10 +73,10 @@ Parameters +
env:VMWARE_HOST
The hostname or IP address of the vSphere vCenter.
-
If the value is not specified in the task, the value of environment variable VMWARE_HOST will be used instead.
@@ -92,10 +92,10 @@ Parameters +
env:VMWARE_PASSWORD
The vSphere vCenter password.
-
If the value is not specified in the task, the value of environment variable VMWARE_PASSWORD will be used instead.
@@ -110,12 +110,12 @@ Parameters +
env:VMWARE_REST_LOG_FILE
You can use this optional parameter to set the location of a log file.
-
This file will be used to record the HTTP REST interaction.
-
The file will be stored on the host that run the module.
-
If the value is not specified in the task, the value of environment variable VMWARE_REST_LOG_FILE will be used instead.
+
This file will be used to record the HTTP REST interactions.
+
The file will be stored on the host that runs the module.
@@ -131,10 +131,10 @@ Parameters +
env:VMWARE_USER
The vSphere vCenter username.
-
If the value is not specified in the task, the value of environment variable VMWARE_USER will be used instead.
@@ -147,16 +147,13 @@ Parameters - + Default:
"yes"
+
env:VMWARE_VALIDATE_CERTS
-
Allows connection when SSL certificates are not valid. Set to false when certificates are not trusted.
-
If the value is not specified in the task, the value of environment variable VMWARE_VALIDATE_CERTS will be used instead.
+
Allows connection when SSL certificates are not valid. Set to V(false) when certificates are not trusted.
diff --git a/docs/vmware.vmware_rest.datacenter_moid_lookup.rst b/docs/vmware.vmware_rest.datacenter_moid_lookup.rst index 122bca9ed..4291b22cb 100644 --- a/docs/vmware.vmware_rest.datacenter_moid_lookup.rst +++ b/docs/vmware.vmware_rest.datacenter_moid_lookup.rst @@ -48,7 +48,7 @@ Parameters _terms
- - + string / required
@@ -73,10 +73,10 @@ Parameters +
env:VMWARE_HOST
The hostname or IP address of the vSphere vCenter.
-
If the value is not specified in the task, the value of environment variable VMWARE_HOST will be used instead.
@@ -92,10 +92,10 @@ Parameters +
env:VMWARE_PASSWORD
The vSphere vCenter password.
-
If the value is not specified in the task, the value of environment variable VMWARE_PASSWORD will be used instead.
@@ -110,12 +110,12 @@ Parameters +
env:VMWARE_REST_LOG_FILE
You can use this optional parameter to set the location of a log file.
-
This file will be used to record the HTTP REST interaction.
-
The file will be stored on the host that run the module.
-
If the value is not specified in the task, the value of environment variable VMWARE_REST_LOG_FILE will be used instead.
+
This file will be used to record the HTTP REST interactions.
+
The file will be stored on the host that runs the module.
@@ -131,10 +131,10 @@ Parameters +
env:VMWARE_USER
The vSphere vCenter username.
-
If the value is not specified in the task, the value of environment variable VMWARE_USER will be used instead.
@@ -147,16 +147,13 @@ Parameters - + Default:
"yes"
+
env:VMWARE_VALIDATE_CERTS
-
Allows connection when SSL certificates are not valid. Set to false when certificates are not trusted.
-
If the value is not specified in the task, the value of environment variable VMWARE_VALIDATE_CERTS will be used instead.
+
Allows connection when SSL certificates are not valid. Set to V(false) when certificates are not trusted.
diff --git a/docs/vmware.vmware_rest.datastore_moid_lookup.rst b/docs/vmware.vmware_rest.datastore_moid_lookup.rst index cdd04ae4b..c390bc466 100644 --- a/docs/vmware.vmware_rest.datastore_moid_lookup.rst +++ b/docs/vmware.vmware_rest.datastore_moid_lookup.rst @@ -48,7 +48,7 @@ Parameters _terms
- - + string / required
@@ -73,10 +73,10 @@ Parameters +
env:VMWARE_HOST
The hostname or IP address of the vSphere vCenter.
-
If the value is not specified in the task, the value of environment variable VMWARE_HOST will be used instead.
@@ -92,10 +92,10 @@ Parameters +
env:VMWARE_PASSWORD
The vSphere vCenter password.
-
If the value is not specified in the task, the value of environment variable VMWARE_PASSWORD will be used instead.
@@ -110,12 +110,12 @@ Parameters +
env:VMWARE_REST_LOG_FILE
You can use this optional parameter to set the location of a log file.
-
This file will be used to record the HTTP REST interaction.
-
The file will be stored on the host that run the module.
-
If the value is not specified in the task, the value of environment variable VMWARE_REST_LOG_FILE will be used instead.
+
This file will be used to record the HTTP REST interactions.
+
The file will be stored on the host that runs the module.
@@ -131,10 +131,10 @@ Parameters +
env:VMWARE_USER
The vSphere vCenter username.
-
If the value is not specified in the task, the value of environment variable VMWARE_USER will be used instead.
@@ -147,16 +147,13 @@ Parameters - + Default:
"yes"
+
env:VMWARE_VALIDATE_CERTS
-
Allows connection when SSL certificates are not valid. Set to false when certificates are not trusted.
-
If the value is not specified in the task, the value of environment variable VMWARE_VALIDATE_CERTS will be used instead.
+
Allows connection when SSL certificates are not valid. Set to V(false) when certificates are not trusted.
diff --git a/docs/vmware.vmware_rest.folder_moid_lookup.rst b/docs/vmware.vmware_rest.folder_moid_lookup.rst index 6dbf99e4f..4bafe0066 100644 --- a/docs/vmware.vmware_rest.folder_moid_lookup.rst +++ b/docs/vmware.vmware_rest.folder_moid_lookup.rst @@ -48,7 +48,7 @@ Parameters _terms
- - + string / required
@@ -73,10 +73,10 @@ Parameters +
env:VMWARE_HOST
The hostname or IP address of the vSphere vCenter.
-
If the value is not specified in the task, the value of environment variable VMWARE_HOST will be used instead.
@@ -92,10 +92,10 @@ Parameters +
env:VMWARE_PASSWORD
The vSphere vCenter password.
-
If the value is not specified in the task, the value of environment variable VMWARE_PASSWORD will be used instead.
@@ -110,12 +110,12 @@ Parameters +
env:VMWARE_REST_LOG_FILE
You can use this optional parameter to set the location of a log file.
-
This file will be used to record the HTTP REST interaction.
-
The file will be stored on the host that run the module.
-
If the value is not specified in the task, the value of environment variable VMWARE_REST_LOG_FILE will be used instead.
+
This file will be used to record the HTTP REST interactions.
+
The file will be stored on the host that runs the module.
@@ -131,10 +131,10 @@ Parameters +
env:VMWARE_USER
The vSphere vCenter username.
-
If the value is not specified in the task, the value of environment variable VMWARE_USER will be used instead.
@@ -147,16 +147,13 @@ Parameters - + Default:
"yes"
+
env:VMWARE_VALIDATE_CERTS
-
Allows connection when SSL certificates are not valid. Set to false when certificates are not trusted.
-
If the value is not specified in the task, the value of environment variable VMWARE_VALIDATE_CERTS will be used instead.
+
Allows connection when SSL certificates are not valid. Set to V(false) when certificates are not trusted.
diff --git a/docs/vmware.vmware_rest.host_moid_lookup.rst b/docs/vmware.vmware_rest.host_moid_lookup.rst index d95332d1f..9db9d8523 100644 --- a/docs/vmware.vmware_rest.host_moid_lookup.rst +++ b/docs/vmware.vmware_rest.host_moid_lookup.rst @@ -48,7 +48,7 @@ Parameters _terms
- - + string / required
@@ -73,10 +73,10 @@ Parameters +
env:VMWARE_HOST
The hostname or IP address of the vSphere vCenter.
-
If the value is not specified in the task, the value of environment variable VMWARE_HOST will be used instead.
@@ -92,10 +92,10 @@ Parameters +
env:VMWARE_PASSWORD
The vSphere vCenter password.
-
If the value is not specified in the task, the value of environment variable VMWARE_PASSWORD will be used instead.
@@ -110,12 +110,12 @@ Parameters +
env:VMWARE_REST_LOG_FILE
You can use this optional parameter to set the location of a log file.
-
This file will be used to record the HTTP REST interaction.
-
The file will be stored on the host that run the module.
-
If the value is not specified in the task, the value of environment variable VMWARE_REST_LOG_FILE will be used instead.
+
This file will be used to record the HTTP REST interactions.
+
The file will be stored on the host that runs the module.
@@ -131,10 +131,10 @@ Parameters +
env:VMWARE_USER
The vSphere vCenter username.
-
If the value is not specified in the task, the value of environment variable VMWARE_USER will be used instead.
@@ -147,16 +147,13 @@ Parameters - + Default:
"yes"
+
env:VMWARE_VALIDATE_CERTS
-
Allows connection when SSL certificates are not valid. Set to false when certificates are not trusted.
-
If the value is not specified in the task, the value of environment variable VMWARE_VALIDATE_CERTS will be used instead.
+
Allows connection when SSL certificates are not valid. Set to V(false) when certificates are not trusted.
diff --git a/docs/vmware.vmware_rest.network_moid_lookup.rst b/docs/vmware.vmware_rest.network_moid_lookup.rst index af0d35175..2e7340705 100644 --- a/docs/vmware.vmware_rest.network_moid_lookup.rst +++ b/docs/vmware.vmware_rest.network_moid_lookup.rst @@ -18,6 +18,7 @@ Version added: 2.1.0 Synopsis -------- - Returns Managed Object Reference (MoID) of the vSphere network object contained in the specified path. +- This lookup cannot distinguish between multiple networks with the same name defined in multiple switches as that is not supported by the vSphere REST API; network names must be unique within a given datacenter/folder path. @@ -48,7 +49,7 @@ Parameters _terms
- - + string / required
@@ -73,10 +74,10 @@ Parameters +
env:VMWARE_HOST
The hostname or IP address of the vSphere vCenter.
-
If the value is not specified in the task, the value of environment variable VMWARE_HOST will be used instead.
@@ -92,10 +93,10 @@ Parameters +
env:VMWARE_PASSWORD
The vSphere vCenter password.
-
If the value is not specified in the task, the value of environment variable VMWARE_PASSWORD will be used instead.
@@ -110,12 +111,12 @@ Parameters +
env:VMWARE_REST_LOG_FILE
You can use this optional parameter to set the location of a log file.
-
This file will be used to record the HTTP REST interaction.
-
The file will be stored on the host that run the module.
-
If the value is not specified in the task, the value of environment variable VMWARE_REST_LOG_FILE will be used instead.
+
This file will be used to record the HTTP REST interactions.
+
The file will be stored on the host that runs the module.
@@ -131,10 +132,10 @@ Parameters +
env:VMWARE_USER
The vSphere vCenter username.
-
If the value is not specified in the task, the value of environment variable VMWARE_USER will be used instead.
@@ -147,16 +148,13 @@ Parameters - + Default:
"yes"
+
env:VMWARE_VALIDATE_CERTS
-
Allows connection when SSL certificates are not valid. Set to false when certificates are not trusted.
-
If the value is not specified in the task, the value of environment variable VMWARE_VALIDATE_CERTS will be used instead.
+
Allows connection when SSL certificates are not valid. Set to V(false) when certificates are not trusted.
diff --git a/docs/vmware.vmware_rest.resource_pool_moid_lookup.rst b/docs/vmware.vmware_rest.resource_pool_moid_lookup.rst index 006edcd9d..6267c69ad 100644 --- a/docs/vmware.vmware_rest.resource_pool_moid_lookup.rst +++ b/docs/vmware.vmware_rest.resource_pool_moid_lookup.rst @@ -48,7 +48,7 @@ Parameters _terms
- - + string / required
@@ -73,10 +73,10 @@ Parameters +
env:VMWARE_HOST
The hostname or IP address of the vSphere vCenter.
-
If the value is not specified in the task, the value of environment variable VMWARE_HOST will be used instead.
@@ -92,10 +92,10 @@ Parameters +
env:VMWARE_PASSWORD
The vSphere vCenter password.
-
If the value is not specified in the task, the value of environment variable VMWARE_PASSWORD will be used instead.
@@ -110,12 +110,12 @@ Parameters +
env:VMWARE_REST_LOG_FILE
You can use this optional parameter to set the location of a log file.
-
This file will be used to record the HTTP REST interaction.
-
The file will be stored on the host that run the module.
-
If the value is not specified in the task, the value of environment variable VMWARE_REST_LOG_FILE will be used instead.
+
This file will be used to record the HTTP REST interactions.
+
The file will be stored on the host that runs the module.
@@ -131,10 +131,10 @@ Parameters +
env:VMWARE_USER
The vSphere vCenter username.
-
If the value is not specified in the task, the value of environment variable VMWARE_USER will be used instead.
@@ -147,16 +147,13 @@ Parameters - + Default:
"yes"
+
env:VMWARE_VALIDATE_CERTS
-
Allows connection when SSL certificates are not valid. Set to false when certificates are not trusted.
-
If the value is not specified in the task, the value of environment variable VMWARE_VALIDATE_CERTS will be used instead.
+
Allows connection when SSL certificates are not valid. Set to V(false) when certificates are not trusted.
diff --git a/docs/vmware.vmware_rest.vcenter_vm_hardware_ethernet_module.rst b/docs/vmware.vmware_rest.vcenter_vm_hardware_ethernet_module.rst index 48054ae87..dc7bb1bfc 100644 --- a/docs/vmware.vmware_rest.vcenter_vm_hardware_ethernet_module.rst +++ b/docs/vmware.vmware_rest.vcenter_vm_hardware_ethernet_module.rst @@ -512,20 +512,6 @@ Common return values are documented `here Returned Description - - -
- content generated by the update_return_section callback# task - -
- - -
- - - -
- -
diff --git a/docs/vmware.vmware_rest.vcenter_vm_module.rst b/docs/vmware.vmware_rest.vcenter_vm_module.rst index 6612d5487..3911f62d6 100644 --- a/docs/vmware.vmware_rest.vcenter_vm_module.rst +++ b/docs/vmware.vmware_rest.vcenter_vm_module.rst @@ -1397,20 +1397,6 @@ Common return values are documented `here Returned Description - - -
- content generated by the update_return_section callback# task - -
- - -
- - - -
- -
diff --git a/docs/vmware.vmware_rest.vm_moid_lookup.rst b/docs/vmware.vmware_rest.vm_moid_lookup.rst index 252d64d2e..1a5904c88 100644 --- a/docs/vmware.vmware_rest.vm_moid_lookup.rst +++ b/docs/vmware.vmware_rest.vm_moid_lookup.rst @@ -48,7 +48,7 @@ Parameters _terms
- - + string / required
@@ -73,10 +73,10 @@ Parameters +
env:VMWARE_HOST
The hostname or IP address of the vSphere vCenter.
-
If the value is not specified in the task, the value of environment variable VMWARE_HOST will be used instead.
@@ -92,10 +92,10 @@ Parameters +
env:VMWARE_PASSWORD
The vSphere vCenter password.
-
If the value is not specified in the task, the value of environment variable VMWARE_PASSWORD will be used instead.
@@ -110,12 +110,12 @@ Parameters +
env:VMWARE_REST_LOG_FILE
You can use this optional parameter to set the location of a log file.
-
This file will be used to record the HTTP REST interaction.
-
The file will be stored on the host that run the module.
-
If the value is not specified in the task, the value of environment variable VMWARE_REST_LOG_FILE will be used instead.
+
This file will be used to record the HTTP REST interactions.
+
The file will be stored on the host that runs the module.
@@ -131,10 +131,10 @@ Parameters +
env:VMWARE_USER
The vSphere vCenter username.
-
If the value is not specified in the task, the value of environment variable VMWARE_USER will be used instead.
@@ -147,16 +147,13 @@ Parameters -
    Choices: -
  • no
  • -
  • yes ←
  • -
+ Default:
"yes"
+
env:VMWARE_VALIDATE_CERTS
-
Allows connection when SSL certificates are not valid. Set to false when certificates are not trusted.
-
If the value is not specified in the task, the value of environment variable VMWARE_VALIDATE_CERTS will be used instead.
+
Allows connection when SSL certificates are not valid. Set to V(false) when certificates are not trusted.
diff --git a/meta/runtime.yml b/meta/runtime.yml index ce6befd7b..b1fd5d786 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -1,2 +1,135 @@ ---- -requires_ansible: ">=2.14.0" +requires_ansible: '>=2.14.0' +action_groups: + vmware_rest: + - vcenter_cluster_info + - vcenter_datacenter_info + - vcenter_datacenter + - vcenter_datastore_info + - vcenter_folder_info + - vcenter_host_info + - vcenter_host + - vcenter_network_info + - vcenter_ovf_libraryitem + - vcenter_resourcepool_info + - vcenter_resourcepool + - vcenter_storage_policies_info + - vcenter_vm_info + - vcenter_vm + - vcenter_vmtemplate_libraryitems_info + - vcenter_vmtemplate_libraryitems + - vcenter_vm_guest_customization + - vcenter_vm_guest_filesystem_directories + - vcenter_vm_guest_identity_info + - vcenter_vm_guest_localfilesystem_info + - vcenter_vm_guest_networking_info + - vcenter_vm_guest_networking_interfaces_info + - vcenter_vm_guest_networking_routes_info + - vcenter_vm_guest_operations_info + - vcenter_vm_guest_power_info + - vcenter_vm_guest_power + - vcenter_vm_hardware_info + - vcenter_vm_hardware + - vcenter_vm_hardware_adapter_sata_info + - vcenter_vm_hardware_adapter_sata + - vcenter_vm_hardware_adapter_scsi_info + - vcenter_vm_hardware_adapter_scsi + - vcenter_vm_hardware_boot_info + - vcenter_vm_hardware_boot + - vcenter_vm_hardware_boot_device_info + - vcenter_vm_hardware_boot_device + - vcenter_vm_hardware_cdrom_info + - vcenter_vm_hardware_cdrom + - vcenter_vm_hardware_cpu_info + - vcenter_vm_hardware_cpu + - vcenter_vm_hardware_disk_info + - vcenter_vm_hardware_disk + - vcenter_vm_hardware_ethernet_info + - vcenter_vm_hardware_ethernet + - vcenter_vm_hardware_floppy_info + - vcenter_vm_hardware_floppy + - vcenter_vm_hardware_memory_info + - vcenter_vm_hardware_memory + - vcenter_vm_hardware_parallel_info + - vcenter_vm_hardware_parallel + - vcenter_vm_hardware_serial_info + - vcenter_vm_hardware_serial + - vcenter_vm_libraryitem_info + - vcenter_vm_power_info + - vcenter_vm_power + - vcenter_vm_storage_policy_info + - vcenter_vm_storage_policy + - vcenter_vm_storage_policy_compliance_info + - vcenter_vm_storage_policy_compliance + - vcenter_vm_tools_info + - vcenter_vm_tools + - vcenter_vm_tools_installer_info + - vcenter_vm_tools_installer + - content_configuration_info + - content_configuration + - content_library_item_info + - content_locallibrary_info + - content_locallibrary + - content_subscribedlibrary_info + - content_subscribedlibrary + - appliance_access_consolecli_info + - appliance_access_consolecli + - appliance_access_dcui_info + - appliance_access_dcui + - appliance_access_shell_info + - appliance_access_shell + - appliance_access_ssh_info + - appliance_access_ssh + - appliance_health_applmgmt_info + - appliance_health_database_info + - appliance_health_databasestorage_info + - appliance_health_load_info + - appliance_health_mem_info + - appliance_health_softwarepackages_info + - appliance_health_storage_info + - appliance_health_swap_info + - appliance_health_system_info + - appliance_infraprofile_configs_info + - appliance_infraprofile_configs + - appliance_localaccounts_info + - appliance_localaccounts_globalpolicy_info + - appliance_localaccounts_globalpolicy + - appliance_monitoring_info + - appliance_monitoring_query + - appliance_networking_info + - appliance_networking + - appliance_networking_dns_domains_info + - appliance_networking_dns_domains + - appliance_networking_dns_hostname_info + - appliance_networking_dns_hostname + - appliance_networking_dns_servers_info + - appliance_networking_dns_servers + - appliance_networking_firewall_inbound_info + - appliance_networking_firewall_inbound + - appliance_networking_interfaces_info + - appliance_networking_interfaces_ipv4_info + - appliance_networking_interfaces_ipv4 + - appliance_networking_interfaces_ipv6_info + - appliance_networking_interfaces_ipv6 + - appliance_networking_noproxy_info + - appliance_networking_noproxy + - appliance_networking_proxy_info + - appliance_networking_proxy + - appliance_ntp_info + - appliance_ntp + - appliance_services_info + - appliance_services + - appliance_shutdown_info + - appliance_shutdown + - appliance_system_globalfips_info + - appliance_system_globalfips + - appliance_system_storage_info + - appliance_system_storage + - appliance_system_time_info + - appliance_system_time_timezone_info + - appliance_system_time_timezone + - appliance_system_version_info + - appliance_timesync_info + - appliance_timesync + - appliance_update_info + - appliance_vmon_service_info + - appliance_vmon_service diff --git a/plugins/lookup/cluster_moid.py b/plugins/lookup/cluster_moid.py index 9b0d7b5ed..474af1d4c 100644 --- a/plugins/lookup/cluster_moid.py +++ b/plugins/lookup/cluster_moid.py @@ -16,7 +16,7 @@ - Alina Buzachis (@alinabuzachis) version_added: 2.1.0 requirements: - - vSphere 7.0.2 or greater + - vSphere 7.0.3 or greater - python >= 3.6 - aiohttp extends_documentation_fragment: diff --git a/plugins/lookup/datacenter_moid.py b/plugins/lookup/datacenter_moid.py index db7102b8e..f80e1a683 100644 --- a/plugins/lookup/datacenter_moid.py +++ b/plugins/lookup/datacenter_moid.py @@ -16,7 +16,7 @@ - Alina Buzachis (@alinabuzachis) version_added: 2.1.0 requirements: - - vSphere 7.0.2 or greater + - vSphere 7.0.3 or greater - python >= 3.6 - aiohttp extends_documentation_fragment: diff --git a/plugins/lookup/datastore_moid.py b/plugins/lookup/datastore_moid.py index d245b7001..02a0e0940 100644 --- a/plugins/lookup/datastore_moid.py +++ b/plugins/lookup/datastore_moid.py @@ -16,7 +16,7 @@ - Alina Buzachis (@alinabuzachis) version_added: 2.1.0 requirements: - - vSphere 7.0.2 or greater + - vSphere 7.0.3 or greater - python >= 3.6 - aiohttp extends_documentation_fragment: diff --git a/plugins/lookup/folder_moid.py b/plugins/lookup/folder_moid.py index d747af108..7d9d2476b 100644 --- a/plugins/lookup/folder_moid.py +++ b/plugins/lookup/folder_moid.py @@ -16,7 +16,7 @@ - Alina Buzachis (@alinabuzachis) version_added: 2.1.0 requirements: - - vSphere 7.0.2 or greater + - vSphere 7.0.3 or greater - python >= 3.6 - aiohttp extends_documentation_fragment: diff --git a/plugins/lookup/host_moid.py b/plugins/lookup/host_moid.py index 431bee21d..b9fe89032 100644 --- a/plugins/lookup/host_moid.py +++ b/plugins/lookup/host_moid.py @@ -16,7 +16,7 @@ - Alina Buzachis (@alinabuzachis) version_added: 2.1.0 requirements: - - vSphere 7.0.2 or greater + - vSphere 7.0.3 or greater - python >= 3.6 - aiohttp extends_documentation_fragment: diff --git a/plugins/lookup/network_moid.py b/plugins/lookup/network_moid.py index b31d40e04..7047a13be 100644 --- a/plugins/lookup/network_moid.py +++ b/plugins/lookup/network_moid.py @@ -18,7 +18,7 @@ - Alina Buzachis (@alinabuzachis) version_added: 2.1.0 requirements: - - vSphere 7.0.2 or greater + - vSphere 7.0.3 or greater - python >= 3.6 - aiohttp extends_documentation_fragment: diff --git a/plugins/lookup/resource_pool_moid.py b/plugins/lookup/resource_pool_moid.py index 0e17bf965..bd4f1adfa 100644 --- a/plugins/lookup/resource_pool_moid.py +++ b/plugins/lookup/resource_pool_moid.py @@ -16,7 +16,7 @@ - Alina Buzachis (@alinabuzachis) version_added: 2.1.0 requirements: - - vSphere 7.0.2 or greater + - vSphere 7.0.3 or greater - python >= 3.6 - aiohttp extends_documentation_fragment: diff --git a/plugins/lookup/vm_moid.py b/plugins/lookup/vm_moid.py index 800c2d7b0..4c49b8d0a 100644 --- a/plugins/lookup/vm_moid.py +++ b/plugins/lookup/vm_moid.py @@ -16,7 +16,7 @@ - Alina Buzachis (@alinabuzachis) version_added: 2.1.0 requirements: - - vSphere 7.0.2 or greater + - vSphere 7.0.3 or greater - python >= 3.6 - aiohttp extends_documentation_fragment: diff --git a/plugins/modules/appliance_access_consolecli.py b/plugins/modules/appliance_access_consolecli.py index a49fcab54..1c1a3eb10 100644 --- a/plugins/modules/appliance_access_consolecli.py +++ b/plugins/modules/appliance_access_consolecli.py @@ -112,7 +112,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/appliance_access_consolecli_info.py b/plugins/modules/appliance_access_consolecli_info.py index 1a3c82e70..a14c9672a 100644 --- a/plugins/modules/appliance_access_consolecli_info.py +++ b/plugins/modules/appliance_access_consolecli_info.py @@ -100,7 +100,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_access_dcui.py b/plugins/modules/appliance_access_dcui.py index 96e9af20b..1e5c26e0b 100644 --- a/plugins/modules/appliance_access_dcui.py +++ b/plugins/modules/appliance_access_dcui.py @@ -112,7 +112,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/appliance_access_dcui_info.py b/plugins/modules/appliance_access_dcui_info.py index 450bb7753..33d64ae48 100644 --- a/plugins/modules/appliance_access_dcui_info.py +++ b/plugins/modules/appliance_access_dcui_info.py @@ -100,7 +100,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_access_shell.py b/plugins/modules/appliance_access_shell.py index 6827e3ca1..5cc4377f1 100644 --- a/plugins/modules/appliance_access_shell.py +++ b/plugins/modules/appliance_access_shell.py @@ -133,7 +133,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/appliance_access_shell_info.py b/plugins/modules/appliance_access_shell_info.py index d32034de8..78cc1a29a 100644 --- a/plugins/modules/appliance_access_shell_info.py +++ b/plugins/modules/appliance_access_shell_info.py @@ -105,7 +105,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_access_ssh.py b/plugins/modules/appliance_access_ssh.py index 77e715ceb..85add817c 100644 --- a/plugins/modules/appliance_access_ssh.py +++ b/plugins/modules/appliance_access_ssh.py @@ -113,7 +113,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/appliance_access_ssh_info.py b/plugins/modules/appliance_access_ssh_info.py index 5b7b5d43c..debb75fd4 100644 --- a/plugins/modules/appliance_access_ssh_info.py +++ b/plugins/modules/appliance_access_ssh_info.py @@ -101,7 +101,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_health_applmgmt_info.py b/plugins/modules/appliance_health_applmgmt_info.py index 51617f534..ce822f432 100644 --- a/plugins/modules/appliance_health_applmgmt_info.py +++ b/plugins/modules/appliance_health_applmgmt_info.py @@ -101,7 +101,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_health_database_info.py b/plugins/modules/appliance_health_database_info.py index f0d9bacd4..2b6c5e41b 100644 --- a/plugins/modules/appliance_health_database_info.py +++ b/plugins/modules/appliance_health_database_info.py @@ -95,7 +95,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_health_databasestorage_info.py b/plugins/modules/appliance_health_databasestorage_info.py index ea21bb42f..c23c4b5cf 100644 --- a/plugins/modules/appliance_health_databasestorage_info.py +++ b/plugins/modules/appliance_health_databasestorage_info.py @@ -101,7 +101,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_health_load_info.py b/plugins/modules/appliance_health_load_info.py index ceda9ed91..a5f632627 100644 --- a/plugins/modules/appliance_health_load_info.py +++ b/plugins/modules/appliance_health_load_info.py @@ -101,7 +101,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_health_mem_info.py b/plugins/modules/appliance_health_mem_info.py index 1d4081cb3..4e02ed37b 100644 --- a/plugins/modules/appliance_health_mem_info.py +++ b/plugins/modules/appliance_health_mem_info.py @@ -102,7 +102,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_health_softwarepackages_info.py b/plugins/modules/appliance_health_softwarepackages_info.py index 6ab186c13..da749d9c6 100644 --- a/plugins/modules/appliance_health_softwarepackages_info.py +++ b/plugins/modules/appliance_health_softwarepackages_info.py @@ -106,7 +106,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_health_storage_info.py b/plugins/modules/appliance_health_storage_info.py index a816c9fee..d334c03e2 100644 --- a/plugins/modules/appliance_health_storage_info.py +++ b/plugins/modules/appliance_health_storage_info.py @@ -101,7 +101,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_health_swap_info.py b/plugins/modules/appliance_health_swap_info.py index eece47b99..ba7c51d40 100644 --- a/plugins/modules/appliance_health_swap_info.py +++ b/plugins/modules/appliance_health_swap_info.py @@ -101,7 +101,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_health_system_info.py b/plugins/modules/appliance_health_system_info.py index a1ff60715..2102647d2 100644 --- a/plugins/modules/appliance_health_system_info.py +++ b/plugins/modules/appliance_health_system_info.py @@ -101,7 +101,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_infraprofile_configs.py b/plugins/modules/appliance_infraprofile_configs.py index 2243ba68b..8c685fde6 100644 --- a/plugins/modules/appliance_infraprofile_configs.py +++ b/plugins/modules/appliance_infraprofile_configs.py @@ -147,7 +147,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/appliance_infraprofile_configs_info.py b/plugins/modules/appliance_infraprofile_configs_info.py index 64aa4e8b5..ae36681b4 100644 --- a/plugins/modules/appliance_infraprofile_configs_info.py +++ b/plugins/modules/appliance_infraprofile_configs_info.py @@ -107,7 +107,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_localaccounts_globalpolicy.py b/plugins/modules/appliance_localaccounts_globalpolicy.py index 9775b91c4..ee3fe2a1f 100644 --- a/plugins/modules/appliance_localaccounts_globalpolicy.py +++ b/plugins/modules/appliance_localaccounts_globalpolicy.py @@ -133,7 +133,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/appliance_localaccounts_globalpolicy_info.py b/plugins/modules/appliance_localaccounts_globalpolicy_info.py index 4de590440..6ae13879d 100644 --- a/plugins/modules/appliance_localaccounts_globalpolicy_info.py +++ b/plugins/modules/appliance_localaccounts_globalpolicy_info.py @@ -104,7 +104,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_localaccounts_info.py b/plugins/modules/appliance_localaccounts_info.py index 38194980b..a0ef2687b 100644 --- a/plugins/modules/appliance_localaccounts_info.py +++ b/plugins/modules/appliance_localaccounts_info.py @@ -134,7 +134,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" 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, diff --git a/plugins/modules/appliance_monitoring_info.py b/plugins/modules/appliance_monitoring_info.py index c8e48cffd..d554c1b34 100644 --- a/plugins/modules/appliance_monitoring_info.py +++ b/plugins/modules/appliance_monitoring_info.py @@ -930,7 +930,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" 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, diff --git a/plugins/modules/appliance_monitoring_query.py b/plugins/modules/appliance_monitoring_query.py index a435589e7..b9a7aea23 100644 --- a/plugins/modules/appliance_monitoring_query.py +++ b/plugins/modules/appliance_monitoring_query.py @@ -177,7 +177,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/appliance_networking.py b/plugins/modules/appliance_networking.py index dbff1d2c2..38e5c6c27 100644 --- a/plugins/modules/appliance_networking.py +++ b/plugins/modules/appliance_networking.py @@ -122,7 +122,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/appliance_networking_dns_domains.py b/plugins/modules/appliance_networking_dns_domains.py index 7ee164f43..accfb894d 100644 --- a/plugins/modules/appliance_networking_dns_domains.py +++ b/plugins/modules/appliance_networking_dns_domains.py @@ -109,8 +109,8 @@ # 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 from ansible.module_utils.basic import env_fallback @@ -126,7 +126,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/appliance_networking_dns_domains_info.py b/plugins/modules/appliance_networking_dns_domains_info.py index 862b5f144..32305e7cb 100644 --- a/plugins/modules/appliance_networking_dns_domains_info.py +++ b/plugins/modules/appliance_networking_dns_domains_info.py @@ -101,7 +101,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_networking_dns_hostname.py b/plugins/modules/appliance_networking_dns_hostname.py index 59819c40c..5278d94ea 100644 --- a/plugins/modules/appliance_networking_dns_hostname.py +++ b/plugins/modules/appliance_networking_dns_hostname.py @@ -103,8 +103,8 @@ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "set": {"query": {}, "body": {"name": "name"}, "path": {}}, "test": {"query": {}, "body": {"name": "name"}, "path": {}}, + "set": {"query": {}, "body": {"name": "name"}, "path": {}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -120,7 +120,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/appliance_networking_dns_hostname_info.py b/plugins/modules/appliance_networking_dns_hostname_info.py index 10f21230a..73d948fbc 100644 --- a/plugins/modules/appliance_networking_dns_hostname_info.py +++ b/plugins/modules/appliance_networking_dns_hostname_info.py @@ -101,7 +101,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_networking_dns_servers.py b/plugins/modules/appliance_networking_dns_servers.py index 5ca1e0a7e..4bee9ebdb 100644 --- a/plugins/modules/appliance_networking_dns_servers.py +++ b/plugins/modules/appliance_networking_dns_servers.py @@ -140,9 +140,9 @@ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "set": {"query": {}, "body": {"mode": "mode", "servers": "servers"}, "path": {}}, - "add": {"query": {}, "body": {"server": "server"}, "path": {}}, "test": {"query": {}, "body": {"servers": "servers"}, "path": {}}, + "add": {"query": {}, "body": {"server": "server"}, "path": {}}, + "set": {"query": {}, "body": {"mode": "mode", "servers": "servers"}, "path": {}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -158,7 +158,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/appliance_networking_dns_servers_info.py b/plugins/modules/appliance_networking_dns_servers_info.py index af846b38f..82b50b7f4 100644 --- a/plugins/modules/appliance_networking_dns_servers_info.py +++ b/plugins/modules/appliance_networking_dns_servers_info.py @@ -104,7 +104,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_networking_firewall_inbound.py b/plugins/modules/appliance_networking_firewall_inbound.py index 6d04e2ee3..b1eb55b16 100644 --- a/plugins/modules/appliance_networking_firewall_inbound.py +++ b/plugins/modules/appliance_networking_firewall_inbound.py @@ -150,7 +150,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/appliance_networking_firewall_inbound_info.py b/plugins/modules/appliance_networking_firewall_inbound_info.py index d736ab6d0..dbe5616c0 100644 --- a/plugins/modules/appliance_networking_firewall_inbound_info.py +++ b/plugins/modules/appliance_networking_firewall_inbound_info.py @@ -104,7 +104,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_networking_info.py b/plugins/modules/appliance_networking_info.py index 6fb2b669f..ebf11dd3f 100644 --- a/plugins/modules/appliance_networking_info.py +++ b/plugins/modules/appliance_networking_info.py @@ -128,7 +128,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_networking_interfaces_info.py b/plugins/modules/appliance_networking_interfaces_info.py index fa3e83a85..9d08ce5b9 100644 --- a/plugins/modules/appliance_networking_interfaces_info.py +++ b/plugins/modules/appliance_networking_interfaces_info.py @@ -137,7 +137,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" 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, diff --git a/plugins/modules/appliance_networking_interfaces_ipv4.py b/plugins/modules/appliance_networking_interfaces_ipv4.py index b7ab8d62b..2f2b96f71 100644 --- a/plugins/modules/appliance_networking_interfaces_ipv4.py +++ b/plugins/modules/appliance_networking_interfaces_ipv4.py @@ -169,7 +169,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/appliance_networking_interfaces_ipv4_info.py b/plugins/modules/appliance_networking_interfaces_ipv4_info.py index 6666eb242..5700b1ac0 100644 --- a/plugins/modules/appliance_networking_interfaces_ipv4_info.py +++ b/plugins/modules/appliance_networking_interfaces_ipv4_info.py @@ -113,7 +113,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_networking_interfaces_ipv6.py b/plugins/modules/appliance_networking_interfaces_ipv6.py index 48ed56f32..fbc73396e 100644 --- a/plugins/modules/appliance_networking_interfaces_ipv6.py +++ b/plugins/modules/appliance_networking_interfaces_ipv6.py @@ -167,7 +167,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/appliance_networking_interfaces_ipv6_info.py b/plugins/modules/appliance_networking_interfaces_ipv6_info.py index 343fb7a12..858d3541b 100644 --- a/plugins/modules/appliance_networking_interfaces_ipv6_info.py +++ b/plugins/modules/appliance_networking_interfaces_ipv6_info.py @@ -117,7 +117,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_networking_noproxy.py b/plugins/modules/appliance_networking_noproxy.py index a6494c6d7..0c938c1fa 100644 --- a/plugins/modules/appliance_networking_noproxy.py +++ b/plugins/modules/appliance_networking_noproxy.py @@ -127,7 +127,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/appliance_networking_noproxy_info.py b/plugins/modules/appliance_networking_noproxy_info.py index 2b42c289f..4b779ebfa 100644 --- a/plugins/modules/appliance_networking_noproxy_info.py +++ b/plugins/modules/appliance_networking_noproxy_info.py @@ -101,7 +101,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_networking_proxy.py b/plugins/modules/appliance_networking_proxy.py index d81b15f3e..71bc5abd0 100644 --- a/plugins/modules/appliance_networking_proxy.py +++ b/plugins/modules/appliance_networking_proxy.py @@ -163,6 +163,12 @@ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { + "test": { + "query": {}, + "body": {"config": "config", "host": "host"}, + "path": {"protocol": "protocol"}, + }, + "delete": {"query": {}, "body": {}, "path": {"protocol": "protocol"}}, "set": { "query": {}, "body": { @@ -174,12 +180,6 @@ }, "path": {"protocol": "protocol"}, }, - "test": { - "query": {}, - "body": {"config": "config", "host": "host"}, - "path": {"protocol": "protocol"}, - }, - "delete": {"query": {}, "body": {}, "path": {"protocol": "protocol"}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -195,7 +195,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/appliance_networking_proxy_info.py b/plugins/modules/appliance_networking_proxy_info.py index 8fbf32424..81f7d8dfa 100644 --- a/plugins/modules/appliance_networking_proxy_info.py +++ b/plugins/modules/appliance_networking_proxy_info.py @@ -118,7 +118,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" 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, diff --git a/plugins/modules/appliance_ntp.py b/plugins/modules/appliance_ntp.py index cd96d3c96..5db6acbfa 100644 --- a/plugins/modules/appliance_ntp.py +++ b/plugins/modules/appliance_ntp.py @@ -116,8 +116,8 @@ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "set": {"query": {}, "body": {"servers": "servers"}, "path": {}}, "test": {"query": {}, "body": {"servers": "servers"}, "path": {}}, + "set": {"query": {}, "body": {"servers": "servers"}, "path": {}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -133,7 +133,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/appliance_ntp_info.py b/plugins/modules/appliance_ntp_info.py index dacbfe55a..c3821cc40 100644 --- a/plugins/modules/appliance_ntp_info.py +++ b/plugins/modules/appliance_ntp_info.py @@ -109,7 +109,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_services.py b/plugins/modules/appliance_services.py index d9327ac0b..f277fd1eb 100644 --- a/plugins/modules/appliance_services.py +++ b/plugins/modules/appliance_services.py @@ -114,9 +114,9 @@ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "stop": {"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 from ansible.module_utils.basic import env_fallback @@ -132,7 +132,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/appliance_services_info.py b/plugins/modules/appliance_services_info.py index 05b27db3d..e4fdd345e 100644 --- a/plugins/modules/appliance_services_info.py +++ b/plugins/modules/appliance_services_info.py @@ -116,7 +116,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" 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, diff --git a/plugins/modules/appliance_shutdown.py b/plugins/modules/appliance_shutdown.py index 39aeb4c7f..2280d85fe 100644 --- a/plugins/modules/appliance_shutdown.py +++ b/plugins/modules/appliance_shutdown.py @@ -122,12 +122,12 @@ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "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 @@ -144,7 +144,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/appliance_shutdown_info.py b/plugins/modules/appliance_shutdown_info.py index fb7374d1c..7f85e9396 100644 --- a/plugins/modules/appliance_shutdown_info.py +++ b/plugins/modules/appliance_shutdown_info.py @@ -108,7 +108,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_system_globalfips.py b/plugins/modules/appliance_system_globalfips.py index fe0051428..044f9c25f 100644 --- a/plugins/modules/appliance_system_globalfips.py +++ b/plugins/modules/appliance_system_globalfips.py @@ -103,7 +103,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( open_session, prepare_payload, diff --git a/plugins/modules/appliance_system_globalfips_info.py b/plugins/modules/appliance_system_globalfips_info.py index 4908e239a..e1d003553 100644 --- a/plugins/modules/appliance_system_globalfips_info.py +++ b/plugins/modules/appliance_system_globalfips_info.py @@ -92,7 +92,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_system_storage.py b/plugins/modules/appliance_system_storage.py index 7df99b104..4bfdc3734 100644 --- a/plugins/modules/appliance_system_storage.py +++ b/plugins/modules/appliance_system_storage.py @@ -102,8 +102,8 @@ # 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 from ansible.module_utils.basic import env_fallback @@ -119,7 +119,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/appliance_system_storage_info.py b/plugins/modules/appliance_system_storage_info.py index a48c1e7c6..9133ff372 100644 --- a/plugins/modules/appliance_system_storage_info.py +++ b/plugins/modules/appliance_system_storage_info.py @@ -101,7 +101,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_system_time_info.py b/plugins/modules/appliance_system_time_info.py index 9d2de5ca7..75511d136 100644 --- a/plugins/modules/appliance_system_time_info.py +++ b/plugins/modules/appliance_system_time_info.py @@ -105,7 +105,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_system_time_timezone.py b/plugins/modules/appliance_system_time_timezone.py index 0fac62578..361cc68c8 100644 --- a/plugins/modules/appliance_system_time_timezone.py +++ b/plugins/modules/appliance_system_time_timezone.py @@ -113,7 +113,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/appliance_system_time_timezone_info.py b/plugins/modules/appliance_system_time_timezone_info.py index e9b45d228..59da771f7 100644 --- a/plugins/modules/appliance_system_time_timezone_info.py +++ b/plugins/modules/appliance_system_time_timezone_info.py @@ -101,7 +101,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_system_version_info.py b/plugins/modules/appliance_system_version_info.py index 92d21314e..5646884ff 100644 --- a/plugins/modules/appliance_system_version_info.py +++ b/plugins/modules/appliance_system_version_info.py @@ -108,7 +108,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_timesync.py b/plugins/modules/appliance_timesync.py index e496c0206..b3b04ff80 100644 --- a/plugins/modules/appliance_timesync.py +++ b/plugins/modules/appliance_timesync.py @@ -117,7 +117,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/appliance_timesync_info.py b/plugins/modules/appliance_timesync_info.py index f33499a04..28e7f2445 100644 --- a/plugins/modules/appliance_timesync_info.py +++ b/plugins/modules/appliance_timesync_info.py @@ -101,7 +101,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_update_info.py b/plugins/modules/appliance_update_info.py index daee8ed35..109b76db0 100644 --- a/plugins/modules/appliance_update_info.py +++ b/plugins/modules/appliance_update_info.py @@ -103,7 +103,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/appliance_vmon_service.py b/plugins/modules/appliance_vmon_service.py index 4cd81a501..932b8a96f 100644 --- a/plugins/modules/appliance_vmon_service.py +++ b/plugins/modules/appliance_vmon_service.py @@ -117,14 +117,14 @@ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "start": {"query": {}, "body": {}, "path": {"service": "service"}}, "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"}}, "restart": {"query": {}, "body": {}, "path": {"service": "service"}}, } # pylint: disable=line-too-long @@ -141,7 +141,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/appliance_vmon_service_info.py b/plugins/modules/appliance_vmon_service_info.py index 0fd651067..cc73aecf1 100644 --- a/plugins/modules/appliance_vmon_service_info.py +++ b/plugins/modules/appliance_vmon_service_info.py @@ -487,7 +487,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/content_configuration.py b/plugins/modules/content_configuration.py index aca8267f5..d32e05dd5 100644 --- a/plugins/modules/content_configuration.py +++ b/plugins/modules/content_configuration.py @@ -156,7 +156,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( open_session, prepare_payload, diff --git a/plugins/modules/content_configuration_info.py b/plugins/modules/content_configuration_info.py index 818d89cc6..391db4c81 100644 --- a/plugins/modules/content_configuration_info.py +++ b/plugins/modules/content_configuration_info.py @@ -105,7 +105,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/content_library_item_info.py b/plugins/modules/content_library_item_info.py index 91aaab254..d4556bba8 100644 --- a/plugins/modules/content_library_item_info.py +++ b/plugins/modules/content_library_item_info.py @@ -194,7 +194,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" 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, diff --git a/plugins/modules/content_locallibrary.py b/plugins/modules/content_locallibrary.py index a7ab3aad3..8475105b7 100644 --- a/plugins/modules/content_locallibrary.py +++ b/plugins/modules/content_locallibrary.py @@ -1253,11 +1253,6 @@ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "publish": { - "query": {}, - "body": {"subscriptions": "subscriptions"}, - "path": {"library_id": "library_id"}, - }, "update": { "query": {}, "body": { @@ -1279,7 +1274,11 @@ }, "path": {"library_id": "library_id"}, }, - "delete": {"query": {}, "body": {}, "path": {"library_id": "library_id"}}, + "publish": { + "query": {}, + "body": {"subscriptions": "subscriptions"}, + "path": {"library_id": "library_id"}, + }, "create": { "query": {"client_token": "client_token"}, "body": { @@ -1301,6 +1300,7 @@ }, "path": {}, }, + "delete": {"query": {}, "body": {}, "path": {"library_id": "library_id"}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -1316,7 +1316,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/content_locallibrary_info.py b/plugins/modules/content_locallibrary_info.py index 070296dc8..a01f6388f 100644 --- a/plugins/modules/content_locallibrary_info.py +++ b/plugins/modules/content_locallibrary_info.py @@ -333,7 +333,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" 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, diff --git a/plugins/modules/content_subscribedlibrary.py b/plugins/modules/content_subscribedlibrary.py index e819ef6a3..6feffb8bc 100644 --- a/plugins/modules/content_subscribedlibrary.py +++ b/plugins/modules/content_subscribedlibrary.py @@ -457,10 +457,9 @@ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "delete": {"query": {}, "body": {}, "path": {"library_id": "library_id"}}, "evict": {"query": {}, "body": {}, "path": {"library_id": "library_id"}}, - "create": { - "query": {"client_token": "client_token"}, + "update": { + "query": {}, "body": { "creation_time": "creation_time", "description": "description", @@ -478,10 +477,15 @@ "unset_security_policy_id": "unset_security_policy_id", "version": "version", }, - "path": {}, + "path": {"library_id": "library_id"}, }, - "update": { + "probe": { "query": {}, + "body": {"subscription_info": "subscription_info"}, + "path": {}, + }, + "create": { + "query": {"client_token": "client_token"}, "body": { "creation_time": "creation_time", "description": "description", @@ -499,13 +503,9 @@ "unset_security_policy_id": "unset_security_policy_id", "version": "version", }, - "path": {"library_id": "library_id"}, - }, - "probe": { - "query": {}, - "body": {"subscription_info": "subscription_info"}, "path": {}, }, + "delete": {"query": {}, "body": {}, "path": {"library_id": "library_id"}}, "sync": {"query": {}, "body": {}, "path": {"library_id": "library_id"}}, } # pylint: disable=line-too-long @@ -522,7 +522,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/content_subscribedlibrary_info.py b/plugins/modules/content_subscribedlibrary_info.py index 0f7031d7f..c80607f02 100644 --- a/plugins/modules/content_subscribedlibrary_info.py +++ b/plugins/modules/content_subscribedlibrary_info.py @@ -123,7 +123,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" 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, diff --git a/plugins/modules/vcenter_cluster_info.py b/plugins/modules/vcenter_cluster_info.py index ca5a0db1f..d2b8a0ef7 100644 --- a/plugins/modules/vcenter_cluster_info.py +++ b/plugins/modules/vcenter_cluster_info.py @@ -165,7 +165,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" 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, diff --git a/plugins/modules/vcenter_datacenter.py b/plugins/modules/vcenter_datacenter.py index 358bb6624..dd153a1f3 100644 --- a/plugins/modules/vcenter_datacenter.py +++ b/plugins/modules/vcenter_datacenter.py @@ -160,12 +160,12 @@ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { + "create": {"query": {}, "body": {"folder": "folder", "name": "name"}, "path": {}}, "delete": { "query": {"force": "force"}, "body": {}, "path": {"datacenter": "datacenter"}, }, - "create": {"query": {}, "body": {"folder": "folder", "name": "name"}, "path": {}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -181,7 +181,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, @@ -297,14 +296,15 @@ async def _create(params, session): 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/plugins/modules/vcenter_datacenter_info.py b/plugins/modules/vcenter_datacenter_info.py index d594d33b2..1e7d03e16 100644 --- a/plugins/modules/vcenter_datacenter_info.py +++ b/plugins/modules/vcenter_datacenter_info.py @@ -147,7 +147,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" 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, diff --git a/plugins/modules/vcenter_datastore_info.py b/plugins/modules/vcenter_datastore_info.py index 2bc52e40d..aab450b0f 100644 --- a/plugins/modules/vcenter_datastore_info.py +++ b/plugins/modules/vcenter_datastore_info.py @@ -178,7 +178,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" 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, diff --git a/plugins/modules/vcenter_folder_info.py b/plugins/modules/vcenter_folder_info.py index 6084eb233..e17bab127 100644 --- a/plugins/modules/vcenter_folder_info.py +++ b/plugins/modules/vcenter_folder_info.py @@ -174,7 +174,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/vcenter_host.py b/plugins/modules/vcenter_host.py index b8feb5218..73f6e98ac 100644 --- a/plugins/modules/vcenter_host.py +++ b/plugins/modules/vcenter_host.py @@ -159,9 +159,8 @@ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "disconnect": {"query": {}, "body": {}, "path": {"host": "host"}}, "connect": {"query": {}, "body": {}, "path": {"host": "host"}}, - "delete": {"query": {}, "body": {}, "path": {"host": "host"}}, + "disconnect": {"query": {}, "body": {}, "path": {"host": "host"}}, "create": { "query": {}, "body": { @@ -176,6 +175,7 @@ }, "path": {}, }, + "delete": {"query": {}, "body": {}, "path": {"host": "host"}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -191,7 +191,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, @@ -340,14 +339,15 @@ async def _create(params, session): 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/plugins/modules/vcenter_host_info.py b/plugins/modules/vcenter_host_info.py index 44d0d5fc2..febdf6a49 100644 --- a/plugins/modules/vcenter_host_info.py +++ b/plugins/modules/vcenter_host_info.py @@ -180,7 +180,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" 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, diff --git a/plugins/modules/vcenter_network_info.py b/plugins/modules/vcenter_network_info.py index 93d3c2fc1..66b24cc1c 100644 --- a/plugins/modules/vcenter_network_info.py +++ b/plugins/modules/vcenter_network_info.py @@ -171,7 +171,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/vcenter_ovf_libraryitem.py b/plugins/modules/vcenter_ovf_libraryitem.py index 23a8cbe57..06c4b8722 100644 --- a/plugins/modules/vcenter_ovf_libraryitem.py +++ b/plugins/modules/vcenter_ovf_libraryitem.py @@ -278,6 +278,11 @@ # 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"}, @@ -288,11 +293,6 @@ "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 from ansible.module_utils.basic import env_fallback @@ -308,7 +308,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/vcenter_resourcepool.py b/plugins/modules/vcenter_resourcepool.py index ee71c40d4..5e5d77d68 100644 --- a/plugins/modules/vcenter_resourcepool.py +++ b/plugins/modules/vcenter_resourcepool.py @@ -260,7 +260,6 @@ }, "path": {"resource_pool": "resource_pool"}, }, - "delete": {"query": {}, "body": {}, "path": {"resource_pool": "resource_pool"}}, "create": { "query": {}, "body": { @@ -271,6 +270,7 @@ }, "path": {}, }, + "delete": {"query": {}, "body": {}, "path": {"resource_pool": "resource_pool"}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -286,7 +286,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, @@ -403,14 +402,11 @@ async def _create(params, session): 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/plugins/modules/vcenter_resourcepool_info.py b/plugins/modules/vcenter_resourcepool_info.py index 1cb7dbee7..a4047e151 100644 --- a/plugins/modules/vcenter_resourcepool_info.py +++ b/plugins/modules/vcenter_resourcepool_info.py @@ -205,7 +205,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" 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, diff --git a/plugins/modules/vcenter_storage_policies_info.py b/plugins/modules/vcenter_storage_policies_info.py index fd9afc964..eb9ccdee6 100644 --- a/plugins/modules/vcenter_storage_policies_info.py +++ b/plugins/modules/vcenter_storage_policies_info.py @@ -148,7 +148,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/vcenter_vm.py b/plugins/modules/vcenter_vm.py index 537fe7d7d..af858bac2 100644 --- a/plugins/modules/vcenter_vm.py +++ b/plugins/modules/vcenter_vm.py @@ -1250,31 +1250,36 @@ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "delete": {"query": {}, "body": {}, "path": {"vm": "vm"}}, - "register": { + "clone": { "query": {}, "body": { - "datastore": "datastore", - "datastore_path": "datastore_path", + "disks_to_remove": "disks_to_remove", + "disks_to_update": "disks_to_update", + "guest_customization_spec": "guest_customization_spec", "name": "name", - "path": "path", "placement": "placement", + "power_on": "power_on", + "source": "source", }, "path": {}, }, - "clone": { + "relocate": { + "query": {}, + "body": {"disks": "disks", "placement": "placement"}, + "path": {"vm": "vm"}, + }, + "register": { "query": {}, "body": { - "disks_to_remove": "disks_to_remove", - "disks_to_update": "disks_to_update", - "guest_customization_spec": "guest_customization_spec", + "datastore": "datastore", + "datastore_path": "datastore_path", "name": "name", + "path": "path", "placement": "placement", - "power_on": "power_on", - "source": "source", }, "path": {}, }, + "unregister": {"query": {}, "body": {}, "path": {"vm": "vm"}}, "create": { "query": {}, "body": { @@ -1299,12 +1304,7 @@ }, "path": {}, }, - "unregister": {"query": {}, "body": {}, "path": {"vm": "vm"}}, - "relocate": { - "query": {}, - "body": {"disks": "disks", "placement": "placement"}, - "path": {"vm": "vm"}, - }, + "delete": {"query": {}, "body": {}, "path": {"vm": "vm"}}, "instant_clone": { "query": {}, "body": { @@ -1334,7 +1334,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, @@ -1691,14 +1690,11 @@ async def _clone(params, session): 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"]) @@ -1766,14 +1762,11 @@ async def _create(params, session): 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"]) @@ -1859,14 +1852,11 @@ async def _instant_clone(params, session): 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/plugins/modules/vcenter_vm_guest_customization.py b/plugins/modules/vcenter_vm_guest_customization.py index cb55309f3..66a139f2f 100644 --- a/plugins/modules/vcenter_vm_guest_customization.py +++ b/plugins/modules/vcenter_vm_guest_customization.py @@ -280,7 +280,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/vcenter_vm_guest_filesystem_directories.py b/plugins/modules/vcenter_vm_guest_filesystem_directories.py index dcec45292..9fb6ee330 100644 --- a/plugins/modules/vcenter_vm_guest_filesystem_directories.py +++ b/plugins/modules/vcenter_vm_guest_filesystem_directories.py @@ -203,6 +203,11 @@ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { + "move": { + "query": {}, + "body": {"credentials": "credentials", "new_path": "new_path", "path": "path"}, + "path": {"vm": "vm"}, + }, "create_temporary": { "query": {}, "body": { @@ -213,29 +218,24 @@ }, "path": {"vm": "vm"}, }, - "delete": { + "create": { "query": {}, "body": { + "create_parents": "create_parents", "credentials": "credentials", "path": "path", - "recursive": "recursive", }, "path": {"vm": "vm"}, }, - "create": { + "delete": { "query": {}, "body": { - "create_parents": "create_parents", "credentials": "credentials", "path": "path", + "recursive": "recursive", }, "path": {"vm": "vm"}, }, - "move": { - "query": {}, - "body": {"credentials": "credentials", "new_path": "new_path", "path": "path"}, - "path": {"vm": "vm"}, - }, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -251,7 +251,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/vcenter_vm_guest_identity_info.py b/plugins/modules/vcenter_vm_guest_identity_info.py index 06c9a97a8..2fd8b2141 100644 --- a/plugins/modules/vcenter_vm_guest_identity_info.py +++ b/plugins/modules/vcenter_vm_guest_identity_info.py @@ -126,7 +126,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/vcenter_vm_guest_localfilesystem_info.py b/plugins/modules/vcenter_vm_guest_localfilesystem_info.py index ca84e57d5..a95254c33 100644 --- a/plugins/modules/vcenter_vm_guest_localfilesystem_info.py +++ b/plugins/modules/vcenter_vm_guest_localfilesystem_info.py @@ -128,7 +128,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/vcenter_vm_guest_networking_info.py b/plugins/modules/vcenter_vm_guest_networking_info.py index f2652df30..320629306 100644 --- a/plugins/modules/vcenter_vm_guest_networking_info.py +++ b/plugins/modules/vcenter_vm_guest_networking_info.py @@ -129,7 +129,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/vcenter_vm_guest_networking_interfaces_info.py b/plugins/modules/vcenter_vm_guest_networking_interfaces_info.py index f02b048d6..7f7c56eb7 100644 --- a/plugins/modules/vcenter_vm_guest_networking_interfaces_info.py +++ b/plugins/modules/vcenter_vm_guest_networking_interfaces_info.py @@ -125,7 +125,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/vcenter_vm_guest_networking_routes_info.py b/plugins/modules/vcenter_vm_guest_networking_routes_info.py index f25c2f981..2133a89b4 100644 --- a/plugins/modules/vcenter_vm_guest_networking_routes_info.py +++ b/plugins/modules/vcenter_vm_guest_networking_routes_info.py @@ -120,7 +120,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/vcenter_vm_guest_operations_info.py b/plugins/modules/vcenter_vm_guest_operations_info.py index 7d0f5fe8b..75651456b 100644 --- a/plugins/modules/vcenter_vm_guest_operations_info.py +++ b/plugins/modules/vcenter_vm_guest_operations_info.py @@ -98,7 +98,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/vcenter_vm_guest_power.py b/plugins/modules/vcenter_vm_guest_power.py index 41b70e6f7..9487a2004 100644 --- a/plugins/modules/vcenter_vm_guest_power.py +++ b/plugins/modules/vcenter_vm_guest_power.py @@ -141,8 +141,8 @@ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { "reboot": {"query": {}, "body": {}, "path": {"vm": "vm"}}, - "standby": {"query": {}, "body": {}, "path": {"vm": "vm"}}, "shutdown": {"query": {}, "body": {}, "path": {"vm": "vm"}}, + "standby": {"query": {}, "body": {}, "path": {"vm": "vm"}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -158,7 +158,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/vcenter_vm_guest_power_info.py b/plugins/modules/vcenter_vm_guest_power_info.py index 6eb794e78..e6e1a8352 100644 --- a/plugins/modules/vcenter_vm_guest_power_info.py +++ b/plugins/modules/vcenter_vm_guest_power_info.py @@ -142,7 +142,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/vcenter_vm_hardware.py b/plugins/modules/vcenter_vm_hardware.py index bd435b40a..81ace5eba 100644 --- a/plugins/modules/vcenter_vm_hardware.py +++ b/plugins/modules/vcenter_vm_hardware.py @@ -186,7 +186,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/vcenter_vm_hardware_adapter_sata.py b/plugins/modules/vcenter_vm_hardware_adapter_sata.py index 64ddd8a85..854ab20b5 100644 --- a/plugins/modules/vcenter_vm_hardware_adapter_sata.py +++ b/plugins/modules/vcenter_vm_hardware_adapter_sata.py @@ -157,12 +157,12 @@ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "delete": {"query": {}, "body": {}, "path": {"adapter": "adapter", "vm": "vm"}}, "create": { "query": {}, "body": {"bus": "bus", "pci_slot_number": "pci_slot_number", "type": "type"}, "path": {"vm": "vm"}, }, + "delete": {"query": {}, "body": {}, "path": {"adapter": "adapter", "vm": "vm"}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -178,7 +178,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, @@ -298,14 +297,11 @@ async def _create(params, session): 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/plugins/modules/vcenter_vm_hardware_adapter_sata_info.py b/plugins/modules/vcenter_vm_hardware_adapter_sata_info.py index b79f88c38..5836cfa0f 100644 --- a/plugins/modules/vcenter_vm_hardware_adapter_sata_info.py +++ b/plugins/modules/vcenter_vm_hardware_adapter_sata_info.py @@ -144,7 +144,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" 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, diff --git a/plugins/modules/vcenter_vm_hardware_adapter_scsi.py b/plugins/modules/vcenter_vm_hardware_adapter_scsi.py index 58fe7160c..25521695c 100644 --- a/plugins/modules/vcenter_vm_hardware_adapter_scsi.py +++ b/plugins/modules/vcenter_vm_hardware_adapter_scsi.py @@ -180,7 +180,6 @@ "body": {"sharing": "sharing"}, "path": {"adapter": "adapter", "vm": "vm"}, }, - "delete": {"query": {}, "body": {}, "path": {"adapter": "adapter", "vm": "vm"}}, "create": { "query": {}, "body": { @@ -191,6 +190,7 @@ }, "path": {"vm": "vm"}, }, + "delete": {"query": {}, "body": {}, "path": {"adapter": "adapter", "vm": "vm"}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -206,7 +206,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, @@ -333,14 +332,11 @@ async def _create(params, session): 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/plugins/modules/vcenter_vm_hardware_adapter_scsi_info.py b/plugins/modules/vcenter_vm_hardware_adapter_scsi_info.py index ec74da589..ddb324276 100644 --- a/plugins/modules/vcenter_vm_hardware_adapter_scsi_info.py +++ b/plugins/modules/vcenter_vm_hardware_adapter_scsi_info.py @@ -132,7 +132,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" 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, diff --git a/plugins/modules/vcenter_vm_hardware_boot.py b/plugins/modules/vcenter_vm_hardware_boot.py index 3b7447cbd..afc4d62e1 100644 --- a/plugins/modules/vcenter_vm_hardware_boot.py +++ b/plugins/modules/vcenter_vm_hardware_boot.py @@ -194,7 +194,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( open_session, prepare_payload, diff --git a/plugins/modules/vcenter_vm_hardware_boot_device.py b/plugins/modules/vcenter_vm_hardware_boot_device.py index e41dabc3b..fd2ea75b6 100644 --- a/plugins/modules/vcenter_vm_hardware_boot_device.py +++ b/plugins/modules/vcenter_vm_hardware_boot_device.py @@ -162,7 +162,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/vcenter_vm_hardware_boot_device_info.py b/plugins/modules/vcenter_vm_hardware_boot_device_info.py index ba862a9d2..d01e67850 100644 --- a/plugins/modules/vcenter_vm_hardware_boot_device_info.py +++ b/plugins/modules/vcenter_vm_hardware_boot_device_info.py @@ -126,7 +126,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/vcenter_vm_hardware_boot_info.py b/plugins/modules/vcenter_vm_hardware_boot_info.py index 7d1d5ba04..d719b8a7b 100644 --- a/plugins/modules/vcenter_vm_hardware_boot_info.py +++ b/plugins/modules/vcenter_vm_hardware_boot_info.py @@ -123,7 +123,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/vcenter_vm_hardware_cdrom.py b/plugins/modules/vcenter_vm_hardware_cdrom.py index ef8f6c6d6..b3185f1c1 100644 --- a/plugins/modules/vcenter_vm_hardware_cdrom.py +++ b/plugins/modules/vcenter_vm_hardware_cdrom.py @@ -224,30 +224,30 @@ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "delete": {"query": {}, "body": {}, "path": {"cdrom": "cdrom", "vm": "vm"}}, - "create": { + "connect": {"query": {}, "body": {}, "path": {"cdrom": "cdrom", "vm": "vm"}}, + "disconnect": {"query": {}, "body": {}, "path": {"cdrom": "cdrom", "vm": "vm"}}, + "update": { "query": {}, "body": { "allow_guest_control": "allow_guest_control", "backing": "backing", - "ide": "ide", - "sata": "sata", "start_connected": "start_connected", - "type": "type", }, - "path": {"vm": "vm"}, + "path": {"cdrom": "cdrom", "vm": "vm"}, }, - "update": { + "create": { "query": {}, "body": { "allow_guest_control": "allow_guest_control", "backing": "backing", + "ide": "ide", + "sata": "sata", "start_connected": "start_connected", + "type": "type", }, - "path": {"cdrom": "cdrom", "vm": "vm"}, + "path": {"vm": "vm"}, }, - "disconnect": {"query": {}, "body": {}, "path": {"cdrom": "cdrom", "vm": "vm"}}, - "connect": {"query": {}, "body": {}, "path": {"cdrom": "cdrom", "vm": "vm"}}, + "delete": {"query": {}, "body": {}, "path": {"cdrom": "cdrom", "vm": "vm"}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -263,7 +263,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, @@ -413,14 +412,11 @@ async def _create(params, session): 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/plugins/modules/vcenter_vm_hardware_cdrom_info.py b/plugins/modules/vcenter_vm_hardware_cdrom_info.py index 51434c076..b76fd9afa 100644 --- a/plugins/modules/vcenter_vm_hardware_cdrom_info.py +++ b/plugins/modules/vcenter_vm_hardware_cdrom_info.py @@ -131,7 +131,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" 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, diff --git a/plugins/modules/vcenter_vm_hardware_cpu.py b/plugins/modules/vcenter_vm_hardware_cpu.py index 487618e72..3d3a56b4a 100644 --- a/plugins/modules/vcenter_vm_hardware_cpu.py +++ b/plugins/modules/vcenter_vm_hardware_cpu.py @@ -180,7 +180,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( open_session, prepare_payload, diff --git a/plugins/modules/vcenter_vm_hardware_cpu_info.py b/plugins/modules/vcenter_vm_hardware_cpu_info.py index e4dddda30..01786eecd 100644 --- a/plugins/modules/vcenter_vm_hardware_cpu_info.py +++ b/plugins/modules/vcenter_vm_hardware_cpu_info.py @@ -123,7 +123,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/vcenter_vm_hardware_disk.py b/plugins/modules/vcenter_vm_hardware_disk.py index 8273bbf40..d627a1550 100644 --- a/plugins/modules/vcenter_vm_hardware_disk.py +++ b/plugins/modules/vcenter_vm_hardware_disk.py @@ -261,7 +261,6 @@ "body": {"backing": "backing"}, "path": {"disk": "disk", "vm": "vm"}, }, - "delete": {"query": {}, "body": {}, "path": {"disk": "disk", "vm": "vm"}}, "create": { "query": {}, "body": { @@ -275,6 +274,7 @@ }, "path": {"vm": "vm"}, }, + "delete": {"query": {}, "body": {}, "path": {"disk": "disk", "vm": "vm"}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -290,7 +290,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, @@ -414,14 +413,11 @@ async def _create(params, session): 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/plugins/modules/vcenter_vm_hardware_disk_info.py b/plugins/modules/vcenter_vm_hardware_disk_info.py index f78b97eb3..dbfe3ba9b 100644 --- a/plugins/modules/vcenter_vm_hardware_disk_info.py +++ b/plugins/modules/vcenter_vm_hardware_disk_info.py @@ -151,7 +151,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" 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, diff --git a/plugins/modules/vcenter_vm_hardware_ethernet.py b/plugins/modules/vcenter_vm_hardware_ethernet.py index 40a7f2475..758e406fc 100644 --- a/plugins/modules/vcenter_vm_hardware_ethernet.py +++ b/plugins/modules/vcenter_vm_hardware_ethernet.py @@ -305,37 +305,37 @@ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "delete": {"query": {}, "body": {}, "path": {"nic": "nic", "vm": "vm"}}, - "create": { + "connect": {"query": {}, "body": {}, "path": {"nic": "nic", "vm": "vm"}}, + "disconnect": {"query": {}, "body": {}, "path": {"nic": "nic", "vm": "vm"}}, + "update": { "query": {}, "body": { "allow_guest_control": "allow_guest_control", "backing": "backing", "mac_address": "mac_address", "mac_type": "mac_type", - "pci_slot_number": "pci_slot_number", "start_connected": "start_connected", - "type": "type", "upt_compatibility_enabled": "upt_compatibility_enabled", "wake_on_lan_enabled": "wake_on_lan_enabled", }, - "path": {"vm": "vm"}, + "path": {"nic": "nic", "vm": "vm"}, }, - "update": { + "create": { "query": {}, "body": { "allow_guest_control": "allow_guest_control", "backing": "backing", "mac_address": "mac_address", "mac_type": "mac_type", + "pci_slot_number": "pci_slot_number", "start_connected": "start_connected", + "type": "type", "upt_compatibility_enabled": "upt_compatibility_enabled", "wake_on_lan_enabled": "wake_on_lan_enabled", }, - "path": {"nic": "nic", "vm": "vm"}, + "path": {"vm": "vm"}, }, - "disconnect": {"query": {}, "body": {}, "path": {"nic": "nic", "vm": "vm"}}, - "connect": {"query": {}, "body": {}, "path": {"nic": "nic", "vm": "vm"}}, + "delete": {"query": {}, "body": {}, "path": {"nic": "nic", "vm": "vm"}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -351,7 +351,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, @@ -510,14 +509,11 @@ async def _create(params, session): 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/plugins/modules/vcenter_vm_hardware_ethernet_info.py b/plugins/modules/vcenter_vm_hardware_ethernet_info.py index adbd6ba42..c474552f8 100644 --- a/plugins/modules/vcenter_vm_hardware_ethernet_info.py +++ b/plugins/modules/vcenter_vm_hardware_ethernet_info.py @@ -136,7 +136,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" 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, diff --git a/plugins/modules/vcenter_vm_hardware_floppy.py b/plugins/modules/vcenter_vm_hardware_floppy.py index f82fe4103..41d9f6177 100644 --- a/plugins/modules/vcenter_vm_hardware_floppy.py +++ b/plugins/modules/vcenter_vm_hardware_floppy.py @@ -177,27 +177,27 @@ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "delete": {"query": {}, "body": {}, "path": {"floppy": "floppy", "vm": "vm"}}, - "create": { + "connect": {"query": {}, "body": {}, "path": {"floppy": "floppy", "vm": "vm"}}, + "disconnect": {"query": {}, "body": {}, "path": {"floppy": "floppy", "vm": "vm"}}, + "update": { "query": {}, "body": { "allow_guest_control": "allow_guest_control", "backing": "backing", "start_connected": "start_connected", }, - "path": {"vm": "vm"}, + "path": {"floppy": "floppy", "vm": "vm"}, }, - "update": { + "create": { "query": {}, "body": { "allow_guest_control": "allow_guest_control", "backing": "backing", "start_connected": "start_connected", }, - "path": {"floppy": "floppy", "vm": "vm"}, + "path": {"vm": "vm"}, }, - "disconnect": {"query": {}, "body": {}, "path": {"floppy": "floppy", "vm": "vm"}}, - "connect": {"query": {}, "body": {}, "path": {"floppy": "floppy", "vm": "vm"}}, + "delete": {"query": {}, "body": {}, "path": {"floppy": "floppy", "vm": "vm"}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -213,7 +213,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, @@ -360,14 +359,11 @@ async def _create(params, session): 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/plugins/modules/vcenter_vm_hardware_floppy_info.py b/plugins/modules/vcenter_vm_hardware_floppy_info.py index 7c874274f..b5833071a 100644 --- a/plugins/modules/vcenter_vm_hardware_floppy_info.py +++ b/plugins/modules/vcenter_vm_hardware_floppy_info.py @@ -131,7 +131,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" 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, diff --git a/plugins/modules/vcenter_vm_hardware_info.py b/plugins/modules/vcenter_vm_hardware_info.py index fd5fa9b54..54fb4e5b6 100644 --- a/plugins/modules/vcenter_vm_hardware_info.py +++ b/plugins/modules/vcenter_vm_hardware_info.py @@ -117,7 +117,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/vcenter_vm_hardware_memory.py b/plugins/modules/vcenter_vm_hardware_memory.py index d29f438de..ce91b03db 100644 --- a/plugins/modules/vcenter_vm_hardware_memory.py +++ b/plugins/modules/vcenter_vm_hardware_memory.py @@ -161,7 +161,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( open_session, prepare_payload, diff --git a/plugins/modules/vcenter_vm_hardware_memory_info.py b/plugins/modules/vcenter_vm_hardware_memory_info.py index c711e6e98..0087744db 100644 --- a/plugins/modules/vcenter_vm_hardware_memory_info.py +++ b/plugins/modules/vcenter_vm_hardware_memory_info.py @@ -121,7 +121,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/vcenter_vm_hardware_parallel.py b/plugins/modules/vcenter_vm_hardware_parallel.py index d319f938a..ec7076e2c 100644 --- a/plugins/modules/vcenter_vm_hardware_parallel.py +++ b/plugins/modules/vcenter_vm_hardware_parallel.py @@ -169,27 +169,27 @@ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "delete": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}}, - "create": { + "connect": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}}, + "disconnect": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}}, + "update": { "query": {}, "body": { "allow_guest_control": "allow_guest_control", "backing": "backing", "start_connected": "start_connected", }, - "path": {"vm": "vm"}, + "path": {"port": "port", "vm": "vm"}, }, - "update": { + "create": { "query": {}, "body": { "allow_guest_control": "allow_guest_control", "backing": "backing", "start_connected": "start_connected", }, - "path": {"port": "port", "vm": "vm"}, + "path": {"vm": "vm"}, }, - "disconnect": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}}, - "connect": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}}, + "delete": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -205,7 +205,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, @@ -352,14 +351,11 @@ async def _create(params, session): 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/plugins/modules/vcenter_vm_hardware_parallel_info.py b/plugins/modules/vcenter_vm_hardware_parallel_info.py index 8941bf55f..d2d2f7f37 100644 --- a/plugins/modules/vcenter_vm_hardware_parallel_info.py +++ b/plugins/modules/vcenter_vm_hardware_parallel_info.py @@ -131,7 +131,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" 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, diff --git a/plugins/modules/vcenter_vm_hardware_serial.py b/plugins/modules/vcenter_vm_hardware_serial.py index ef7ac6401..3da5807bd 100644 --- a/plugins/modules/vcenter_vm_hardware_serial.py +++ b/plugins/modules/vcenter_vm_hardware_serial.py @@ -244,8 +244,9 @@ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "delete": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}}, - "create": { + "connect": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}}, + "disconnect": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}}, + "update": { "query": {}, "body": { "allow_guest_control": "allow_guest_control", @@ -253,9 +254,9 @@ "start_connected": "start_connected", "yield_on_poll": "yield_on_poll", }, - "path": {"vm": "vm"}, + "path": {"port": "port", "vm": "vm"}, }, - "update": { + "create": { "query": {}, "body": { "allow_guest_control": "allow_guest_control", @@ -263,10 +264,9 @@ "start_connected": "start_connected", "yield_on_poll": "yield_on_poll", }, - "path": {"port": "port", "vm": "vm"}, + "path": {"vm": "vm"}, }, - "disconnect": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}}, - "connect": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}}, + "delete": {"query": {}, "body": {}, "path": {"port": "port", "vm": "vm"}}, } # pylint: disable=line-too-long from ansible.module_utils.basic import env_fallback @@ -282,7 +282,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, @@ -430,14 +429,11 @@ async def _create(params, session): 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/plugins/modules/vcenter_vm_hardware_serial_info.py b/plugins/modules/vcenter_vm_hardware_serial_info.py index 6bb7adc2b..1f7357f6d 100644 --- a/plugins/modules/vcenter_vm_hardware_serial_info.py +++ b/plugins/modules/vcenter_vm_hardware_serial_info.py @@ -151,7 +151,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" 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, diff --git a/plugins/modules/vcenter_vm_info.py b/plugins/modules/vcenter_vm_info.py index 2087a07e2..145e169f2 100644 --- a/plugins/modules/vcenter_vm_info.py +++ b/plugins/modules/vcenter_vm_info.py @@ -342,7 +342,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" 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, diff --git a/plugins/modules/vcenter_vm_libraryitem_info.py b/plugins/modules/vcenter_vm_libraryitem_info.py index f8beccc9d..2b3f20537 100644 --- a/plugins/modules/vcenter_vm_libraryitem_info.py +++ b/plugins/modules/vcenter_vm_libraryitem_info.py @@ -121,7 +121,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/vcenter_vm_power.py b/plugins/modules/vcenter_vm_power.py index a811b472c..5007a07f3 100644 --- a/plugins/modules/vcenter_vm_power.py +++ b/plugins/modules/vcenter_vm_power.py @@ -231,10 +231,10 @@ # This structure describes the format of the data expected by the end-points PAYLOAD_FORMAT = { - "stop": {"query": {}, "body": {}, "path": {"vm": "vm"}}, "reset": {"query": {}, "body": {}, "path": {"vm": "vm"}}, - "suspend": {"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 from ansible.module_utils.basic import env_fallback @@ -250,7 +250,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/vcenter_vm_power_info.py b/plugins/modules/vcenter_vm_power_info.py index c25b46c86..2e05118f9 100644 --- a/plugins/modules/vcenter_vm_power_info.py +++ b/plugins/modules/vcenter_vm_power_info.py @@ -120,7 +120,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/vcenter_vm_storage_policy.py b/plugins/modules/vcenter_vm_storage_policy.py index dcd3b56c5..bdeaac92d 100644 --- a/plugins/modules/vcenter_vm_storage_policy.py +++ b/plugins/modules/vcenter_vm_storage_policy.py @@ -171,7 +171,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( open_session, prepare_payload, diff --git a/plugins/modules/vcenter_vm_storage_policy_compliance.py b/plugins/modules/vcenter_vm_storage_policy_compliance.py index b6e727362..9ef117d64 100644 --- a/plugins/modules/vcenter_vm_storage_policy_compliance.py +++ b/plugins/modules/vcenter_vm_storage_policy_compliance.py @@ -126,7 +126,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/vcenter_vm_storage_policy_compliance_info.py b/plugins/modules/vcenter_vm_storage_policy_compliance_info.py index 417e211f6..70d371fcd 100644 --- a/plugins/modules/vcenter_vm_storage_policy_compliance_info.py +++ b/plugins/modules/vcenter_vm_storage_policy_compliance_info.py @@ -128,7 +128,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/vcenter_vm_storage_policy_info.py b/plugins/modules/vcenter_vm_storage_policy_info.py index 9fad104bb..131fa709d 100644 --- a/plugins/modules/vcenter_vm_storage_policy_info.py +++ b/plugins/modules/vcenter_vm_storage_policy_info.py @@ -122,7 +122,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/vcenter_vm_tools.py b/plugins/modules/vcenter_vm_tools.py index ad2a65549..cc7b59b25 100644 --- a/plugins/modules/vcenter_vm_tools.py +++ b/plugins/modules/vcenter_vm_tools.py @@ -175,7 +175,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/vcenter_vm_tools_info.py b/plugins/modules/vcenter_vm_tools_info.py index 21b22e669..f1a2f202b 100644 --- a/plugins/modules/vcenter_vm_tools_info.py +++ b/plugins/modules/vcenter_vm_tools_info.py @@ -185,7 +185,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/vcenter_vm_tools_installer.py b/plugins/modules/vcenter_vm_tools_installer.py index 84efb8ce6..376ce6e31 100644 --- a/plugins/modules/vcenter_vm_tools_installer.py +++ b/plugins/modules/vcenter_vm_tools_installer.py @@ -141,8 +141,8 @@ # 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 from ansible.module_utils.basic import env_fallback @@ -158,7 +158,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/vcenter_vm_tools_installer_info.py b/plugins/modules/vcenter_vm_tools_installer_info.py index 35040db48..c88b22c95 100644 --- a/plugins/modules/vcenter_vm_tools_installer_info.py +++ b/plugins/modules/vcenter_vm_tools_installer_info.py @@ -141,7 +141,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session, diff --git a/plugins/modules/vcenter_vmtemplate_libraryitems.py b/plugins/modules/vcenter_vmtemplate_libraryitems.py index cbac7e3e9..0eb18f625 100644 --- a/plugins/modules/vcenter_vmtemplate_libraryitems.py +++ b/plugins/modules/vcenter_vmtemplate_libraryitems.py @@ -309,34 +309,34 @@ # 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 @@ -353,7 +353,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( exists, gen_args, diff --git a/plugins/modules/vcenter_vmtemplate_libraryitems_info.py b/plugins/modules/vcenter_vmtemplate_libraryitems_info.py index 43995df3c..b5f78c3d1 100644 --- a/plugins/modules/vcenter_vmtemplate_libraryitems_info.py +++ b/plugins/modules/vcenter_vmtemplate_libraryitems_info.py @@ -103,7 +103,6 @@ AnsibleModule.collection_name = "vmware.vmware_rest" except ImportError: from ansible.module_utils.basic import AnsibleModule - from ansible_collections.vmware.vmware_rest.plugins.module_utils.vmware_rest import ( gen_args, open_session,