From 7d4c8f348f2229505f84c2ce8b7a0aaad8c01fcc Mon Sep 17 00:00:00 2001 From: Santosh Mishra Date: Thu, 6 May 2021 13:34:33 +0530 Subject: [PATCH 01/13] Oboarding connected vmware az cli extension --- src/connectedvmware/.gitignore | 1 + .../.vscode.example/launch.json | 42 + .../.vscode.example/settings.json | 22 + src/connectedvmware/HISTORY.rst | 8 + src/connectedvmware/README.rst | 5 + .../azext_connectedvmware/__init__.py | 36 + .../azext_connectedvmware/_actions.py | 36 + .../azext_connectedvmware/_client_factory.py | 56 + .../azext_connectedvmware/_help.py | 373 +++ .../azext_connectedvmware/_params.py | 321 ++ .../azext_connectedvmware/_validators.py | 22 + .../azext_connectedvmware/azext_metadata.json | 5 + .../azext_connectedvmware/commands.py | 87 + .../azext_connectedvmware/custom.py | 1244 +++++++ .../azext_connectedvmware/tests/__init__.py | 5 + .../tests/latest/__init__.py | 5 + .../tests/latest/test_arcvmware_scenario.py | 23 + .../latest/test_connectedvmware_scenario.py | 23 + .../vendored_sdks/__init__.py | 19 + ...azure_arc_vmware_management_service_api.py | 134 + .../vendored_sdks/_configuration.py | 71 + .../vendored_sdks/_version.py | 9 + .../vendored_sdks/aio/__init__.py | 10 + ...azure_arc_vmware_management_service_api.py | 127 + .../vendored_sdks/aio/_configuration.py | 67 + .../vendored_sdks/aio/operations/__init__.py | 31 + .../aio/operations/_guest_agent_operations.py | 445 +++ .../_hybrid_identity_metadata_operations.py | 322 ++ .../operations/_inventory_items_operations.py | 322 ++ .../_machine_extensions_operations.py | 571 ++++ .../aio/operations/_operations.py | 105 + .../operations/_resource_pools_operations.py | 571 ++++ .../aio/operations/_vcenters_operations.py | 571 ++++ .../_virtual_machine_templates_operations.py | 571 ++++ .../_virtual_machines_operations.py | 979 ++++++ .../_virtual_networks_operations.py | 571 ++++ ...azure_arc_vmware_management_service_api.py | 111 + .../vendored_sdks/models/__init__.py | 211 ++ ...arc_vmware_management_service_api_enums.py | 130 + .../vendored_sdks/models/_models.py | 2653 +++++++++++++++ .../vendored_sdks/models/_models_py3.py | 2898 +++++++++++++++++ ...arc_vmware_management_service_api_enums.py | 83 + .../models/azure_entity_resource.py | 50 + .../models/azure_entity_resource_py3.py | 50 + .../vendored_sdks/models/condition.py | 52 + .../vendored_sdks/models/condition_py3.py | 52 + .../vendored_sdks/models/error_definition.py | 47 + .../models/error_definition_py3.py | 47 + .../vendored_sdks/models/error_response.py | 41 + .../models/error_response_py3.py | 41 + .../vendored_sdks/models/extended_location.py | 32 + .../models/extended_location_py3.py | 32 + .../vendored_sdks/models/hardware_profile.py | 61 + .../models/hardware_profile_py3.py | 61 + .../vendored_sdks/models/inventory_item.py | 69 + .../models/inventory_item_paged.py | 27 + .../models/inventory_item_properties.py | 65 + .../models/inventory_item_properties_py3.py | 65 + .../models/inventory_item_py3.py | 69 + .../vendored_sdks/models/network_interface.py | 89 + .../models/network_interface_py3.py | 89 + .../models/network_interface_update.py | 49 + .../models/network_interface_update_py3.py | 49 + .../vendored_sdks/models/network_profile.py | 30 + .../models/network_profile_py3.py | 30 + .../models/network_profile_update.py | 30 + .../models/network_profile_update_py3.py | 30 + .../models/nic_ip_address_settings.py | 46 + .../models/nic_ip_address_settings_py3.py | 46 + .../vendored_sdks/models/nic_ip_settings.py | 71 + .../models/nic_ip_settings_py3.py | 71 + .../vendored_sdks/models/operation.py | 38 + .../vendored_sdks/models/operation_display.py | 40 + .../models/operation_display_py3.py | 40 + .../vendored_sdks/models/operation_paged.py | 27 + .../vendored_sdks/models/operation_py3.py | 38 + .../vendored_sdks/models/os_profile.py | 71 + .../vendored_sdks/models/os_profile_py3.py | 71 + .../vendored_sdks/models/proxy_resource.py | 45 + .../models/proxy_resource_py3.py | 45 + .../vendored_sdks/models/resource.py | 48 + .../vendored_sdks/models/resource_patch.py | 28 + .../models/resource_patch_py3.py | 28 + .../vendored_sdks/models/resource_pool.py | 154 + .../models/resource_pool_inventory_item.py | 53 + .../resource_pool_inventory_item_py3.py | 53 + .../models/resource_pool_paged.py | 27 + .../vendored_sdks/models/resource_pool_py3.py | 154 + .../vendored_sdks/models/resource_py3.py | 48 + .../models/stop_virtual_machine_options.py | 31 + .../stop_virtual_machine_options_py3.py | 31 + .../vendored_sdks/models/storage_profile.py | 43 + .../models/storage_profile_py3.py | 43 + .../models/storage_profile_update.py | 30 + .../models/storage_profile_update_py3.py | 30 + .../vendored_sdks/models/system_data.py | 54 + .../vendored_sdks/models/system_data_py3.py | 54 + .../vendored_sdks/models/tracked_resource.py | 56 + .../models/tracked_resource_py3.py | 56 + .../vendored_sdks/models/vcenter.py | 120 + .../vendored_sdks/models/vcenter_paged.py | 27 + .../vendored_sdks/models/vcenter_py3.py | 120 + .../vendored_sdks/models/vi_credential.py | 32 + .../vendored_sdks/models/vi_credential_py3.py | 32 + .../vendored_sdks/models/virtual_disk.py | 67 + .../vendored_sdks/models/virtual_disk_py3.py | 67 + .../models/virtual_disk_update.py | 51 + .../models/virtual_disk_update_py3.py | 51 + .../vendored_sdks/models/virtual_machine.py | 155 + .../models/virtual_machine_inventory_item.py | 53 + .../virtual_machine_inventory_item_py3.py | 53 + .../models/virtual_machine_paged.py | 27 + .../models/virtual_machine_py3.py | 155 + .../models/virtual_machine_template.py | 158 + ...virtual_machine_template_inventory_item.py | 53 + ...ual_machine_template_inventory_item_py3.py | 53 + .../models/virtual_machine_template_paged.py | 27 + .../models/virtual_machine_template_py3.py | 158 + .../models/virtual_machine_update.py | 52 + .../models/virtual_machine_update_py3.py | 43 + .../vendored_sdks/models/virtual_network.py | 110 + .../models/virtual_network_inventory_item.py | 53 + .../virtual_network_inventory_item_py3.py | 53 + .../models/virtual_network_paged.py | 27 + .../models/virtual_network_py3.py | 110 + .../models/virtual_scsi_controller.py | 50 + .../models/virtual_scsi_controller_py3.py | 50 + .../vendored_sdks/operations/__init__.py | 31 + .../operations/_guest_agent_operations.py | 455 +++ .../_hybrid_identity_metadata_operations.py | 330 ++ .../operations/_inventory_items_operations.py | 330 ++ .../_machine_extensions_operations.py | 583 ++++ .../vendored_sdks/operations/_operations.py | 110 + .../operations/_resource_pools_operations.py | 583 ++++ .../operations/_vcenters_operations.py | 583 ++++ .../_virtual_machine_templates_operations.py | 583 ++++ .../_virtual_machines_operations.py | 998 ++++++ .../_virtual_networks_operations.py | 583 ++++ .../operations/inventory_items_operations.py | 307 ++ .../vendored_sdks/operations/operations.py | 96 + .../operations/resource_pools_operations.py | 518 +++ .../operations/vcenters_operations.py | 518 +++ .../virtual_machine_templates_operations.py | 526 +++ .../operations/virtual_machines_operations.py | 837 +++++ .../operations/virtual_networks_operations.py | 519 +++ .../vendored_sdks/py.typed | 1 + .../vendored_sdks/version.py | 13 + .../azext_connectedvmware/vmware_constants.py | 41 + .../azext_connectedvmware/vmware_utils.py | 60 + src/connectedvmware/setup.cfg | 7 + src/connectedvmware/setup.py | 60 + 151 files changed, 27502 insertions(+) create mode 100644 src/connectedvmware/.gitignore create mode 100644 src/connectedvmware/.vscode.example/launch.json create mode 100644 src/connectedvmware/.vscode.example/settings.json create mode 100644 src/connectedvmware/HISTORY.rst create mode 100644 src/connectedvmware/README.rst create mode 100644 src/connectedvmware/azext_connectedvmware/__init__.py create mode 100644 src/connectedvmware/azext_connectedvmware/_actions.py create mode 100644 src/connectedvmware/azext_connectedvmware/_client_factory.py create mode 100644 src/connectedvmware/azext_connectedvmware/_help.py create mode 100644 src/connectedvmware/azext_connectedvmware/_params.py create mode 100644 src/connectedvmware/azext_connectedvmware/_validators.py create mode 100644 src/connectedvmware/azext_connectedvmware/azext_metadata.json create mode 100644 src/connectedvmware/azext_connectedvmware/commands.py create mode 100644 src/connectedvmware/azext_connectedvmware/custom.py create mode 100644 src/connectedvmware/azext_connectedvmware/tests/__init__.py create mode 100644 src/connectedvmware/azext_connectedvmware/tests/latest/__init__.py create mode 100644 src/connectedvmware/azext_connectedvmware/tests/latest/test_arcvmware_scenario.py create mode 100644 src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/__init__.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/_azure_arc_vmware_management_service_api.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/_configuration.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/_version.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/__init__.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/_azure_arc_vmware_management_service_api.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/_configuration.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/__init__.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_guest_agent_operations.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_hybrid_identity_metadata_operations.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_inventory_items_operations.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_machine_extensions_operations.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_operations.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_resource_pools_operations.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_vcenters_operations.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_virtual_machine_templates_operations.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_virtual_machines_operations.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_virtual_networks_operations.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/azure_arc_vmware_management_service_api.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/__init__.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/_azure_arc_vmware_management_service_api_enums.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/_models.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/_models_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/azure_arc_vmware_management_service_api_enums.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/azure_entity_resource.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/azure_entity_resource_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/condition.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/condition_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/error_definition.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/error_definition_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/error_response.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/error_response_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/extended_location.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/extended_location_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/hardware_profile.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/hardware_profile_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/inventory_item.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/inventory_item_paged.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/inventory_item_properties.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/inventory_item_properties_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/inventory_item_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_interface.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_interface_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_interface_update.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_interface_update_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_profile.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_profile_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_profile_update.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_profile_update_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/nic_ip_address_settings.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/nic_ip_address_settings_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/nic_ip_settings.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/nic_ip_settings_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/operation.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/operation_display.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/operation_display_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/operation_paged.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/operation_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/os_profile.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/os_profile_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/proxy_resource.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/proxy_resource_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_patch.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_patch_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_pool.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_pool_inventory_item.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_pool_inventory_item_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_pool_paged.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_pool_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/stop_virtual_machine_options.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/stop_virtual_machine_options_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/storage_profile.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/storage_profile_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/storage_profile_update.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/storage_profile_update_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/system_data.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/system_data_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/tracked_resource.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/tracked_resource_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/vcenter.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/vcenter_paged.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/vcenter_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/vi_credential.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/vi_credential_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_disk.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_disk_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_disk_update.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_disk_update_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_inventory_item.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_inventory_item_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_paged.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_template.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_template_inventory_item.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_template_inventory_item_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_template_paged.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_template_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_update.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_update_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_network.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_network_inventory_item.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_network_inventory_item_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_network_paged.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_network_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_scsi_controller.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_scsi_controller_py3.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/__init__.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_guest_agent_operations.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_hybrid_identity_metadata_operations.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_inventory_items_operations.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_machine_extensions_operations.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_operations.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_resource_pools_operations.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_vcenters_operations.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_virtual_machine_templates_operations.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_virtual_machines_operations.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_virtual_networks_operations.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/inventory_items_operations.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/operations.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/resource_pools_operations.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/vcenters_operations.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/virtual_machine_templates_operations.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/virtual_machines_operations.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/virtual_networks_operations.py create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/py.typed create mode 100644 src/connectedvmware/azext_connectedvmware/vendored_sdks/version.py create mode 100644 src/connectedvmware/azext_connectedvmware/vmware_constants.py create mode 100644 src/connectedvmware/azext_connectedvmware/vmware_utils.py create mode 100644 src/connectedvmware/setup.cfg create mode 100644 src/connectedvmware/setup.py diff --git a/src/connectedvmware/.gitignore b/src/connectedvmware/.gitignore new file mode 100644 index 00000000000..1d74e21965c --- /dev/null +++ b/src/connectedvmware/.gitignore @@ -0,0 +1 @@ +.vscode/ diff --git a/src/connectedvmware/.vscode.example/launch.json b/src/connectedvmware/.vscode.example/launch.json new file mode 100644 index 00000000000..ad71f69e923 --- /dev/null +++ b/src/connectedvmware/.vscode.example/launch.json @@ -0,0 +1,42 @@ +// Set AZCLI_SRC_PATH as the path to the azure-cli source code on your local machine. +// You may also replace the content of `${env:AZCLI_SRC_PATH}` with the absolute path, if desired :). +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Azure CLI Debug (Integrated Console)", + "type": "python", + "request": "launch", + "python": "${command:python.interpreterPath}", + "program": "${env:AZCLI_SRC_PATH}/src/azure-cli/azure/cli/__main__.py", + "args": [ ], // list of command arguments to execute when running in debug mode. + "console": "integratedTerminal", + "justMyCode": false + }, + { + "name": "Azure CLI Debug (External Console)", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "python": "${command:python.interpreterPath}", + "program": "${env:AZCLI_SRC_PATH}/src/azure-cli/azure/cli/__main__.py", + "cwd": "${workspaceRoot}", + "args": [ + "--help" + ], + "console": "externalTerminal" + }, + { + "name": "Azdev Scripts", + "type": "python", + "request": "launch", + "python": "${command:python.interpreterPath}", + "program": "${env:AZCLI_SRC_PATH}/src/azure-cli/azure/cli/__main__.py", + "cwd": "${workspaceRoot}", + "args": [ + "--help" + ], + "console": "integratedTerminal" + } + ] + } \ No newline at end of file diff --git a/src/connectedvmware/.vscode.example/settings.json b/src/connectedvmware/.vscode.example/settings.json new file mode 100644 index 00000000000..80d3ffcbc02 --- /dev/null +++ b/src/connectedvmware/.vscode.example/settings.json @@ -0,0 +1,22 @@ +{​​​​​ + "python.languageServer": "Pylance", + "python.formatting.provider": "black", + "python.formatting.blackArgs": [ + "--skip-string-normalization" + ], + "python.linting.enabled": true, + "python.linting.flake8Enabled": true, + "python.linting.flake8Args": [ + "--ignore=E203", + "--ignore=E266", + "--ignore=E501", + "--ignore=W503", + "--max-line-length=88", + "--select = B,C,E,F,W,T4,B9", + "--max-complexity = 18" + ], + "editor.formatOnSave": true, + "python.pythonPath": "$azcli/.venv/bin/python" // Set the path to python inside your virtual environment. +}​​​​​ + + diff --git a/src/connectedvmware/HISTORY.rst b/src/connectedvmware/HISTORY.rst new file mode 100644 index 00000000000..8c34bccfff8 --- /dev/null +++ b/src/connectedvmware/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. \ No newline at end of file diff --git a/src/connectedvmware/README.rst b/src/connectedvmware/README.rst new file mode 100644 index 00000000000..9a24507eef3 --- /dev/null +++ b/src/connectedvmware/README.rst @@ -0,0 +1,5 @@ +Microsoft Azure CLI 'connectedvmware' Extension +========================================== + +This package is for the 'connectedvmware' extension. +i.e. 'az connectedvmware' diff --git a/src/connectedvmware/azext_connectedvmware/__init__.py b/src/connectedvmware/azext_connectedvmware/__init__.py new file mode 100644 index 00000000000..c7ae194afeb --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/__init__.py @@ -0,0 +1,36 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azure.cli.core import AzCommandsLoader + +from azext_connectedvmware._help import helps # pylint: disable=unused-import + + +class ConnectedvmwareCommandsLoader(AzCommandsLoader): + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from azext_connectedvmware._client_factory import cf_connectedvmware + + connectedvmware_custom = CliCommandType( + operations_tmpl='azext_connectedvmware.custom#{}', + client_factory=cf_connectedvmware, + ) + super(ConnectedvmwareCommandsLoader, self).__init__( + cli_ctx=cli_ctx, custom_command_type=connectedvmware_custom + ) + + def load_command_table(self, args): + from azext_connectedvmware.commands import load_command_table + + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + from azext_connectedvmware._params import load_arguments + + load_arguments(self, command) + + +COMMAND_LOADER_CLS = ConnectedvmwareCommandsLoader diff --git a/src/connectedvmware/azext_connectedvmware/_actions.py b/src/connectedvmware/azext_connectedvmware/_actions.py new file mode 100644 index 00000000000..189978c62fc --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/_actions.py @@ -0,0 +1,36 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +""" +This file contains actions for parsing complex arguments. +""" + +import argparse +from azext_connectedvmware.vmware_utils import create_dictionary_from_arg_string + + +class VmNicAddAction(argparse._AppendAction): + """ + Action for parsing the nic arguments. + """ + + def __call__(self, parser, namespace, values, option_string=None): + nic_params_dict = create_dictionary_from_arg_string(values, option_string) + if namespace.nics: + namespace.nics.append(nic_params_dict) + else: + namespace.nics = [nic_params_dict] + + +class VmDiskAddAction(argparse._AppendAction): + """ + Action for parsing the disk arguments. + """ + + def __call__(self, parser, namespace, values, option_string=None): + disk_params_dict = create_dictionary_from_arg_string(values, option_string) + if namespace.disks: + namespace.disks.append(disk_params_dict) + else: + namespace.disks = [disk_params_dict] diff --git a/src/connectedvmware/azext_connectedvmware/_client_factory.py b/src/connectedvmware/azext_connectedvmware/_client_factory.py new file mode 100644 index 00000000000..0eee0ffe856 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/_client_factory.py @@ -0,0 +1,56 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +def cf_connectedvmware(cli_ctx, *_): + + from azure.cli.core.commands.client_factory import get_mgmt_service_client + + # Client factory for vmware clients. + from .vendored_sdks import AzureArcVMwareManagementServiceAPI + + return get_mgmt_service_client(cli_ctx, AzureArcVMwareManagementServiceAPI) + + +def cf_vcenter(cli_ctx, *_): + """ + Client factory for vcenters. + """ + return cf_connectedvmware(cli_ctx).vcenters + + +def cf_resource_pool(cli_ctx, *_): + """ + Client factory for resourcepools. + """ + return cf_connectedvmware(cli_ctx).resource_pools + + +def cf_virtual_network(cli_ctx, *_): + """ + Client factory for virtual networks. + """ + return cf_connectedvmware(cli_ctx).virtual_networks + + +def cf_virtual_machine_template(cli_ctx, *_): + """ + Client factory for vm templates. + """ + return cf_connectedvmware(cli_ctx).virtual_machine_templates + + +def cf_virtual_machine(cli_ctx, *_): + """ + Client factory for virtual machines. + """ + return cf_connectedvmware(cli_ctx).virtual_machines + + +def cf_inventory_item(cli_ctx, *_): + """ + Client factory for inventory items. + """ + return cf_connectedvmware(cli_ctx).inventory_items diff --git a/src/connectedvmware/azext_connectedvmware/_help.py b/src/connectedvmware/azext_connectedvmware/_help.py new file mode 100644 index 00000000000..c47bdc6f2e8 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/_help.py @@ -0,0 +1,373 @@ +# coding=utf-8 +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=too-many-lines + +from knack.help_files import helps # pylint: disable=unused-import + + +helps[ + 'connectedvmware' +] = """ + type: group + short-summary: Commands to manage Connected VMware. +""" + +helps[ + 'connectedvmware resource-pool' +] = """ + type: group + short-summary: resource pool resource +""" + +helps[ + 'connectedvmware resource-pool create' +] = """ + type: command + short-summary: "Create a resource pool resource" + examples: + - name: Create resource pool + text: |- + az connectedvmware resource-pool create --custom-location "custom location name" \ + --location "" --mo-ref-id "mo-ref id of the resource in vc" --name "resource pool name" \ + --resource-group "resource group name" --vcenter "name or id of the vcenter" +""" + +helps[ + 'connectedvmware resource-pool delete' +] = """ + type: command + short-summary: "Delete resource pool resource" + examples: + - name: Delete resource pool + text: |- + az connectedvmware resource-pool delete --ids "resource id" --name "resource pool name" \ + --resource-group "resource group name" --subscription "subscription id" +""" + +helps[ + 'connectedvmware resource-pool list' +] = """ + type: command + short-summary: "Retrieve a list of resource pool of given resource group" + examples: + - name: Retrieve a list of resource pool + text: |- + az connectedvmware resource-pool list --resource-group "resource group name" +""" + +helps[ + 'connectedvmware resource-pool show' +] = """ + type: command + short-summary: "Get details of a resource pool by id, resource-group, resource pool name, or subscription" + examples: + - name: Get details of a resource pool + text: |- + az connectedvmware resource-pool show --ids "resource id" --name "resource pool name" \ + --resource-group "resource group name" --subscription "subscription id" +""" + +helps[ + 'connectedvmware vcenter' +] = """ + type: group + short-summary: Create, Get and Delete vcenter resource +""" + +helps[ + 'connectedvmware vcenter connect' +] = """ + type: command + short-summary: "Create vcenter resource" + examples: + - name: Connect to vcenter + text: |- + az connectedvmware vcenter connect --custom-location "custom location name" \ + --fqdn "vcenter fqdn/ip" --username "vcenter user name" --password "vcenter password" \ + --resource-group "resource group name" --subscription "subscription id" \ + --name "vcenter name" --inventory-item "inventory item name or id" +""" + +helps[ + 'connectedvmware vcenter delete' +] = """ + type: command + short-summary: "Delete vcenter resource" + examples: + - name: Delete vcenter resource + text: |- + az connectedvmware vcenter delete --ids "resource id" --name "vcenter name" \ + --resource-group "resource group name" --subscription "subscription id" +""" + +helps[ + 'connectedvmware vcenter list' +] = """ + type: command + short-summary: "Retrieve a list of vcenter resource of given resource group" + examples: + - name: Retrieve a list of vcenter resource + text: |- + az connectedvmware vcenter list --resource-group "resource group name" +""" + +helps[ + 'connectedvmware vcenter show' +] = """ + type: command + short-summary: "Get details of a vcenter resource by id, resource-group, vcenter name or subscription" + examples: + - name: Get details of a vcenter resource + text: |- + az connectedvmware vcenter show --ids "resource id" --name "vcenter name" \ + --resource-group "resource group name" --subscription "subscription id" +""" + +helps[ + 'connectedvmware virtual-network' +] = """ + type: group + short-summary: virtual network resource +""" + +helps[ + 'connectedvmware virtual-network create' +] = """ + type: command + short-summary: "Create virtual network resource" + examples: + - name: Create virtual network + text: |- + az connectedvmware virtual-network create --custom-location "custom location name" + --location "region name" --mo-ref-id "mo-ref id of the resource in vc" --name \ + "virtual network name" --resource-group "resource group name" --vcenter \ + "name or id of the vcenter" --inventory-item "inventory item name or id" +""" + +helps[ + 'connectedvmware virtual-network delete' +] = """ + type: command + short-summary: "Delete virtual network resource" + examples: + - name: Delete virtual network + text: |- + az connectedvmware virtual-network delete --ids "resource id" --name "virtual network name" \ + --resource-group "resource group name" --subscription "subscription id" +""" + +helps[ + 'connectedvmware virtual-network list' +] = """ + type: command + short-summary: "Retrieve a list of virtual network of given resource group" + examples: + - name: Retrieve a list of virtual network resource + text: |- + az connectedvmware virtual-network list --resource-group "resource group name" +""" + +helps[ + 'connectedvmware virtual-network show' +] = """ + type: command + short-summary: "Get details of a virtual network by id, resource-group, reource pool name or subscription" + examples: + - name: Get details of a virtual-network + text: |- + az connectedvmware virtual-network show --ids "resource id" --name "virtual network name" \ + --resource-group "resource group name" --subscription "subscription id" +""" + +helps[ + 'connectedvmware vm' +] = """ + type: group + short-summary: vm resource +""" + +helps[ + 'connectedvmware vm create' +] = """ + type: command + short-summary: "Create vm in vcenter from existing vm template" + examples: + - name: Create vm + text: |- + az connectedvmware vm create --custom-location "custom location name" --location \ + "Region name" --name "virtual network name" --resource-group "resource group name" \ + --vcenter "name or id of the vcenter" --inventory-item "inventory item name or id" +""" + +helps[ + 'connectedvmware vm delete' +] = """ + type: command + short-summary: "Delete vm resource" + examples: + - name: Delete vm + text: |- + az connectedvmware vm delete --ids "resource id" --name "virtual machine name" \ + --resource-group "resource group name" --subscription "subscription id" +""" + +helps[ + 'connectedvmware vm list' +] = """ + type: command + short-summary: "Retrieve a list of vm of given resource group" + examples: + - name: Retrieve a list of vm resource + text: |- + az connectedvmware vm list --resource-group "resource group name" +""" + +helps[ + 'connectedvmware vm restart' +] = """ + type: command + short-summary: "Restart vm resource" + examples: + - name: Restart vm + text: |- + az connectedvmware vm restart --ids "resource id" --name "virtual machine name" \ + --resource-group "resource group name" --subscription "subscription id" +""" + +helps[ + 'connectedvmware vm show' +] = """ + type: command + short-summary: "Get details of a vm by id, resource-group, reource pool name or subscription" + examples: + - name: Get details of a vm resource + text: |- + az connectedvmware vm show --ids "resource id" --name "vm template name" \ + --resource-group "resource group name" --subscription "subscription id" +""" + +helps[ + 'connectedvmware vm start' +] = """ + type: command + short-summary: "Start vm resource" + examples: + - name: Start vm + text: |- + az connectedvmware vm start --ids "resource id" --name "virtual machine name" \ + --resource-group "resource group name" --subscription "subscription id" +""" + +helps[ + 'connectedvmware vm stop' +] = """ + type: command + short-summary: "Stop vm resource" + examples: + - name: Stop vm + text: |- + az connectedvmware vm stop --ids "resource id" --name "virtual machine name" \ + --resource-group "resource group name" --subscription "subscription id" +""" + +helps[ + 'connectedvmware vm update' +] = """ + type: command + short-summary: "Update vm resource" + examples: + - name: Update vm + text: |- + az connectedvmware vm update --ids "resource id" --name "virtual machine name" \ + --resource-group "resource group name" --subscription "subscription id" \ + --memory-size --num-CPUs +""" + +helps[ + 'connectedvmware vm-template' +] = """ + type: group + short-summary: vm template resource +""" + +helps[ + 'connectedvmware vm-template create' +] = """ + type: command + short-summary: "Create vm template resource" + examples: + - name: Create vm template + text: |- + az connectedvmware vm-template create --custom-location "custom location name" \ + --location "region name" --mo-ref-id "mo-ref id of the resource in vc" --name \ + "vm template name" --resource-group "resource group name" --vcenter \ + "name or id of the vcenter" --inventory-item "inventory item name or id" +""" + +helps[ + 'connectedvmware vm-template delete' +] = """ + type: command + short-summary: "Delete vm template resource" + examples: + - name: Delete virtual template + text: |- + az connectedvmware vm-template delete --ids "resource id" --name "vm template name" \ + --resource-group "resource group name" --subscription "subscription id" +""" + +helps[ + 'connectedvmware vm-template list' +] = """ + type: command + short-summary: "Retrieve a list of vm template of given resource group" + examples: + - name: Retrieve a list of vm template resource + text: |- + az connectedvmware vm-template list --resource-group "resource group name" +""" + +helps[ + 'connectedvmware vm-template show' +] = """ + type: command + short-summary: "Get details of a vm template by id, resource-group, reource pool name or subscription" + examples: + - name: Get details of a vm template + text: |- + az connectedvmware vm-template show --ids "resource id" --name "vm template name" \ + --resource-group "resource group name" --subscription "subscription id" +""" +helps[ + 'connectedvmware inventory-item' +] = """ + type: group + short-summary: inventory item resource. +""" + +helps[ + 'connectedvmware inventory-item list' +] = """ + type: command + short-summary: "Retrieve a list of inventory item given by resource group and vcenter name." + examples: + - name: Retrieve a list of inventory item + text: |- + az connectedvmware inventory-item list --resource-group "resource group name" \ + --vcenter-name "name of the vcenter" +""" + +helps[ + 'connectedvmware inventory-item show' +] = """ + type: command + short-summary: "Get details of a inventory item by inventory item, resource-group and vcenter name." + examples: + - name: Get details of a vm template + text: |- + az connectedvmware inventory-item show --inventory-item-name "name of the inventory item" \ + --resource-group "resource group name" --vcenter-name "name of the vcenter" +""" diff --git a/src/connectedvmware/azext_connectedvmware/_params.py b/src/connectedvmware/azext_connectedvmware/_params.py new file mode 100644 index 00000000000..7821a71889d --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/_params.py @@ -0,0 +1,321 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=line-too-long + +from knack.arguments import CLIArgumentType +from ._actions import VmNicAddAction, VmDiskAddAction + + +def load_arguments(self, _): + + from azure.cli.core.commands.parameters import tags_type + from azure.cli.core.commands.validators import ( + get_default_location_from_resource_group, + ) + from azext_connectedvmware.vendored_sdks.models import NICType, PowerOnBootOption + + connectedvmware_name_type = CLIArgumentType( + options_list='--resource-name', help='Name of the resource.', id_part='name' + ) + + with self.argument_context('connectedvmware') as c: + c.argument('tags', tags_type) + c.argument('location', validator=get_default_location_from_resource_group) + c.argument( + 'resource_name', connectedvmware_name_type, options_list=['--name', '-n'] + ) + + with self.argument_context('connectedvmware vcenter connect') as c: + c.argument( + 'fqdn', options_list=['--fqdn'], help="FQDN/IP address of the vCenter." + ) + c.argument( + 'port', type=int, options_list=['--port'], help="The port of the vCenter." + ) + c.argument( + 'custom_location', + options_list=['--custom-location'], + help="Name or ID of the custom location that will manage this vCenter.", + ) + c.argument( + 'username', + options_list=['--username'], + help="Username to use for connecting to the vCenter.", + ) + c.argument( + 'password', + options_list=['--password'], + help="Username password credentials to use for connecting to the vCenter.", + ) + + with self.argument_context('connectedvmware vcenter delete') as c: + c.argument('force', action='store_true', help="Whether force delete or not.") + + with self.argument_context('connectedvmware resource-pool create') as c: + c.argument( + 'custom_location', + options_list=['--custom-location'], + help="Name or ID of the custom location that is managing this resource pool.", + ) + c.argument( + 'vcenter', + options_list=['--vcenter'], + help="Name or ID of the vCenter that is managing this resource pool.", + ) + c.argument( + 'mo_ref_id', + options_list=['--mo-ref-id'], + help="VCenter MoRef (Managed Object Reference) ID for the existing resource pool.", + ) + c.argument( + 'inventory_item', + options_list=['--inventory-item'], + help="Name or ID of the inventory item.", + ) + + with self.argument_context('connectedvmware resource-pool delete') as c: + c.argument('force', action='store_true', help="Whether force delete or not.") + + with self.argument_context('connectedvmware virtual-network create') as c: + c.argument( + 'custom_location', + options_list=['--custom-location'], + help="Name or ID of the custom location that is managing this virtual network.", + ) + c.argument( + 'vcenter', + options_list=['--vcenter'], + help="Name or ID of the vCenter that is managing this virtual network.", + ) + c.argument( + 'mo_ref_id', + options_list=['--mo-ref-id'], + help="VCenter MoRef (Managed Object Reference) ID for the existing virtual network.", + ) + c.argument( + 'inventory_item', + options_list=['--inventory-item'], + help="Name or ID of the inventory item.", + ) + + with self.argument_context('connectedvmware virtual-network delete') as c: + c.argument('force', action='store_true', help="Whether force delete or not.") + + with self.argument_context('connectedvmware vm-template create') as c: + c.argument( + 'arc_zone', + options_list=['--arc-zone'], + help="Name or ID of the Arc zone that is managing this vm template.", + ) + c.argument( + 'vcenter', + options_list=['--vcenter'], + help="Name or ID of the vCenter that is managing this vm template.", + ) + c.argument( + 'mo_ref_id', + options_list=['--mo-ref-id'], + help="VCenter MoRef (Managed Object Reference) ID for the existing vm template.", + ) + c.argument( + 'custom_location', + options_list=['--custom-location'], + help="Name or ID of the custom location that will manage this vCenter.", + ) + c.argument( + 'inventory_item', + options_list=['--inventory-item'], + help="Name or ID of the inventory item.", + ) + + with self.argument_context('connectedvmware vm-template delete') as c: + c.argument('force', action='store_true', help="Whether force delete or not.") + + with self.argument_context('connectedvmware vm create') as c: + c.argument( + 'arc_zone', + options_list=['--arc-zone'], + help="Name or ID of the Arc zone to deploy the vm.", + ) + c.argument( + 'vcenter', + options_list=['--vcenter'], + help="Name or ID of the vCenter to deploy the vm.", + ) + c.argument( + 'vm_template', + options_list=['--vm-template'], + help="Name or ID of the vm template for deploying the vm.", + ) + c.argument( + 'resource_pool', + options_list=['--resource-pool'], + help="Name or ID of the resource pool for deploying the vm.", + ) + c.argument( + 'inventory_item', + options_list=['--inventory-item'], + help="Name or ID of the inventory item.", + ) + c.argument( + 'admin_username', + options_list=['--admin-username'], + help="Admin username for the vm.", + ) + c.argument( + 'admin_password', + options_list=['--admin-password'], + help="Admin password for the vm.", + ) + c.argument( + 'num_CPUs', + type=int, + options_list=['--num-CPUs'], + help="Number of desired vCPUs for the vm.", + ) + c.argument( + 'num_cores_per_socket', + type=int, + options_list=['--num-cores-per-socket'], + help="Number of desired cores per socket for the vm.", + ) + c.argument( + 'memory_size', + type=int, + options_list=['--memory-size'], + help="Desired memory size in MBs for the vm.", + ) + c.argument( + 'nics', + options_list=['--nic'], + action=VmNicAddAction, + nargs='+', + help="Network overrides for the vm. " + "Usage: --nic name=<> network=<> nic-type=<> power-on-boot=<> " + "allocation-method=<> ip-address=<> subnet-mask=<> device-key=<> " + "gateway=.", + ) + c.argument( + 'disks', + options_list=['--disk'], + action=VmDiskAddAction, + nargs='+', + help="Disk overrides for the vm. " + "Usage: --disk name=<> disk_size=<> disk_mode=<> controller_key=<> " + "device-key=<> unit_number=<>.", + ) + + with self.argument_context('connectedvmware vm update') as c: + c.argument( + 'num_CPUs', + type=int, + options_list=['--num-CPUs'], + help="Number of desired vCPUs for the vm.", + ) + c.argument( + 'num_cores_per_socket', + type=int, + options_list=['--num-cores-per-socket'], + help="Number of desired cores per socket for the vm.", + ) + c.argument( + 'memory_size', + type=int, + options_list=['--memory-size'], + help="Desired memory size in MBs for the vm.", + ) + c.argument('tags', arg_type=tags_type) + + with self.argument_context('connectedvmware vm delete') as c: + c.argument('force', action='store_true', help="Whether force delete or not.") + + with self.argument_context('connectedvmware vm stop') as c: + c.argument( + 'skip_shutdown', + action='store_true', + help="Skips shutdown and power-off immediately.", + ) + + with self.argument_context('connectedvmware vm nic') as c: + c.argument('nic_name', options_list=['--name', '-n'], help="Name of the NIC.") + c.argument( + 'vm_name', options_list=['--vm-name'], help="Name of the virtual machine." + ) + c.argument( + 'network', + options_list=['--network'], + help="Name or Id of the virtual network.", + ) + c.argument( + 'nic_type', options_list=['--nic-type'], help="The nic type for the NIC." + ) + c.argument( + 'power_on_boot', + options_list=['--power-on-boot'], + help="The power on boot option for the nic.", + ) + c.argument( + 'device_key', + type=int, + options_list=['--device-key'], + help="The device key for the nic.", + ) + c.argument( + 'nic_names', options_list=['--nics'], nargs='+', help="Names of the NICs." + ) + + with self.argument_context('connectedvmware vm disk') as c: + c.argument('disk_name', options_list=['--name', '-n'], help="Name of the Disk.") + c.argument( + 'vm_name', options_list=['--vm-name'], help="Name of the virtual machine." + ) + c.argument( + 'disk_size', + type=int, + options_list=['--disk-size'], + help="The disk size in GBs.", + ) + c.argument( + 'disk_mode', options_list=['--disk-mode'], help="The mode of the disk." + ) + c.argument( + 'controller_key', + type=int, + options_list=['--controller-key'], + help="The controller key of the disk.", + ) + c.argument( + 'unit_number', + type=int, + options_list=['--unit-number'], + help="The unit number of the disk.", + ) + c.argument( + 'device_key', + type=int, + options_list=['--device-key'], + help="The device key for the disk.", + ) + c.argument( + 'disk_names', + options_list=['--disks'], + nargs='+', + help="Names of the Disks.", + ) + + with self.argument_context('connectedvmware inventory-item list') as c: + c.argument( + 'vcenter_name', options_list=['--vcenter-name'], help="Name of the vCenter." + ) + + with self.argument_context('connectedvmware inventory-item show') as c: + c.argument( + 'vcenter_name', options_list=['--vcenter-name'], help="Name of the vCenter." + ) + c.argument( + 'inventory_item_name', + options_list=['--inventory-item-name'], + help="Name of the inventory item.", + ) diff --git a/src/connectedvmware/azext_connectedvmware/_validators.py b/src/connectedvmware/azext_connectedvmware/_validators.py new file mode 100644 index 00000000000..81e3f340d08 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/_validators.py @@ -0,0 +1,22 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +def example_name_or_id_validator(cmd, namespace): + # This is an example validator , we can write our validators using this pattern as needed. + # Example of a storage account name or ID validator. + # See: https://github.com/Azure/azure-cli/blob/dev/doc/authoring_command_modules/authoring_commands.md#supporting-name-or-id-parameters + from azure.cli.core.commands.client_factory import get_subscription_id + from msrestazure.tools import is_valid_resource_id, resource_id + + if namespace.storage_account: + if not is_valid_resource_id(namespace.RESOURCE): + namespace.storage_account = resource_id( + subscription=get_subscription_id(cmd.cli_ctx), + resource_group=namespace.resource_group_name, + namespace='Microsoft.Storage', + type='storageAccounts', + name=namespace.storage_account, + ) diff --git a/src/connectedvmware/azext_connectedvmware/azext_metadata.json b/src/connectedvmware/azext_connectedvmware/azext_metadata.json new file mode 100644 index 00000000000..c4ecfd144bd --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/azext_metadata.json @@ -0,0 +1,5 @@ +{ + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.0.67", + "azext.maxCliCoreVersion": "4.0.0" +} \ No newline at end of file diff --git a/src/connectedvmware/azext_connectedvmware/commands.py b/src/connectedvmware/azext_connectedvmware/commands.py new file mode 100644 index 00000000000..eb5b27faf7c --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/commands.py @@ -0,0 +1,87 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long +from azure.cli.core.commands import CliCommandType +from ._client_factory import ( + cf_vcenter, + cf_resource_pool, + cf_virtual_network, + cf_virtual_machine_template, + cf_virtual_machine, + cf_inventory_item, +) + + +def load_command_table(self, _): + + with self.command_group('connectedvmware vcenter', client_factory=cf_vcenter) as g: + g.custom_command('connect', 'connect_vcenter', supports_no_wait=True) + g.custom_command('delete', 'delete_vcenter', supports_no_wait=True) + g.custom_command('show', 'show_vcenter') + g.custom_command('list', 'list_vcenter') + + with self.command_group( + 'connectedvmware resource-pool', client_factory=cf_resource_pool + ) as g: + g.custom_command('create', 'create_resource_pool', supports_no_wait=True) + g.custom_command('delete', 'delete_resource_pool', supports_no_wait=True) + g.custom_command('show', 'show_resource_pool') + g.custom_command('list', 'list_resource_pool') + + with self.command_group( + 'connectedvmware virtual-network', client_factory=cf_virtual_network + ) as g: + g.custom_command('create', 'create_virtual_network', supports_no_wait=True) + g.custom_command('delete', 'delete_virtual_network', supports_no_wait=True) + g.custom_command('show', 'show_virtual_network') + g.custom_command('list', 'list_virtual_network') + + with self.command_group( + 'connectedvmware vm-template', client_factory=cf_virtual_machine_template + ) as g: + g.custom_command('create', 'create_vm_template', supports_no_wait=True) + g.custom_command('delete', 'delete_vm_template', supports_no_wait=True) + g.custom_command('show', 'show_vm_template') + g.custom_command('list', 'list_vm_template') + + with self.command_group( + 'connectedvmware vm', client_factory=cf_virtual_machine + ) as g: + g.custom_command('create', 'create_vm', supports_no_wait=True) + g.custom_command('delete', 'delete_vm', supports_no_wait=True) + g.custom_command('update', 'update_vm', supports_no_wait=True) + g.custom_command('show', 'show_vm') + g.custom_command('list', 'list_vm') + g.custom_command('start', 'start_vm', supports_no_wait=True) + g.custom_command('stop', 'stop_vm', supports_no_wait=True) + g.custom_command('restart', 'restart_vm', supports_no_wait=True) + + with self.command_group( + 'connectedvmware vm nic', client_factory=cf_virtual_machine + ) as g: + g.custom_command('add', 'add_nic', supports_no_wait=True) + g.custom_command('update', 'update_nic', supports_no_wait=True) + g.custom_command('delete', 'delete_nics', supports_no_wait=True) + g.custom_command('show', 'show_nic') + g.custom_command('list', 'list_nics') + + with self.command_group( + 'connectedvmware vm disk', client_factory=cf_virtual_machine + ) as g: + g.custom_command('add', 'add_disk', supports_no_wait=True) + g.custom_command('update', 'update_disk', supports_no_wait=True) + g.custom_command('delete', 'delete_disks', supports_no_wait=True) + g.custom_command('show', 'show_disk') + g.custom_command('list', 'list_disks') + + with self.command_group( + 'connectedvmware inventory-item', client_factory=cf_inventory_item + ) as g: + g.custom_command('show', 'show_inventory_item') + g.custom_command('list', 'list_inventory_item') + + with self.command_group('connectedvmware', is_preview=False): + pass \ No newline at end of file diff --git a/src/connectedvmware/azext_connectedvmware/custom.py b/src/connectedvmware/azext_connectedvmware/custom.py new file mode 100644 index 00000000000..4764165e78e --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/custom.py @@ -0,0 +1,1244 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from knack.util import CLIError +from azext_connectedvmware.vmware_constants import * +from azext_connectedvmware.vmware_utils import get_resource_id +from azure.cli.core.util import sdk_no_wait +from .vmware_constants import ( + CUSTOM_LOCATION_RESOURCE_TYPE, + EXTENDED_LOCATION_TYPE, +) +from .vendored_sdks.models import ( + DiskMode, + HardwareProfile, + IPAddressAllocationMethod, + NetworkInterface, + NetworkInterfaceUpdate, + NetworkProfile, + NetworkProfileUpdate, + NicIPSettings, + NICType, + OsProfile, + PowerOnBootOption, + ResourcePool, + StorageProfile, + StorageProfileUpdate, + VCenter, + VICredential, + VirtualDisk, + VirtualDiskUpdate, + VirtualMachine, + VirtualMachineTemplate, + VirtualMachineUpdate, + VirtualNetwork, + ExtendedLocation, +) + +from .vendored_sdks.operations import ( + VCentersOperations, + ResourcePoolsOperations, + VirtualNetworksOperations, + VirtualMachineTemplatesOperations, + VirtualMachinesOperations, + InventoryItemsOperations, +) + +# endregion + +# region VCenters + + +def connect_vcenter( + cmd, + client: VCentersOperations, + resource_group_name, + resource_name, + fqdn, + custom_location, + location, + username=None, + password=None, + port=DEFAULT_VCENTER_PORT, + tags=None, + no_wait=False, +): + + if username is None or password is None: + raise CLIError("Missing vcenter credentials, provide username/password") + + username_creds = VICredential(username=username, password=password) + + custom_location_id = get_resource_id( + cmd, + resource_group_name, + EXTENDED_LOCATION_NAMESPACE, + CUSTOM_LOCATION_RESOURCE_TYPE, + custom_location, + ) + + extended_location = ExtendedLocation( + type=EXTENDED_LOCATION_TYPE, name=custom_location_id + ) + + vcenter = VCenter( + location=location, + fqdn=fqdn, + port=port, + extended_location=extended_location, + credentials=username_creds, + ) + + return sdk_no_wait( + no_wait, client.begin_create, resource_group_name, resource_name, vcenter + ) + + +def delete_vcenter( + cmd, + client: VCentersOperations, + resource_group_name, + resource_name, + force=False, + no_wait=False, +): + + return sdk_no_wait( + no_wait, client.begin_delete, resource_group_name, resource_name, force + ) + + +def show_vcenter(cmd, client: VCentersOperations, resource_group_name, resource_name): + + return client.get(resource_group_name, resource_name) + + +def list_vcenter(cmd, client: VCentersOperations, resource_group_name=None): + + if resource_group_name: + return client.list_by_resource_group(resource_group_name) + return client.list() + + +# endregion + +# region ResourcePools + + +def create_resource_pool( + cmd, + client: ResourcePoolsOperations, + resource_group_name, + resource_name, + custom_location, + location, + vcenter=None, + mo_ref_id=None, + inventory_item=None, + tags=None, + no_wait=False, +): + + if mo_ref_id is None and inventory_item is None: + raise CLIError( + "Missing parameter, provide either mo_ref_id or inventory_item id." + ) + + custom_location_id = get_resource_id( + cmd, + resource_group_name, + EXTENDED_LOCATION_NAMESPACE, + CUSTOM_LOCATION_RESOURCE_TYPE, + custom_location, + ) + + extended_location = ExtendedLocation( + type=EXTENDED_LOCATION_TYPE, name=custom_location_id + ) + + inventory_item_id = None + vcenter_id = None + + if inventory_item is not None: + inventory_item_id = get_resource_id( + cmd, + resource_group_name, + VMWARE_NAMESPACE, + VCENTER_RESOURCE_TYPE, + vcenter, + INVENTORY_ITEM_TYPE, + inventory_item, + ) + else: + if vcenter is None: + raise CLIError( + "Missing parameter, provide vcenter name or id." + ) + + vcenter_id = get_resource_id( + cmd, resource_group_name, VMWARE_NAMESPACE, VCENTER_RESOURCE_TYPE, vcenter + ) + + if inventory_item_id is not None: + resource_pool = ResourcePool( + location=location, + extended_location=extended_location, + inventory_item_id=inventory_item_id, + ) + else: + resource_pool = ResourcePool( + location=location, + extended_location=extended_location, + v_center_id=vcenter_id, + mo_ref_id=mo_ref_id, + ) + + return sdk_no_wait( + no_wait, client.begin_create, resource_group_name, resource_name, resource_pool + ) + + +def delete_resource_pool( + cmd, + client: ResourcePoolsOperations, + resource_group_name, + resource_name, + force=False, + no_wait=False, +): + + return sdk_no_wait( + no_wait, client.begin_delete, resource_group_name, resource_name, force + ) + + +def show_resource_pool( + cmd, client: ResourcePoolsOperations, resource_group_name, resource_name +): + + return client.get(resource_group_name, resource_name) + + +def list_resource_pool(cmd, client: ResourcePoolsOperations, resource_group_name=None): + + if resource_group_name: + return client.list_by_resource_group(resource_group_name) + return client.list() + + +# endregion + +# region VirtualNetworks + + +def create_virtual_network( + cmd, + client: VirtualNetworksOperations, + resource_group_name, + resource_name, + custom_location, + location, + vcenter=None, + mo_ref_id=None, + inventory_item=None, + tags=None, + no_wait=False, +): + + if mo_ref_id is None and inventory_item is None: + raise CLIError( + "Missing parameter, provide either mo_ref_id or inventory_item id." + ) + + custom_location_id = get_resource_id( + cmd, + resource_group_name, + EXTENDED_LOCATION_NAMESPACE, + CUSTOM_LOCATION_RESOURCE_TYPE, + custom_location, + ) + + extended_location = ExtendedLocation( + type=EXTENDED_LOCATION_TYPE, name=custom_location_id + ) + + inventory_item_id = None + vcenter_id = None + + if inventory_item is not None: + inventory_item_id = get_resource_id( + cmd, + resource_group_name, + VMWARE_NAMESPACE, + VCENTER_RESOURCE_TYPE, + vcenter, + INVENTORY_ITEM_TYPE, + inventory_item, + ) + else: + if vcenter is None: + raise CLIError( + "Missing parameter, provide vcenter name or id." + ) + + vcenter_id = get_resource_id( + cmd, resource_group_name, VMWARE_NAMESPACE, VCENTER_RESOURCE_TYPE, vcenter + ) + + if inventory_item_id is not None: + virtual_network = VirtualNetwork( + location=location, + extended_location=extended_location, + inventory_item_id=inventory_item_id, + ) + else: + virtual_network = VirtualNetwork( + location=location, + extended_location=extended_location, + v_center_id=vcenter_id, + mo_ref_id=mo_ref_id, + ) + + return sdk_no_wait( + no_wait, + client.begin_create, + resource_group_name, + resource_name, + virtual_network, + ) + + +def delete_virtual_network( + cmd, + client: VirtualNetworksOperations, + resource_group_name, + resource_name, + force=False, + no_wait=False, +): + + return sdk_no_wait( + no_wait, client.begin_delete, resource_group_name, resource_name, force + ) + + +def show_virtual_network( + cmd, client: VirtualNetworksOperations, resource_group_name, resource_name +): + + return client.get(resource_group_name, resource_name) + + +def list_virtual_network( + cmd, client: VirtualNetworksOperations, resource_group_name=None +): + + if resource_group_name: + return client.list_by_resource_group(resource_group_name) + return client.list() + + +# endregion + +# region VirtualMachineTemplates + + +def create_vm_template( + cmd, + client: VirtualMachineTemplatesOperations, + resource_group_name, + resource_name, + custom_location, + location, + vcenter=None, + mo_ref_id=None, + inventory_item=None, + tags=None, + no_wait=True, +): + + if mo_ref_id is None and inventory_item is None: + raise CLIError( + "Missing parameter, provide either mo_ref_id or inventory_item id." + ) + + custom_location_id = get_resource_id( + cmd, + resource_group_name, + EXTENDED_LOCATION_NAMESPACE, + CUSTOM_LOCATION_RESOURCE_TYPE, + custom_location, + ) + + extended_location = ExtendedLocation( + type=EXTENDED_LOCATION_TYPE, name=custom_location_id + ) + + inventory_item_id = None + vcenter_id = None + + if inventory_item is not None: + inventory_item_id = get_resource_id( + cmd, + resource_group_name, + VMWARE_NAMESPACE, + VCENTER_RESOURCE_TYPE, + vcenter, + INVENTORY_ITEM_TYPE, + inventory_item, + ) + else: + if vcenter is None: + raise CLIError( + "Missing parameter, provide vcenter name or id." + ) + + vcenter_id = get_resource_id( + cmd, resource_group_name, VMWARE_NAMESPACE, VCENTER_RESOURCE_TYPE, vcenter + ) + + if inventory_item_id is not None: + vm_template = VirtualMachineTemplate( + location=location, + extended_location=extended_location, + inventory_item_id=inventory_item_id, + ) + else: + vm_template = VirtualMachineTemplate( + location=location, + extended_location=extended_location, + v_center_id=vcenter_id, + mo_ref_id=mo_ref_id, + ) + + return sdk_no_wait( + no_wait, client.begin_create, resource_group_name, resource_name, vm_template + ) + + +def delete_vm_template( + cmd, + client: VirtualMachineTemplatesOperations, + resource_group_name, + resource_name, + force=False, + no_wait=False, +): + + return sdk_no_wait( + no_wait, client.begin_delete, resource_group_name, resource_name, force + ) + + +def show_vm_template( + cmd, client: VirtualMachineTemplatesOperations, resource_group_name, resource_name +): + + return client.get(resource_group_name, resource_name) + + +def list_vm_template( + cmd, client: VirtualMachineTemplatesOperations, resource_group_name=None +): + + if resource_group_name: + return client.list_by_resource_group(resource_group_name) + return client.list() + + +# region VirtualMachines + + +def create_vm( + cmd, + client: VirtualMachinesOperations, + resource_group_name, + resource_name, + custom_location, + location, + vcenter=None, + resource_pool=None, + vm_template=None, + inventory_item=None, + admin_username=None, + admin_password=None, + num_CPUs=None, + num_cores_per_socket=None, + memory_size=None, + nics=None, + disks=None, + tags=None, + no_wait=False, +): + + if vm_template is None and inventory_item is None: + raise CLIError( + "Missing parameter, provide either vm_template or inventory_item id." + ) + + hardware_profile = None + os_profile = None + network_profile = None + storage_profile = None + + if num_CPUs is not None or memory_size is not None: + hardware_profile = HardwareProfile( + memory_size_mb=memory_size, + num_cp_us=num_CPUs, + num_cores_per_socket=num_cores_per_socket, + ) + + if admin_password is not None: + os_profile = OsProfile( + admin_username=admin_username, admin_password=admin_password + ) + + if nics is not None: + network_profile = NetworkProfile( + network_interfaces=get_network_interfaces( + cmd, client, resource_group_name, nics + ) + ) + + if disks is not None: + storage_profile = StorageProfile( + disks=get_disks(cmd, client, resource_group_name, disks) + ) + + custom_location_id = get_resource_id( + cmd, + resource_group_name, + EXTENDED_LOCATION_NAMESPACE, + CUSTOM_LOCATION_RESOURCE_TYPE, + custom_location, + ) + + extended_location = ExtendedLocation( + type=EXTENDED_LOCATION_TYPE, name=custom_location_id + ) + + inventory_item_id = None + vcenter_id = None + vm_template_id = None + resource_pool_id = None + + if inventory_item is not None: + inventory_item_id = get_resource_id( + cmd, + resource_group_name, + VMWARE_NAMESPACE, + VCENTER_RESOURCE_TYPE, + vcenter, + INVENTORY_ITEM_TYPE, + inventory_item, + ) + else: + if vcenter is None: + raise CLIError( + "Missing parameter, provide vcenter name or id." + ) + + vcenter_id = get_resource_id( + cmd, resource_group_name, VMWARE_NAMESPACE, VCENTER_RESOURCE_TYPE, vcenter + ) + + if vm_template is not None: + vm_template_id = get_resource_id( + cmd, + resource_group_name, + VMWARE_NAMESPACE, + VMTEMPLATE_RESOURCE_TYPE, + vm_template, + ) + + if resource_pool is not None: + resource_pool_id = get_resource_id( + cmd, + resource_group_name, + VMWARE_NAMESPACE, + RESOURCEPOOL_RESOURCE_TYPE, + resource_pool, + ) + + if inventory_item_id is not None: + vm = VirtualMachine( + location=location, + extended_location=extended_location, + hardware_profile=hardware_profile, + os_profile=os_profile, + network_profile=network_profile, + storage_profile=storage_profile, + inventory_item_id=inventory_item_id, + ) + else: + vm = VirtualMachine( + location=location, + extended_location=extended_location, + v_center_id=vcenter_id, + resource_pool_id=resource_pool_id, + template_id=vm_template_id, + hardware_profile=hardware_profile, + os_profile=os_profile, + network_profile=network_profile, + storage_profile=storage_profile, + ) + + return sdk_no_wait( + no_wait, client.begin_create, resource_group_name, resource_name, vm + ) + + +def update_vm( + cmd, + client: VirtualMachinesOperations, + resource_group_name, + resource_name, + num_CPUs=None, + num_cores_per_socket=None, + memory_size=None, + tags=None, + no_wait=False, +): + + hardware_profile = None + + if ( + num_CPUs is None + and num_cores_per_socket is None + and memory_size is None + and tags is None + ): + raise CLIError("No inputs were given to update the vm.") + + if ( + num_CPUs is not None + or num_cores_per_socket is not None + or memory_size is not None + ): + hardware_profile = HardwareProfile( + memory_size_mb=memory_size, + num_cp_us=num_CPUs, + num_cores_per_socket=num_cores_per_socket, + ) + + vm_update = VirtualMachineUpdate(hardware_profile=hardware_profile) + return sdk_no_wait( + no_wait, + client.begin_update, + resource_group_name, + resource_name, + vm_update, + tags, + ) + + +def delete_vm( + cmd, + client: VirtualMachinesOperations, + resource_group_name, + resource_name, + force=False, + no_wait=False, +): + + return sdk_no_wait( + no_wait, client.begin_delete, resource_group_name, resource_name, force + ) + + +def show_vm(cmd, client: VirtualMachinesOperations, resource_group_name, resource_name): + + return client.get(resource_group_name, resource_name) + + +def list_vm(cmd, client: VirtualMachinesOperations, resource_group_name=None): + + if resource_group_name: + return client.list_by_resource_group(resource_group_name) + return client.list() + + +def start_vm( + cmd, + client: VirtualMachinesOperations, + resource_group_name, + resource_name, + no_wait=False, +): + + return sdk_no_wait(no_wait, client.begin_start, resource_group_name, resource_name) + + +def stop_vm( + cmd, + client: VirtualMachinesOperations, + resource_group_name, + resource_name, + skip_shutdown=False, + no_wait=False, +): + + return sdk_no_wait( + no_wait, + client.begin_stop, + resource_group_name, + resource_name, + str(skip_shutdown).lower(), + ) + + +def restart_vm( + cmd, + client: VirtualMachinesOperations, + resource_group_name, + resource_name, + no_wait=False, +): + + return sdk_no_wait( + no_wait, client.begin_restart, resource_group_name, resource_name + ) + + +def get_network_interfaces( + cmd, client: VirtualMachinesOperations, resource_group_name, input_nics +): + """ + Gets network interfaces from the given input. + """ + + nics = [] + + for input_nic in input_nics: + nic = NetworkInterface( + power_on_boot=PowerOnBootOption.enabled, nic_type=NICType.vmxnet3 + ) + + ip_settings = NicIPSettings(allocation_method=IPAddressAllocationMethod.dynamic) + + for key, value in input_nic.items(): + if key == NETWORK: + nic.network_id = get_resource_id( + cmd, + resource_group_name, + VMWARE_NAMESPACE, + VIRTUALNETWORK_RESOURCE_TYPE, + value, + ) + elif key == NAME_PARAMETER: + nic.name = value + elif key == DEVICE_KEY: + nic.device_key = value + elif key == NIC_TYPE: + nic.nic_type = value + elif key == POWER_ON_BOOT: + nic.power_on_boot = value + elif key == ALLOCATION_METHOD: + ip_settings.allocation_method = value + elif key == IP_ADDRESS: + ip_settings.ip_address = value + elif key == SUBNET_MASK: + ip_settings.subnet_mask = value + elif key == GATEWAY: + ip_settings.gateway = value.split(GATEWAY_SEPERATOR) + else: + raise CLIError( + 'Invalid parameter: {name} specified for nic.'.format(name=key) + ) + + nic.ip_settings = ip_settings + nics.append(nic) + return nics + + +def get_disks(cmd, client: VirtualMachinesOperations, resource_group_name, input_disks): + """ + Gets disks from the given input. + """ + + disks = [] + for input_disk in input_disks: + disk = VirtualDisk() + for key, value in input_disk.items(): + if key == NAME_PARAMETER: + disk.name = value + elif key == DEVICE_KEY: + disk.device_key = value + elif key == DISK_MODE: + disk.disk_mode = value + elif key == DISK_SIZE: + disk.disk_size_gb = value + elif key == CONTROLLER_KEY: + disk.controller_key = value + elif key == UNIT_NUMBER: + disk.unit_number = value + else: + raise CLIError( + 'Invalid parameter: {name} specified for disk.'.format(name=key) + ) + disks.append(disk) + return disks + + +# endregion + +# region VirtualMachine Nics. + + +def add_nic( + cmd, + client: VirtualMachinesOperations, + resource_group_name, + vm_name, + nic_name, + network, + nic_type=NICType.vmxnet3.name, + power_on_boot=PowerOnBootOption.disabled.name, + no_wait=False, +): + """ + Add virtual network interface to a virtual machine. + """ + + network_id = get_resource_id( + cmd, + resource_group_name, + VMWARE_NAMESPACE, + VIRTUALNETWORK_RESOURCE_TYPE, + network, + ) + + nic_to_add = NetworkInterfaceUpdate( + name=nic_name, + network_id=network_id, + power_on_boot=power_on_boot, + nic_type=nic_type, + ) + + nics_update = [] + vm = client.get(resource_group_name, vm_name) + if ( + vm.network_profile is not None + and vm.network_profile.network_interfaces is not None + ): + for nic in vm.network_profile.network_interfaces: + nic_update = NetworkInterfaceUpdate( + name=nic.name, + network_id=nic.network_id, + power_on_boot=nic.power_on_boot, + nic_type=nic.nic_type, + device_key=nic.device_key, + ) + nics_update.append(nic_update) + + nics_update.append(nic_to_add) + network_profile = NetworkProfileUpdate(network_interfaces=nics_update) + vm_update = VirtualMachineUpdate(network_profile=network_profile) + + return sdk_no_wait( + no_wait, client.begin_update, resource_group_name, vm_name, vm_update + ) + + +def update_nic( + cmd, + client: VirtualMachinesOperations, + resource_group_name, + vm_name, + nic_name=None, + network=None, + power_on_boot=None, + device_key=None, + no_wait=False, +): + """ + Update virtual network interface of a virtual machine. + """ + + if nic_name is None and device_key is None: + raise CLIError( + "Either nic name or device key must be specified to update the nic." + ) + + network_id = None + if network is not None: + network_id = get_resource_id( + cmd, + resource_group_name, + VMWARE_NAMESPACE, + VIRTUALNETWORK_RESOURCE_TYPE, + network, + ) + + nics_update = [] + nic_found = False + vm = client.get(resource_group_name, vm_name) + if ( + vm.network_profile is not None + and vm.network_profile.network_interfaces is not None + ): + for nic in vm.network_profile.network_interfaces: + nic_update = NetworkInterfaceUpdate( + name=nic.name, + network_id=nic.network_id, + power_on_boot=nic.power_on_boot, + nic_type=nic.nic_type, + device_key=nic.device_key, + ) + + if (nic_name is not None and nic.name == nic_name) or ( + device_key is not None and nic.device_key == device_key + ): + + # Validate nic name is matching with the expected device key if both were given in + # the input when name is already assigned to the nic. + if ( + nic_name is not None + and nic.name is not None + and nic.name != nic_name + ) or (device_key is not None and nic.device_key != device_key): + raise CLIError( + "Incorrect nic-name and device-key combination, Expected " + + "nic-name: " + + nic.name + + ", device-key: " + + str(nic.device_key) + + "." + ) + + nic_found = True + if nic.name is None and nic_name is not None: + nic_update.name = nic_name + if network_id is not None: + nic_update.network_id = network_id + if power_on_boot is not None: + nic_update.power_on_boot = power_on_boot + + nics_update.append(nic_update) + + if not nic_found: + raise CLIError("Given nic is not present in the virtual machine.") + + network_profile = NetworkProfileUpdate(network_interfaces=nics_update) + vm_update = VirtualMachineUpdate(network_profile=network_profile) + + return sdk_no_wait( + no_wait, client.begin_update, resource_group_name, vm_name, vm_update + ) + + +def list_nics(client: VirtualMachinesOperations, resource_group_name, vm_name): + """ + List details of a virtual machine nics. + """ + + vm = client.get(resource_group_name, vm_name) + if vm.network_profile is not None: + return vm.network_profile.network_interfaces + return None + + +def show_nic(client: VirtualMachinesOperations, resource_group_name, vm_name, nic_name): + """ + Get the details of a virtual machine nic. + """ + + vm = client.get(resource_group_name, vm_name) + if ( + vm.network_profile is not None + and vm.network_profile.network_interfaces is not None + ): + for nic in vm.network_profile.network_interfaces: + if nic.name == nic_name: + return nic + return None + + +def delete_nics( + client: VirtualMachinesOperations, + resource_group_name, + vm_name, + nic_names, + no_wait=False, +): + """ + Delete virtual network interfaces from virtual machine. + """ + + # Dictionary to maintain the nics to delete. + nics_to_delete = {} + for nic_name in nic_names: + nics_to_delete[nic_name] = True + + nics_update = [] + vm = client.get(resource_group_name, vm_name) + if ( + vm.network_profile is not None + and vm.network_profile.network_interfaces is not None + ): + for nic in vm.network_profile.network_interfaces: + if nic.name in nics_to_delete: + nics_to_delete[nic.name] = False + continue + nic_update = NetworkInterfaceUpdate( + name=nic.name, + network_id=nic.network_id, + power_on_boot=nic.power_on_boot, + nic_type=nic.nic_type, + device_key=nic.device_key, + ) + nics_update.append(nic_update) + + not_found_nics = "" + for nic_name in nics_to_delete: + if nics_to_delete[nic_name]: + not_found_nics = not_found_nics + nic_name + ", " + if not_found_nics != "": + raise CLIError( + "Nics with name " + + not_found_nics + + 'not present in the given virtual machine.' + ) + + network_profile = NetworkProfileUpdate(network_interfaces=nics_update) + vm_update = VirtualMachineUpdate(network_profile=network_profile) + + return sdk_no_wait( + no_wait, client.begin_update, resource_group_name, vm_name, vm_update + ) + + +# endregion + +# region VirtualMachine Disks. + + +def add_disk( + cmd, + client: VirtualMachinesOperations, + resource_group_name, + vm_name, + disk_name, + disk_size, + controller_key, + disk_mode=DiskMode.persistent.name, + unit_number=None, + no_wait=False, +): + """ + Add virtual disk to a virtual machine. + """ + + disk_to_add = VirtualDiskUpdate( + name=disk_name, + disk_size_gb=disk_size, + disk_mode=disk_mode, + controller_key=controller_key, + unit_number=unit_number, + ) + + disks_update = [] + vm = client.get(resource_group_name, vm_name) + if vm.storage_profile is not None and vm.storage_profile.disks is not None: + for disk in vm.storage_profile.disks: + disk_update = VirtualDiskUpdate( + name=disk.name, + disk_size_gb=disk.disk_size_gb, + disk_mode=disk.disk_mode, + controller_key=disk.controller_key, + unit_number=disk.unit_number, + device_key=disk.device_key, + ) + disks_update.append(disk_update) + + disks_update.append(disk_to_add) + storage_profile = StorageProfileUpdate(disks=disks_update) + vm_update = VirtualMachineUpdate(storage_profile=storage_profile) + + return sdk_no_wait( + no_wait, client.begin_update, resource_group_name, vm_name, vm_update + ) + + +def update_disk( + cmd, + client: VirtualMachinesOperations, + resource_group_name, + vm_name, + disk_name=None, + disk_size=None, + controller_key=None, + disk_mode=None, + unit_number=None, + device_key=None, + no_wait=False, +): + """ + Update virtual disk of a virtual machine. + """ + + if disk_name is None and device_key is None: + raise CLIError( + "Either disk name or device key must be specified to update the disk." + ) + + disks_update = [] + disk_found = False + vm = client.get(resource_group_name, vm_name) + if vm.storage_profile is not None and vm.storage_profile.disks is not None: + for disk in vm.storage_profile.disks: + disk_update = VirtualDiskUpdate( + name=disk.name, + disk_size_gb=disk.disk_size_gb, + disk_mode=disk.disk_mode, + controller_key=disk.controller_key, + unit_number=disk.unit_number, + device_key=disk.device_key, + ) + + if (disk_name is not None and disk.name == disk_name) or ( + device_key is not None and disk.device_key == device_key + ): + + # Validate disk name is matching with the expected device key if both were given in + # the input when name is already assigned to the disk. + if ( + disk_name is not None + and disk.name is not None + and disk.name != disk_name + ) or (device_key is not None and disk.device_key != device_key): + raise CLIError( + "Incorrect disk-name and device-key combination, Expected " + + "disk-name: " + + disk.name + + ", device-key: " + + str(disk.device_key) + + "." + ) + + disk_found = True + if disk.name is None and disk_name is not None: + disk_update.name = disk_name + if disk_size is not None: + disk_update.disk_size_gb = disk_size + if disk_mode is not None: + disk_update.disk_mode = disk_mode + if controller_key is not None: + disk_update.controller_key = controller_key + if unit_number is not None: + disk_update.unit_number = unit_number + + disks_update.append(disk_update) + + if not disk_found: + raise CLIError("Given disk is not present in the virtual machine.") + + storage_profile = StorageProfileUpdate(disks=disks_update) + vm_update = VirtualMachineUpdate(storage_profile=storage_profile) + + return sdk_no_wait( + no_wait, client.begin_update, resource_group_name, vm_name, vm_update + ) + + +def list_disks(client: VirtualMachinesOperations, resource_group_name, vm_name): + """ + List details of a virtual machine disks. + """ + + vm = client.get(resource_group_name, vm_name) + if vm.storage_profile is not None: + return vm.storage_profile.disks + return None + + +def show_disk( + client: VirtualMachinesOperations, resource_group_name, vm_name, disk_name +): + """ + Get the details of a virtual machine disk. + """ + + vm = client.get(resource_group_name, vm_name) + if vm.storage_profile is not None and vm.storage_profile.disks is not None: + for disk in vm.storage_profile.disks: + if disk.name == disk_name: + return disk + return None + + +def delete_disks( + client: VirtualMachinesOperations, + resource_group_name, + vm_name, + disk_names, + no_wait=False, +): + """ + Delete virtual disks from virtual machine. + """ + + # Dictionary to maintain the disks to delete. + disks_to_delete = {} + for disk_name in disk_names: + disks_to_delete[disk_name] = True + + disks_update = [] + vm = client.get(resource_group_name, vm_name) + if vm.storage_profile is not None and vm.storage_profile.disks is not None: + for disk in vm.storage_profile.disks: + if disk.name in disks_to_delete: + disks_to_delete[disk.name] = False + continue + disk_update = VirtualDiskUpdate( + name=disk.disk_name, + disk_size_gb=disk.disk_size_gb, + disk_mode=disk.disk_mode, + controller_key=disk.controller_key, + unit_number=disk.unit_number, + device_key=disk.device_key, + ) + disks_update.append(disk_update) + + not_found_disks = "" + for disk_name in disks_to_delete: + if disks_to_delete[disk_name]: + not_found_disks = not_found_disks + disk_name + ", " + if not_found_disks != "": + raise CLIError( + "Disks with name " + + not_found_disks + + "not present in the given virtual machine." + ) + + storage_profile = StorageProfileUpdate(disks=disks_update) + vm_update = VirtualMachineUpdate(storage_profile=storage_profile) + + return sdk_no_wait( + no_wait, client.begin_update, resource_group_name, vm_name, vm_update + ) + + +# endregion + +# endregion + + +def show_inventory_item( + cmd, + client: InventoryItemsOperations, + resource_group_name, + vcenter_name, + inventory_item_name, +): + + return client.get(resource_group_name, vcenter_name, inventory_item_name) + + +def list_inventory_item( + cmd, client: InventoryItemsOperations, resource_group_name, vcenter_name +): + + return client.list_by_v_center(resource_group_name, vcenter_name) \ No newline at end of file diff --git a/src/connectedvmware/azext_connectedvmware/tests/__init__.py b/src/connectedvmware/azext_connectedvmware/tests/__init__.py new file mode 100644 index 00000000000..2dcf9bb68b3 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/tests/__init__.py @@ -0,0 +1,5 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# ----------------------------------------------------------------------------- \ No newline at end of file diff --git a/src/connectedvmware/azext_connectedvmware/tests/latest/__init__.py b/src/connectedvmware/azext_connectedvmware/tests/latest/__init__.py new file mode 100644 index 00000000000..2dcf9bb68b3 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/tests/latest/__init__.py @@ -0,0 +1,5 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# ----------------------------------------------------------------------------- \ No newline at end of file diff --git a/src/connectedvmware/azext_connectedvmware/tests/latest/test_arcvmware_scenario.py b/src/connectedvmware/azext_connectedvmware/tests/latest/test_arcvmware_scenario.py new file mode 100644 index 00000000000..2ffdb1394f2 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/tests/latest/test_arcvmware_scenario.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import os +import unittest + +from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer +from knack.util import CLIError +from azure.cli.testsdk import ScenarioTest + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +class ConnectedvmwareScenarioTest(ScenarioTest): + @ResourceGroupPreparer(name_prefix='cli_test_connectedvmware') + def test_connectedvmware_vcenter(self, resource_group): + + self.kwargs.update({'name': 'test1'}) + + # raise CLIError('TODO') diff --git a/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py b/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py new file mode 100644 index 00000000000..2ffdb1394f2 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import os +import unittest + +from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer +from knack.util import CLIError +from azure.cli.testsdk import ScenarioTest + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +class ConnectedvmwareScenarioTest(ScenarioTest): + @ResourceGroupPreparer(name_prefix='cli_test_connectedvmware') + def test_connectedvmware_vcenter(self, resource_group): + + self.kwargs.update({'name': 'test1'}) + + # raise CLIError('TODO') diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/__init__.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/__init__.py new file mode 100644 index 00000000000..6e74ac1787a --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._azure_arc_vmware_management_service_api import AzureArcVMwareManagementServiceAPI +from ._version import VERSION + +__version__ = VERSION +__all__ = ['AzureArcVMwareManagementServiceAPI'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/_azure_arc_vmware_management_service_api.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/_azure_arc_vmware_management_service_api.py new file mode 100644 index 00000000000..b59b0a3db32 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/_azure_arc_vmware_management_service_api.py @@ -0,0 +1,134 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from ._configuration import AzureArcVMwareManagementServiceAPIConfiguration +from .operations import Operations +from .operations import ResourcePoolsOperations +from .operations import VCentersOperations +from .operations import VirtualMachinesOperations +from .operations import VirtualMachineTemplatesOperations +from .operations import VirtualNetworksOperations +from .operations import InventoryItemsOperations +from .operations import HybridIdentityMetadataOperations +from .operations import MachineExtensionsOperations +from .operations import GuestAgentOperations +from . import models + + +class AzureArcVMwareManagementServiceAPI(object): + """Self service experience for VMware. + + :ivar operations: Operations operations + :vartype operations: azure_arc_vmware_management_service_api.operations.Operations + :ivar resource_pools: ResourcePoolsOperations operations + :vartype resource_pools: azure_arc_vmware_management_service_api.operations.ResourcePoolsOperations + :ivar vcenters: VCentersOperations operations + :vartype vcenters: azure_arc_vmware_management_service_api.operations.VCentersOperations + :ivar virtual_machines: VirtualMachinesOperations operations + :vartype virtual_machines: azure_arc_vmware_management_service_api.operations.VirtualMachinesOperations + :ivar virtual_machine_templates: VirtualMachineTemplatesOperations operations + :vartype virtual_machine_templates: azure_arc_vmware_management_service_api.operations.VirtualMachineTemplatesOperations + :ivar virtual_networks: VirtualNetworksOperations operations + :vartype virtual_networks: azure_arc_vmware_management_service_api.operations.VirtualNetworksOperations + :ivar inventory_items: InventoryItemsOperations operations + :vartype inventory_items: azure_arc_vmware_management_service_api.operations.InventoryItemsOperations + :ivar hybrid_identity_metadata: HybridIdentityMetadataOperations operations + :vartype hybrid_identity_metadata: azure_arc_vmware_management_service_api.operations.HybridIdentityMetadataOperations + :ivar machine_extensions: MachineExtensionsOperations operations + :vartype machine_extensions: azure_arc_vmware_management_service_api.operations.MachineExtensionsOperations + :ivar guest_agent: GuestAgentOperations operations + :vartype guest_agent: azure_arc_vmware_management_service_api.operations.GuestAgentOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The Subscription ID. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = AzureArcVMwareManagementServiceAPIConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.resource_pools = ResourcePoolsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.vcenters = VCentersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_machines = VirtualMachinesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_machine_templates = VirtualMachineTemplatesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_networks = VirtualNetworksOperations( + self._client, self._config, self._serialize, self._deserialize) + self.inventory_items = InventoryItemsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.hybrid_identity_metadata = HybridIdentityMetadataOperations( + self._client, self._config, self._serialize, self._deserialize) + self.machine_extensions = MachineExtensionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.guest_agent = GuestAgentOperations( + self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> AzureArcVMwareManagementServiceAPI + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/_configuration.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/_configuration.py new file mode 100644 index 00000000000..34eaaa58200 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/_configuration.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + + +class AzureArcVMwareManagementServiceAPIConfiguration(Configuration): + """Configuration for AzureArcVMwareManagementServiceAPI. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The Subscription ID. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(AzureArcVMwareManagementServiceAPIConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-10-01-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-connectedvmware/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/_version.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/_version.py new file mode 100644 index 00000000000..e5754a47ce6 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/__init__.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/__init__.py new file mode 100644 index 00000000000..9bee3ede0eb --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._azure_arc_vmware_management_service_api import AzureArcVMwareManagementServiceAPI +__all__ = ['AzureArcVMwareManagementServiceAPI'] diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/_azure_arc_vmware_management_service_api.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/_azure_arc_vmware_management_service_api.py new file mode 100644 index 00000000000..8942810ae99 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/_azure_arc_vmware_management_service_api.py @@ -0,0 +1,127 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import AzureArcVMwareManagementServiceAPIConfiguration +from .operations import Operations +from .operations import ResourcePoolsOperations +from .operations import VCentersOperations +from .operations import VirtualMachinesOperations +from .operations import VirtualMachineTemplatesOperations +from .operations import VirtualNetworksOperations +from .operations import InventoryItemsOperations +from .operations import HybridIdentityMetadataOperations +from .operations import MachineExtensionsOperations +from .operations import GuestAgentOperations +from .. import models + + +class AzureArcVMwareManagementServiceAPI(object): + """Self service experience for VMware. + + :ivar operations: Operations operations + :vartype operations: azure_arc_vmware_management_service_api.aio.operations.Operations + :ivar resource_pools: ResourcePoolsOperations operations + :vartype resource_pools: azure_arc_vmware_management_service_api.aio.operations.ResourcePoolsOperations + :ivar vcenters: VCentersOperations operations + :vartype vcenters: azure_arc_vmware_management_service_api.aio.operations.VCentersOperations + :ivar virtual_machines: VirtualMachinesOperations operations + :vartype virtual_machines: azure_arc_vmware_management_service_api.aio.operations.VirtualMachinesOperations + :ivar virtual_machine_templates: VirtualMachineTemplatesOperations operations + :vartype virtual_machine_templates: azure_arc_vmware_management_service_api.aio.operations.VirtualMachineTemplatesOperations + :ivar virtual_networks: VirtualNetworksOperations operations + :vartype virtual_networks: azure_arc_vmware_management_service_api.aio.operations.VirtualNetworksOperations + :ivar inventory_items: InventoryItemsOperations operations + :vartype inventory_items: azure_arc_vmware_management_service_api.aio.operations.InventoryItemsOperations + :ivar hybrid_identity_metadata: HybridIdentityMetadataOperations operations + :vartype hybrid_identity_metadata: azure_arc_vmware_management_service_api.aio.operations.HybridIdentityMetadataOperations + :ivar machine_extensions: MachineExtensionsOperations operations + :vartype machine_extensions: azure_arc_vmware_management_service_api.aio.operations.MachineExtensionsOperations + :ivar guest_agent: GuestAgentOperations operations + :vartype guest_agent: azure_arc_vmware_management_service_api.aio.operations.GuestAgentOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The Subscription ID. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = AzureArcVMwareManagementServiceAPIConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.resource_pools = ResourcePoolsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.vcenters = VCentersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_machines = VirtualMachinesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_machine_templates = VirtualMachineTemplatesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.virtual_networks = VirtualNetworksOperations( + self._client, self._config, self._serialize, self._deserialize) + self.inventory_items = InventoryItemsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.hybrid_identity_metadata = HybridIdentityMetadataOperations( + self._client, self._config, self._serialize, self._deserialize) + self.machine_extensions = MachineExtensionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.guest_agent = GuestAgentOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "AzureArcVMwareManagementServiceAPI": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/_configuration.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/_configuration.py new file mode 100644 index 00000000000..bd68e0905e7 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/_configuration.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class AzureArcVMwareManagementServiceAPIConfiguration(Configuration): + """Configuration for AzureArcVMwareManagementServiceAPI. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The Subscription ID. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(AzureArcVMwareManagementServiceAPIConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-10-01-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-connectedvmware/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/__init__.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/__init__.py new file mode 100644 index 00000000000..dbe61394bc3 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/__init__.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._resource_pools_operations import ResourcePoolsOperations +from ._vcenters_operations import VCentersOperations +from ._virtual_machines_operations import VirtualMachinesOperations +from ._virtual_machine_templates_operations import VirtualMachineTemplatesOperations +from ._virtual_networks_operations import VirtualNetworksOperations +from ._inventory_items_operations import InventoryItemsOperations +from ._hybrid_identity_metadata_operations import HybridIdentityMetadataOperations +from ._machine_extensions_operations import MachineExtensionsOperations +from ._guest_agent_operations import GuestAgentOperations + +__all__ = [ + 'Operations', + 'ResourcePoolsOperations', + 'VCentersOperations', + 'VirtualMachinesOperations', + 'VirtualMachineTemplatesOperations', + 'VirtualNetworksOperations', + 'InventoryItemsOperations', + 'HybridIdentityMetadataOperations', + 'MachineExtensionsOperations', + 'GuestAgentOperations', +] diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_guest_agent_operations.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_guest_agent_operations.py new file mode 100644 index 00000000000..54657ebbfea --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_guest_agent_operations.py @@ -0,0 +1,445 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class GuestAgentOperations: + """GuestAgentOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_arc_vmware_management_service_api.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_initial( + self, + resource_group_name: str, + virtual_machine_name: str, + name: str, + body: Optional["_models.GuestAgent"] = None, + **kwargs + ) -> "_models.GuestAgent": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestAgent"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'GuestAgent') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('GuestAgent', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('GuestAgent', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/guestAgents/{name}'} # type: ignore + + async def begin_create( + self, + resource_group_name: str, + virtual_machine_name: str, + name: str, + body: Optional["_models.GuestAgent"] = None, + **kwargs + ) -> AsyncLROPoller["_models.GuestAgent"]: + """Implements GuestAgent PUT method. + + Create Or Update GuestAgent. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the vm. + :type virtual_machine_name: str + :param name: Name of the guestAgents. + :type name: str + :param body: Request payload. + :type body: ~azure_arc_vmware_management_service_api.models.GuestAgent + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either GuestAgent or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure_arc_vmware_management_service_api.models.GuestAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestAgent"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + virtual_machine_name=virtual_machine_name, + name=name, + body=body, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('GuestAgent', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/guestAgents/{name}'} # type: ignore + + async def get( + self, + resource_group_name: str, + virtual_machine_name: str, + name: str, + **kwargs + ) -> "_models.GuestAgent": + """Gets GuestAgent. + + Implements GuestAgent GET method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the vm. + :type virtual_machine_name: str + :param name: Name of the GuestAgent. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GuestAgent, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.GuestAgent + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestAgent"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GuestAgent', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/guestAgents/{name}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + virtual_machine_name: str, + name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/guestAgents/{name}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + virtual_machine_name: str, + name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an GuestAgent. + + Implements GuestAgent DELETE method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the vm. + :type virtual_machine_name: str + :param name: Name of the GuestAgent. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + virtual_machine_name=virtual_machine_name, + name=name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/guestAgents/{name}'} # type: ignore + + def list_by_vm( + self, + resource_group_name: str, + virtual_machine_name: str, + **kwargs + ) -> AsyncIterable["_models.GuestAgentList"]: + """Implements GET GuestAgent in a vm. + + Returns the list of GuestAgent of the given vm. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the vm. + :type virtual_machine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GuestAgentList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_arc_vmware_management_service_api.models.GuestAgentList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestAgentList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_vm.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('GuestAgentList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_vm.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/guestAgents'} # type: ignore diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_hybrid_identity_metadata_operations.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_hybrid_identity_metadata_operations.py new file mode 100644 index 00000000000..de016a57c1c --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_hybrid_identity_metadata_operations.py @@ -0,0 +1,322 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class HybridIdentityMetadataOperations: + """HybridIdentityMetadataOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_arc_vmware_management_service_api.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def create( + self, + resource_group_name: str, + virtual_machine_name: str, + metadata_name: str, + body: Optional["_models.HybridIdentityMetadata"] = None, + **kwargs + ) -> "_models.HybridIdentityMetadata": + """Implements HybridIdentityMetadata PUT method. + + Create Or Update HybridIdentityMetadata. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the vm. + :type virtual_machine_name: str + :param metadata_name: Name of the hybridIdentityMetadata. + :type metadata_name: str + :param body: Request payload. + :type body: ~azure_arc_vmware_management_service_api.models.HybridIdentityMetadata + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridIdentityMetadata, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.HybridIdentityMetadata + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridIdentityMetadata"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + 'metadataName': self._serialize.url("metadata_name", metadata_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'HybridIdentityMetadata') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridIdentityMetadata', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/hybridIdentityMetadata/{metadataName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + virtual_machine_name: str, + metadata_name: str, + **kwargs + ) -> "_models.HybridIdentityMetadata": + """Gets HybridIdentityMetadata. + + Implements HybridIdentityMetadata GET method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the vm. + :type virtual_machine_name: str + :param metadata_name: Name of the HybridIdentityMetadata. + :type metadata_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridIdentityMetadata, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.HybridIdentityMetadata + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridIdentityMetadata"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + 'metadataName': self._serialize.url("metadata_name", metadata_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridIdentityMetadata', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/hybridIdentityMetadata/{metadataName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + virtual_machine_name: str, + metadata_name: str, + **kwargs + ) -> None: + """Deletes an HybridIdentityMetadata. + + Implements HybridIdentityMetadata DELETE method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the vm. + :type virtual_machine_name: str + :param metadata_name: Name of the HybridIdentityMetadata. + :type metadata_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + 'metadataName': self._serialize.url("metadata_name", metadata_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/hybridIdentityMetadata/{metadataName}'} # type: ignore + + def list_by_vm( + self, + resource_group_name: str, + virtual_machine_name: str, + **kwargs + ) -> AsyncIterable["_models.HybridIdentityMetadataList"]: + """Implements GET HybridIdentityMetadata in a vm. + + Returns the list of HybridIdentityMetadata of the given vm. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the vm. + :type virtual_machine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either HybridIdentityMetadataList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_arc_vmware_management_service_api.models.HybridIdentityMetadataList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridIdentityMetadataList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_vm.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('HybridIdentityMetadataList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_vm.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/hybridIdentityMetadata'} # type: ignore diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_inventory_items_operations.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_inventory_items_operations.py new file mode 100644 index 00000000000..15bf1d9eeb9 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_inventory_items_operations.py @@ -0,0 +1,322 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class InventoryItemsOperations: + """InventoryItemsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_arc_vmware_management_service_api.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def create( + self, + resource_group_name: str, + vcenter_name: str, + inventory_item_name: str, + body: Optional["_models.InventoryItem"] = None, + **kwargs + ) -> "_models.InventoryItem": + """Implements InventoryItem PUT method. + + Create Or Update InventoryItem. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param vcenter_name: Name of the vCenter. + :type vcenter_name: str + :param inventory_item_name: Name of the inventoryItem. + :type inventory_item_name: str + :param body: Request payload. + :type body: ~azure_arc_vmware_management_service_api.models.InventoryItem + :keyword callable cls: A custom type or function that will be passed the direct response + :return: InventoryItem, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.InventoryItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.InventoryItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), + 'inventoryItemName': self._serialize.url("inventory_item_name", inventory_item_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'InventoryItem') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('InventoryItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}/inventoryItems/{inventoryItemName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + vcenter_name: str, + inventory_item_name: str, + **kwargs + ) -> "_models.InventoryItem": + """Gets InventoryItem. + + Implements InventoryItem GET method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param vcenter_name: Name of the vCenter. + :type vcenter_name: str + :param inventory_item_name: Name of the inventoryItem. + :type inventory_item_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: InventoryItem, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.InventoryItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.InventoryItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), + 'inventoryItemName': self._serialize.url("inventory_item_name", inventory_item_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('InventoryItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}/inventoryItems/{inventoryItemName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + vcenter_name: str, + inventory_item_name: str, + **kwargs + ) -> None: + """Deletes an inventoryItem. + + Implements inventoryItem DELETE method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param vcenter_name: Name of the vCenter. + :type vcenter_name: str + :param inventory_item_name: Name of the inventoryItem. + :type inventory_item_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), + 'inventoryItemName': self._serialize.url("inventory_item_name", inventory_item_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}/inventoryItems/{inventoryItemName}'} # type: ignore + + def list_by_v_center( + self, + resource_group_name: str, + vcenter_name: str, + **kwargs + ) -> AsyncIterable["_models.InventoryItemsList"]: + """Implements GET inventoryItems in a vCenter. + + Returns the list of inventoryItems of the given vCenter. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param vcenter_name: Name of the vCenter. + :type vcenter_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either InventoryItemsList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_arc_vmware_management_service_api.models.InventoryItemsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.InventoryItemsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_v_center.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('InventoryItemsList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_v_center.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}/inventoryItems'} # type: ignore diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_machine_extensions_operations.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_machine_extensions_operations.py new file mode 100644 index 00000000000..f171cf6a512 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_machine_extensions_operations.py @@ -0,0 +1,571 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class MachineExtensionsOperations: + """MachineExtensionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_arc_vmware_management_service_api.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_or_update_initial( + self, + resource_group_name: str, + name: str, + extension_name: str, + extension_parameters: "_models.MachineExtension", + **kwargs + ) -> Optional["_models.MachineExtension"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MachineExtension"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(extension_parameters, 'MachineExtension') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/extensions/{extensionName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + name: str, + extension_name: str, + extension_parameters: "_models.MachineExtension", + **kwargs + ) -> AsyncLROPoller["_models.MachineExtension"]: + """The operation to create or update the extension. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param name: The name of the machine where the extension should be created or updated. + :type name: str + :param extension_name: The name of the machine extension. + :type extension_name: str + :param extension_parameters: Parameters supplied to the Create Machine Extension operation. + :type extension_parameters: ~azure_arc_vmware_management_service_api.models.MachineExtension + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either MachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure_arc_vmware_management_service_api.models.MachineExtension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MachineExtension"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + name=name, + extension_name=extension_name, + extension_parameters=extension_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/extensions/{extensionName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + name: str, + extension_name: str, + extension_parameters: "_models.MachineExtensionUpdate", + **kwargs + ) -> Optional["_models.MachineExtension"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MachineExtension"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(extension_parameters, 'MachineExtensionUpdate') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/extensions/{extensionName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + name: str, + extension_name: str, + extension_parameters: "_models.MachineExtensionUpdate", + **kwargs + ) -> AsyncLROPoller["_models.MachineExtension"]: + """The operation to update the extension. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param name: The name of the machine where the extension should be created or updated. + :type name: str + :param extension_name: The name of the machine extension. + :type extension_name: str + :param extension_parameters: Parameters supplied to the Create Machine Extension operation. + :type extension_parameters: ~azure_arc_vmware_management_service_api.models.MachineExtensionUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either MachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure_arc_vmware_management_service_api.models.MachineExtension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MachineExtension"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + name=name, + extension_name=extension_name, + extension_parameters=extension_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/extensions/{extensionName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + name: str, + extension_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/extensions/{extensionName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + name: str, + extension_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """The operation to delete the extension. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param name: The name of the machine where the extension should be deleted. + :type name: str + :param extension_name: The name of the machine extension. + :type extension_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + name=name, + extension_name=extension_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/extensions/{extensionName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + name: str, + extension_name: str, + **kwargs + ) -> "_models.MachineExtension": + """The operation to get the extension. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param name: The name of the machine containing the extension. + :type name: str + :param extension_name: The name of the machine extension. + :type extension_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MachineExtension, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.MachineExtension + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MachineExtension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/extensions/{extensionName}'} # type: ignore + + def list( + self, + resource_group_name: str, + name: str, + expand: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.MachineExtensionsListResult"]: + """The operation to get all extensions of a non-Azure machine. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param name: The name of the machine containing the extension. + :type name: str + :param expand: The expand expression to apply on the operation. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MachineExtensionsListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_arc_vmware_management_service_api.models.MachineExtensionsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MachineExtensionsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('MachineExtensionsListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/extensions'} # type: ignore diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_operations.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_operations.py new file mode 100644 index 00000000000..964d2d4a7e8 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_arc_vmware_management_service_api.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.OperationsList"]: + """Returns list of all operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationsList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_arc_vmware_management_service_api.models.OperationsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationsList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.ConnectedVMwarevSphere/operations'} # type: ignore diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_resource_pools_operations.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_resource_pools_operations.py new file mode 100644 index 00000000000..9cfbc9f8bb0 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_resource_pools_operations.py @@ -0,0 +1,571 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ResourcePoolsOperations: + """ResourcePoolsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_arc_vmware_management_service_api.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_initial( + self, + resource_group_name: str, + resource_pool_name: str, + body: Optional["_models.ResourcePool"] = None, + **kwargs + ) -> "_models.ResourcePool": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourcePool"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourcePoolName': self._serialize.url("resource_pool_name", resource_pool_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'ResourcePool') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ResourcePool', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ResourcePool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName}'} # type: ignore + + async def begin_create( + self, + resource_group_name: str, + resource_pool_name: str, + body: Optional["_models.ResourcePool"] = None, + **kwargs + ) -> AsyncLROPoller["_models.ResourcePool"]: + """Implements resourcePool PUT method. + + Create Or Update resourcePool. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param resource_pool_name: Name of the resourcePool. + :type resource_pool_name: str + :param body: Request payload. + :type body: ~azure_arc_vmware_management_service_api.models.ResourcePool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ResourcePool or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure_arc_vmware_management_service_api.models.ResourcePool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourcePool"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + resource_pool_name=resource_pool_name, + body=body, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ResourcePool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourcePoolName': self._serialize.url("resource_pool_name", resource_pool_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + resource_pool_name: str, + **kwargs + ) -> "_models.ResourcePool": + """Gets a resourcePool. + + Implements resourcePool GET method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param resource_pool_name: Name of the resourcePool. + :type resource_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourcePool, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.ResourcePool + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourcePool"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourcePoolName': self._serialize.url("resource_pool_name", resource_pool_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourcePool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + resource_pool_name: str, + body: Optional["_models.ResourcePatch"] = None, + **kwargs + ) -> "_models.ResourcePool": + """Updates a resourcePool. + + API to update certain properties of the resourcePool resource. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param resource_pool_name: Name of the resourcePool. + :type resource_pool_name: str + :param body: Resource properties to update. + :type body: ~azure_arc_vmware_management_service_api.models.ResourcePatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourcePool, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.ResourcePool + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourcePool"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourcePoolName': self._serialize.url("resource_pool_name", resource_pool_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'ResourcePatch') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourcePool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + resource_pool_name: str, + force: Optional[bool] = None, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourcePoolName': self._serialize.url("resource_pool_name", resource_pool_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if force is not None: + query_parameters['force'] = self._serialize.query("force", force, 'bool') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_pool_name: str, + force: Optional[bool] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an resourcePool. + + Implements resourcePool DELETE method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param resource_pool_name: Name of the resourcePool. + :type resource_pool_name: str + :param force: Whether force delete was specified. + :type force: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_pool_name=resource_pool_name, + force=force, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourcePoolName': self._serialize.url("resource_pool_name", resource_pool_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName}'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.ResourcePoolsList"]: + """Implements GET resourcePools in a subscription. + + List of resourcePools in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourcePoolsList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_arc_vmware_management_service_api.models.ResourcePoolsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourcePoolsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourcePoolsList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.ResourcePoolsList"]: + """Implements GET resourcePools in a resource group. + + List of resourcePools in a resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourcePoolsList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_arc_vmware_management_service_api.models.ResourcePoolsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourcePoolsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourcePoolsList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools'} # type: ignore diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_vcenters_operations.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_vcenters_operations.py new file mode 100644 index 00000000000..d3344f6d1f5 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_vcenters_operations.py @@ -0,0 +1,571 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VCentersOperations: + """VCentersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_arc_vmware_management_service_api.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_initial( + self, + resource_group_name: str, + vcenter_name: str, + body: Optional["_models.VCenter"] = None, + **kwargs + ) -> "_models.VCenter": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VCenter"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'VCenter') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VCenter', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VCenter', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}'} # type: ignore + + async def begin_create( + self, + resource_group_name: str, + vcenter_name: str, + body: Optional["_models.VCenter"] = None, + **kwargs + ) -> AsyncLROPoller["_models.VCenter"]: + """Implements vCenter PUT method. + + Create Or Update vCenter. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param vcenter_name: Name of the vCenter. + :type vcenter_name: str + :param body: Request payload. + :type body: ~azure_arc_vmware_management_service_api.models.VCenter + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VCenter or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure_arc_vmware_management_service_api.models.VCenter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VCenter"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + vcenter_name=vcenter_name, + body=body, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VCenter', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + vcenter_name: str, + **kwargs + ) -> "_models.VCenter": + """Gets a vCenter. + + Implements vCenter GET method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param vcenter_name: Name of the vCenter. + :type vcenter_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VCenter, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.VCenter + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VCenter"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VCenter', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + vcenter_name: str, + body: Optional["_models.ResourcePatch"] = None, + **kwargs + ) -> "_models.VCenter": + """Updates a vCenter. + + API to update certain properties of the vCenter resource. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param vcenter_name: Name of the vCenter. + :type vcenter_name: str + :param body: Resource properties to update. + :type body: ~azure_arc_vmware_management_service_api.models.ResourcePatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VCenter, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.VCenter + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VCenter"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'ResourcePatch') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VCenter', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + vcenter_name: str, + force: Optional[bool] = None, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if force is not None: + query_parameters['force'] = self._serialize.query("force", force, 'bool') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + vcenter_name: str, + force: Optional[bool] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an vCenter. + + Implements vCenter DELETE method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param vcenter_name: Name of the vCenter. + :type vcenter_name: str + :param force: Whether force delete was specified. + :type force: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + vcenter_name=vcenter_name, + force=force, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.VCentersList"]: + """Implements GET vCenters in a subscription. + + List of vCenters in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VCentersList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_arc_vmware_management_service_api.models.VCentersList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VCentersList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VCentersList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedVMwarevSphere/vcenters'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.VCentersList"]: + """Implements GET vCenters in a resource group. + + List of vCenters in a resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VCentersList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_arc_vmware_management_service_api.models.VCentersList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VCentersList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VCentersList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters'} # type: ignore diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_virtual_machine_templates_operations.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_virtual_machine_templates_operations.py new file mode 100644 index 00000000000..6dcda811109 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_virtual_machine_templates_operations.py @@ -0,0 +1,571 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualMachineTemplatesOperations: + """VirtualMachineTemplatesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_arc_vmware_management_service_api.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_initial( + self, + resource_group_name: str, + virtual_machine_template_name: str, + body: Optional["_models.VirtualMachineTemplate"] = None, + **kwargs + ) -> "_models.VirtualMachineTemplate": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineTemplate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineTemplateName': self._serialize.url("virtual_machine_template_name", virtual_machine_template_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'VirtualMachineTemplate') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualMachineTemplate', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachineTemplate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName}'} # type: ignore + + async def begin_create( + self, + resource_group_name: str, + virtual_machine_template_name: str, + body: Optional["_models.VirtualMachineTemplate"] = None, + **kwargs + ) -> AsyncLROPoller["_models.VirtualMachineTemplate"]: + """Implements virtual machine template PUT method. + + Create Or Update virtual machine template. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_template_name: Name of the virtual machine template resource. + :type virtual_machine_template_name: str + :param body: Request payload. + :type body: ~azure_arc_vmware_management_service_api.models.VirtualMachineTemplate + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VirtualMachineTemplate or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure_arc_vmware_management_service_api.models.VirtualMachineTemplate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineTemplate"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + virtual_machine_template_name=virtual_machine_template_name, + body=body, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualMachineTemplate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineTemplateName': self._serialize.url("virtual_machine_template_name", virtual_machine_template_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + virtual_machine_template_name: str, + **kwargs + ) -> "_models.VirtualMachineTemplate": + """Gets a virtual machine template. + + Implements virtual machine template GET method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_template_name: Name of the virtual machine template resource. + :type virtual_machine_template_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachineTemplate, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.VirtualMachineTemplate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineTemplate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineTemplateName': self._serialize.url("virtual_machine_template_name", virtual_machine_template_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualMachineTemplate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + virtual_machine_template_name: str, + body: Optional["_models.ResourcePatch"] = None, + **kwargs + ) -> "_models.VirtualMachineTemplate": + """Updates a virtual machine template. + + API to update certain properties of the virtual machine template resource. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_template_name: Name of the virtual machine template resource. + :type virtual_machine_template_name: str + :param body: Resource properties to update. + :type body: ~azure_arc_vmware_management_service_api.models.ResourcePatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachineTemplate, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.VirtualMachineTemplate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineTemplate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineTemplateName': self._serialize.url("virtual_machine_template_name", virtual_machine_template_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'ResourcePatch') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualMachineTemplate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + virtual_machine_template_name: str, + force: Optional[bool] = None, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineTemplateName': self._serialize.url("virtual_machine_template_name", virtual_machine_template_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if force is not None: + query_parameters['force'] = self._serialize.query("force", force, 'bool') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + virtual_machine_template_name: str, + force: Optional[bool] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an virtual machine template. + + Implements virtual machine template DELETE method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_template_name: Name of the virtual machine template resource. + :type virtual_machine_template_name: str + :param force: Whether force delete was specified. + :type force: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + virtual_machine_template_name=virtual_machine_template_name, + force=force, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineTemplateName': self._serialize.url("virtual_machine_template_name", virtual_machine_template_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName}'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.VirtualMachineTemplatesList"]: + """Implements GET virtualMachineTemplates in a subscription. + + List of virtualMachineTemplates in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualMachineTemplatesList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_arc_vmware_management_service_api.models.VirtualMachineTemplatesList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineTemplatesList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualMachineTemplatesList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.VirtualMachineTemplatesList"]: + """Implements GET virtualMachineTemplates in a resource group. + + List of virtualMachineTemplates in a resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualMachineTemplatesList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_arc_vmware_management_service_api.models.VirtualMachineTemplatesList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineTemplatesList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualMachineTemplatesList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates'} # type: ignore diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_virtual_machines_operations.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_virtual_machines_operations.py new file mode 100644 index 00000000000..8f1ef9c87d4 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_virtual_machines_operations.py @@ -0,0 +1,979 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualMachinesOperations: + """VirtualMachinesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_arc_vmware_management_service_api.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_initial( + self, + resource_group_name: str, + virtual_machine_name: str, + body: Optional["_models.VirtualMachine"] = None, + **kwargs + ) -> "_models.VirtualMachine": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'VirtualMachine') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualMachine', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachine', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}'} # type: ignore + + async def begin_create( + self, + resource_group_name: str, + virtual_machine_name: str, + body: Optional["_models.VirtualMachine"] = None, + **kwargs + ) -> AsyncLROPoller["_models.VirtualMachine"]: + """Implements virtual machine PUT method. + + Create Or Update virtual machine. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the virtual machine resource. + :type virtual_machine_name: str + :param body: Request payload. + :type body: ~azure_arc_vmware_management_service_api.models.VirtualMachine + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VirtualMachine or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure_arc_vmware_management_service_api.models.VirtualMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + virtual_machine_name=virtual_machine_name, + body=body, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualMachine', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + virtual_machine_name: str, + **kwargs + ) -> "_models.VirtualMachine": + """Gets a virtual machine. + + Implements virtual machine GET method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the virtual machine resource. + :type virtual_machine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachine, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.VirtualMachine + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualMachine', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + virtual_machine_name: str, + body: Optional["_models.VirtualMachineUpdate"] = None, + **kwargs + ) -> "_models.VirtualMachine": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'VirtualMachineUpdate') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualMachine', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachine', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + virtual_machine_name: str, + body: Optional["_models.VirtualMachineUpdate"] = None, + **kwargs + ) -> AsyncLROPoller["_models.VirtualMachine"]: + """Updates a virtual machine. + + API to update certain properties of the virtual machine resource. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the virtual machine resource. + :type virtual_machine_name: str + :param body: Resource properties to update. + :type body: ~azure_arc_vmware_management_service_api.models.VirtualMachineUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VirtualMachine or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure_arc_vmware_management_service_api.models.VirtualMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + virtual_machine_name=virtual_machine_name, + body=body, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualMachine', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + virtual_machine_name: str, + force: Optional[bool] = None, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if force is not None: + query_parameters['force'] = self._serialize.query("force", force, 'bool') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + virtual_machine_name: str, + force: Optional[bool] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an virtual machine. + + Implements virtual machine DELETE method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the virtual machine resource. + :type virtual_machine_name: str + :param force: Whether force delete was specified. + :type force: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + virtual_machine_name=virtual_machine_name, + force=force, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}'} # type: ignore + + async def _stop_initial( + self, + resource_group_name: str, + virtual_machine_name: str, + body: Optional["_models.StopVirtualMachineOptions"] = None, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._stop_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'StopVirtualMachineOptions') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/stop'} # type: ignore + + async def begin_stop( + self, + resource_group_name: str, + virtual_machine_name: str, + body: Optional["_models.StopVirtualMachineOptions"] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Implements the operation to stop a virtual machine. + + Stop virtual machine. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the virtual machine resource. + :type virtual_machine_name: str + :param body: Virtualmachine stop action payload. + :type body: ~azure_arc_vmware_management_service_api.models.StopVirtualMachineOptions + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._stop_initial( + resource_group_name=resource_group_name, + virtual_machine_name=virtual_machine_name, + body=body, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/stop'} # type: ignore + + async def _start_initial( + self, + resource_group_name: str, + virtual_machine_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self._start_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/start'} # type: ignore + + async def begin_start( + self, + resource_group_name: str, + virtual_machine_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Implements the operation to start a virtual machine. + + Start virtual machine. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the virtual machine resource. + :type virtual_machine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._start_initial( + resource_group_name=resource_group_name, + virtual_machine_name=virtual_machine_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/start'} # type: ignore + + async def _restart_initial( + self, + resource_group_name: str, + virtual_machine_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self._restart_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restart_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/restart'} # type: ignore + + async def begin_restart( + self, + resource_group_name: str, + virtual_machine_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Implements the operation to restart a virtual machine. + + Restart virtual machine. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the virtual machine resource. + :type virtual_machine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._restart_initial( + resource_group_name=resource_group_name, + virtual_machine_name=virtual_machine_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/restart'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.VirtualMachinesList"]: + """Implements GET virtualMachines in a subscription. + + List of virtualMachines in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualMachinesList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_arc_vmware_management_service_api.models.VirtualMachinesList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachinesList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualMachinesList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.VirtualMachinesList"]: + """Implements GET virtualMachines in a resource group. + + List of virtualMachines in a resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualMachinesList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_arc_vmware_management_service_api.models.VirtualMachinesList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachinesList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualMachinesList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines'} # type: ignore diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_virtual_networks_operations.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_virtual_networks_operations.py new file mode 100644 index 00000000000..67b8ed42ed6 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/aio/operations/_virtual_networks_operations.py @@ -0,0 +1,571 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VirtualNetworksOperations: + """VirtualNetworksOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_arc_vmware_management_service_api.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_initial( + self, + resource_group_name: str, + virtual_network_name: str, + body: Optional["_models.VirtualNetwork"] = None, + **kwargs + ) -> "_models.VirtualNetwork": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'VirtualNetwork') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetwork', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName}'} # type: ignore + + async def begin_create( + self, + resource_group_name: str, + virtual_network_name: str, + body: Optional["_models.VirtualNetwork"] = None, + **kwargs + ) -> AsyncLROPoller["_models.VirtualNetwork"]: + """Implements virtual network PUT method. + + Create Or Update virtual network. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_network_name: Name of the virtual network resource. + :type virtual_network_name: str + :param body: Request payload. + :type body: ~azure_arc_vmware_management_service_api.models.VirtualNetwork + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure_arc_vmware_management_service_api.models.VirtualNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + body=body, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + virtual_network_name: str, + **kwargs + ) -> "_models.VirtualNetwork": + """Gets a virtual network. + + Implements virtual network GET method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_network_name: Name of the virtual network resource. + :type virtual_network_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualNetwork, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.VirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + virtual_network_name: str, + body: Optional["_models.ResourcePatch"] = None, + **kwargs + ) -> "_models.VirtualNetwork": + """Updates a virtual network. + + API to update certain properties of the virtual network resource. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_network_name: Name of the virtual network resource. + :type virtual_network_name: str + :param body: Resource properties to update. + :type body: ~azure_arc_vmware_management_service_api.models.ResourcePatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualNetwork, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.VirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'ResourcePatch') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + virtual_network_name: str, + force: Optional[bool] = None, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if force is not None: + query_parameters['force'] = self._serialize.query("force", force, 'bool') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + virtual_network_name: str, + force: Optional[bool] = None, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an virtual network. + + Implements virtual network DELETE method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_network_name: Name of the virtual network resource. + :type virtual_network_name: str + :param force: Whether force delete was specified. + :type force: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + force=force, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName}'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.VirtualNetworksList"]: + """Implements GET virtualNetworks in a subscription. + + List of virtualNetworks in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualNetworksList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_arc_vmware_management_service_api.models.VirtualNetworksList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworksList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualNetworksList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.VirtualNetworksList"]: + """Implements GET virtualNetworks in a resource group. + + List of virtualNetworks in a resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualNetworksList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_arc_vmware_management_service_api.models.VirtualNetworksList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworksList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualNetworksList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks'} # type: ignore diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/azure_arc_vmware_management_service_api.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/azure_arc_vmware_management_service_api.py new file mode 100644 index 00000000000..3d217c884eb --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/azure_arc_vmware_management_service_api.py @@ -0,0 +1,111 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.operations import Operations +from .operations.resource_pools_operations import ResourcePoolsOperations +from .operations.vcenters_operations import VCentersOperations +from .operations.virtual_machines_operations import VirtualMachinesOperations +from .operations.virtual_machine_templates_operations import VirtualMachineTemplatesOperations +from .operations.virtual_networks_operations import VirtualNetworksOperations +from .operations.inventory_items_operations import InventoryItemsOperations +from . import models + + +class AzureArcVMwareManagementServiceAPIConfiguration(AzureConfiguration): + """Configuration for AzureArcVMwareManagementServiceAPI + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The Subscription ID. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(AzureArcVMwareManagementServiceAPIConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-connectedvmware/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class AzureArcVMwareManagementServiceAPI(SDKClient): + """Self service experience for VMware. + + :ivar config: Configuration for client. + :vartype config: AzureArcVMwareManagementServiceAPIConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.vmware.v2020_10_01_preview.operations.Operations + :ivar resource_pools: ResourcePools operations + :vartype resource_pools: azure.mgmt.vmware.v2020_10_01_preview.operations.ResourcePoolsOperations + :ivar vcenters: VCenters operations + :vartype vcenters: azure.mgmt.vmware.v2020_10_01_preview.operations.VCentersOperations + :ivar virtual_machines: VirtualMachines operations + :vartype virtual_machines: azure.mgmt.vmware.v2020_10_01_preview.operations.VirtualMachinesOperations + :ivar virtual_machine_templates: VirtualMachineTemplates operations + :vartype virtual_machine_templates: azure.mgmt.vmware.v2020_10_01_preview.operations.VirtualMachineTemplatesOperations + :ivar virtual_networks: VirtualNetworks operations + :vartype virtual_networks: azure.mgmt.vmware.v2020_10_01_preview.operations.VirtualNetworksOperations + :ivar inventory_items: InventoryItems operations + :vartype inventory_items: azure.mgmt.vmware.v2020_10_01_preview.operations.InventoryItemsOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The Subscription ID. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = AzureArcVMwareManagementServiceAPIConfiguration(credentials, subscription_id, base_url) + super(AzureArcVMwareManagementServiceAPI, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2020-10-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.resource_pools = ResourcePoolsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.vcenters = VCentersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.virtual_machines = VirtualMachinesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.virtual_machine_templates = VirtualMachineTemplatesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.virtual_networks = VirtualNetworksOperations( + self._client, self.config, self._serialize, self._deserialize) + self.inventory_items = InventoryItemsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/__init__.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/__init__.py new file mode 100644 index 00000000000..9b06fbbb5bd --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/__init__.py @@ -0,0 +1,211 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import Condition + from ._models_py3 import ErrorDefinition + from ._models_py3 import ErrorResponse + from ._models_py3 import ExtendedLocation + from ._models_py3 import GuestAgent + from ._models_py3 import GuestAgentList + from ._models_py3 import GuestCredential + from ._models_py3 import HardwareProfile + from ._models_py3 import HybridIdentityMetadata + from ._models_py3 import HybridIdentityMetadataList + from ._models_py3 import Identity + from ._models_py3 import InventoryItem + from ._models_py3 import InventoryItemDetails + from ._models_py3 import InventoryItemProperties + from ._models_py3 import InventoryItemsList + from ._models_py3 import MachineExtension + from ._models_py3 import MachineExtensionInstanceView + from ._models_py3 import MachineExtensionInstanceViewStatus + from ._models_py3 import MachineExtensionPropertiesInstanceView + from ._models_py3 import MachineExtensionUpdate + from ._models_py3 import MachineExtensionsListResult + from ._models_py3 import NetworkInterface + from ._models_py3 import NetworkInterfaceUpdate + from ._models_py3 import NetworkProfile + from ._models_py3 import NetworkProfileUpdate + from ._models_py3 import NicIPAddressSettings + from ._models_py3 import NicIPSettings + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationsList + from ._models_py3 import OsProfile + from ._models_py3 import ProxyResource + from ._models_py3 import Resource + from ._models_py3 import ResourcePatch + from ._models_py3 import ResourcePool + from ._models_py3 import ResourcePoolInventoryItem + from ._models_py3 import ResourcePoolsList + from ._models_py3 import StopVirtualMachineOptions + from ._models_py3 import StorageProfile + from ._models_py3 import StorageProfileUpdate + from ._models_py3 import SystemData + from ._models_py3 import VCenter + from ._models_py3 import VCentersList + from ._models_py3 import VICredential + from ._models_py3 import VirtualDisk + from ._models_py3 import VirtualDiskUpdate + from ._models_py3 import VirtualMachine + from ._models_py3 import VirtualMachineInventoryItem + from ._models_py3 import VirtualMachineTemplate + from ._models_py3 import VirtualMachineTemplateInventoryItem + from ._models_py3 import VirtualMachineTemplatesList + from ._models_py3 import VirtualMachineUpdate + from ._models_py3 import VirtualMachinesList + from ._models_py3 import VirtualNetwork + from ._models_py3 import VirtualNetworkInventoryItem + from ._models_py3 import VirtualNetworksList + from ._models_py3 import VirtualSCSIController +except (SyntaxError, ImportError): + from ._models import Condition # type: ignore + from ._models import ErrorDefinition # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import ExtendedLocation # type: ignore + from ._models import GuestAgent # type: ignore + from ._models import GuestAgentList # type: ignore + from ._models import GuestCredential # type: ignore + from ._models import HardwareProfile # type: ignore + from ._models import HybridIdentityMetadata # type: ignore + from ._models import HybridIdentityMetadataList # type: ignore + from ._models import Identity # type: ignore + from ._models import InventoryItem # type: ignore + from ._models import InventoryItemDetails # type: ignore + from ._models import InventoryItemProperties # type: ignore + from ._models import InventoryItemsList # type: ignore + from ._models import MachineExtension # type: ignore + from ._models import MachineExtensionInstanceView # type: ignore + from ._models import MachineExtensionInstanceViewStatus # type: ignore + from ._models import MachineExtensionPropertiesInstanceView # type: ignore + from ._models import MachineExtensionUpdate # type: ignore + from ._models import MachineExtensionsListResult # type: ignore + from ._models import NetworkInterface # type: ignore + from ._models import NetworkInterfaceUpdate # type: ignore + from ._models import NetworkProfile # type: ignore + from ._models import NetworkProfileUpdate # type: ignore + from ._models import NicIPAddressSettings # type: ignore + from ._models import NicIPSettings # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationsList # type: ignore + from ._models import OsProfile # type: ignore + from ._models import ProxyResource # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourcePatch # type: ignore + from ._models import ResourcePool # type: ignore + from ._models import ResourcePoolInventoryItem # type: ignore + from ._models import ResourcePoolsList # type: ignore + from ._models import StopVirtualMachineOptions # type: ignore + from ._models import StorageProfile # type: ignore + from ._models import StorageProfileUpdate # type: ignore + from ._models import SystemData # type: ignore + from ._models import VCenter # type: ignore + from ._models import VCentersList # type: ignore + from ._models import VICredential # type: ignore + from ._models import VirtualDisk # type: ignore + from ._models import VirtualDiskUpdate # type: ignore + from ._models import VirtualMachine # type: ignore + from ._models import VirtualMachineInventoryItem # type: ignore + from ._models import VirtualMachineTemplate # type: ignore + from ._models import VirtualMachineTemplateInventoryItem # type: ignore + from ._models import VirtualMachineTemplatesList # type: ignore + from ._models import VirtualMachineUpdate # type: ignore + from ._models import VirtualMachinesList # type: ignore + from ._models import VirtualNetwork # type: ignore + from ._models import VirtualNetworkInventoryItem # type: ignore + from ._models import VirtualNetworksList # type: ignore + from ._models import VirtualSCSIController # type: ignore + +from ._azure_arc_vmware_management_service_api_enums import ( + CreatedByType, + DiskMode, + IPAddressAllocationMethod, + IdentityType, + InventoryType, + NICType, + OsType, + PowerOnBootOption, + ProvisioningAction, + SCSIControllerType, + StatusLevelTypes, + VirtualSCSISharing, +) + +__all__ = [ + 'Condition', + 'ErrorDefinition', + 'ErrorResponse', + 'ExtendedLocation', + 'GuestAgent', + 'GuestAgentList', + 'GuestCredential', + 'HardwareProfile', + 'HybridIdentityMetadata', + 'HybridIdentityMetadataList', + 'Identity', + 'InventoryItem', + 'InventoryItemDetails', + 'InventoryItemProperties', + 'InventoryItemsList', + 'MachineExtension', + 'MachineExtensionInstanceView', + 'MachineExtensionInstanceViewStatus', + 'MachineExtensionPropertiesInstanceView', + 'MachineExtensionUpdate', + 'MachineExtensionsListResult', + 'NetworkInterface', + 'NetworkInterfaceUpdate', + 'NetworkProfile', + 'NetworkProfileUpdate', + 'NicIPAddressSettings', + 'NicIPSettings', + 'Operation', + 'OperationDisplay', + 'OperationsList', + 'OsProfile', + 'ProxyResource', + 'Resource', + 'ResourcePatch', + 'ResourcePool', + 'ResourcePoolInventoryItem', + 'ResourcePoolsList', + 'StopVirtualMachineOptions', + 'StorageProfile', + 'StorageProfileUpdate', + 'SystemData', + 'VCenter', + 'VCentersList', + 'VICredential', + 'VirtualDisk', + 'VirtualDiskUpdate', + 'VirtualMachine', + 'VirtualMachineInventoryItem', + 'VirtualMachineTemplate', + 'VirtualMachineTemplateInventoryItem', + 'VirtualMachineTemplatesList', + 'VirtualMachineUpdate', + 'VirtualMachinesList', + 'VirtualNetwork', + 'VirtualNetworkInventoryItem', + 'VirtualNetworksList', + 'VirtualSCSIController', + 'CreatedByType', + 'DiskMode', + 'IPAddressAllocationMethod', + 'IdentityType', + 'InventoryType', + 'NICType', + 'OsType', + 'PowerOnBootOption', + 'ProvisioningAction', + 'SCSIControllerType', + 'StatusLevelTypes', + 'VirtualSCSISharing', +] diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/_azure_arc_vmware_management_service_api_enums.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/_azure_arc_vmware_management_service_api_enums.py new file mode 100644 index 00000000000..e86e1faad9c --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/_azure_arc_vmware_management_service_api_enums.py @@ -0,0 +1,130 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class DiskMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Defines the different types of disk modes. + """ + + PERSISTENT = "persistent" + INDEPENDENT_PERSISTENT = "independent_persistent" + INDEPENDENT_NONPERSISTENT = "independent_nonpersistent" + +class IdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of managed service identity. + """ + + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + +class InventoryType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The inventory type. + """ + + RESOURCE_POOL = "ResourcePool" + VIRTUAL_MACHINE = "VirtualMachine" + VIRTUAL_MACHINE_TEMPLATE = "VirtualMachineTemplate" + VIRTUAL_NETWORK = "VirtualNetwork" + +class IPAddressAllocationMethod(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """IP address allocation method. + """ + + UNSET = "unset" + DYNAMIC = "dynamic" + STATIC = "static" + LINKLAYER = "linklayer" + RANDOM = "random" + OTHER = "other" + +class NICType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """NIC type + """ + + VMXNET3 = "vmxnet3" + VMXNET2 = "vmxnet2" + VMXNET = "vmxnet" + E1000 = "e1000" + E1000_E = "e1000e" + PCNET32 = "pcnet32" + +class OsType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Defines the different types of VM guest operating systems. + """ + + WINDOWS = "Windows" + LINUX = "Linux" + OTHER = "Other" + +class PowerOnBootOption(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Defines the options for power on boot. + """ + + ENABLED = "enabled" + DISABLED = "disabled" + +class ProvisioningAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Defines the different types of operations for guest agent. + """ + + INSTALL = "install" + UNINSTALL = "uninstall" + REPAIR = "repair" + +class SCSIControllerType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Defines the different types of SCSI controllers. + """ + + LSILOGIC = "lsilogic" + BUSLOGIC = "buslogic" + PVSCSI = "pvscsi" + LSILOGICSAS = "lsilogicsas" + +class StatusLevelTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The level code. + """ + + INFO = "Info" + WARNING = "Warning" + ERROR = "Error" + +class VirtualSCSISharing(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Defines the sharing mode for sharing the SCSI bus. + """ + + NO_SHARING = "noSharing" + PHYSICAL_SHARING = "physicalSharing" + VIRTUAL_SHARING = "virtualSharing" diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/_models.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/_models.py new file mode 100644 index 00000000000..66cbe90a652 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/_models.py @@ -0,0 +1,2653 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class Condition(msrest.serialization.Model): + """Condition defines an extension to status. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status: Status of the condition. + :vartype status: str + :ivar reason: The reason for the condition's status. + :vartype reason: str + :ivar message: A human readable message indicating details about the status. + :vartype message: str + :ivar severity: Severity with which to treat failures of this type of condition. + :vartype severity: str + """ + + _validation = { + 'status': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + 'severity': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'severity': {'key': 'severity', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Condition, self).__init__(**kwargs) + self.status = None + self.reason = None + self.message = None + self.severity = None + + +class ErrorDefinition(msrest.serialization.Model): + """Error definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Service specific error code which serves as the substatus for the HTTP error code. + :vartype code: str + :ivar message: Description of the error. + :vartype message: str + :ivar details: Internal error details. + :vartype details: list[~azure_arc_vmware_management_service_api.models.ErrorDefinition] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDefinition]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDefinition, self).__init__(**kwargs) + self.code = None + self.message = None + self.details = None + + +class ErrorResponse(msrest.serialization.Model): + """Error response. + + :param error: The error details. + :type error: ~azure_arc_vmware_management_service_api.models.ErrorDefinition + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDefinition'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ExtendedLocation(msrest.serialization.Model): + """The extended location. + + :param type: The extended location type. + :type type: str + :param name: The extended location name. + :type name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtendedLocation, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.name = kwargs.get('name', None) + + +class Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class ProxyResource(Resource): + """The resource model definition for an Azure Resource Manager proxy resource. It will have everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + + +class GuestAgent(ProxyResource): + """Defines the GuestAgent. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: The system data. + :vartype system_data: ~azure_arc_vmware_management_service_api.models.SystemData + :param credentials: Username / Password Credentials to provision guest agent. + :type credentials: ~azure_arc_vmware_management_service_api.models.GuestCredential + :param provisioning_action: Gets or sets the guest agent provisioning action. Possible values + include: "install", "uninstall", "repair". + :type provisioning_action: str or + ~azure_arc_vmware_management_service_api.models.ProvisioningAction + :ivar status: Gets or sets the guest agent status. + :vartype status: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'credentials': {'key': 'properties.credentials', 'type': 'GuestCredential'}, + 'provisioning_action': {'key': 'properties.provisioningAction', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GuestAgent, self).__init__(**kwargs) + self.system_data = None + self.credentials = kwargs.get('credentials', None) + self.provisioning_action = kwargs.get('provisioning_action', None) + self.status = None + self.provisioning_state = None + + +class GuestAgentList(msrest.serialization.Model): + """List of GuestAgent. + + All required parameters must be populated in order to send to Azure. + + :param next_link: Url to follow for getting next page of GuestAgent. + :type next_link: str + :param value: Required. Array of GuestAgent. + :type value: list[~azure_arc_vmware_management_service_api.models.GuestAgent] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[GuestAgent]'}, + } + + def __init__( + self, + **kwargs + ): + super(GuestAgentList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs['value'] + + +class GuestCredential(msrest.serialization.Model): + """Username / Password Credentials to connect to guest. + + :param username: Gets or sets username to connect with the guest. + :type username: str + :param password: Gets or sets the password to connect with the guest. + :type password: str + """ + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GuestCredential, self).__init__(**kwargs) + self.username = kwargs.get('username', None) + self.password = kwargs.get('password', None) + + +class HardwareProfile(msrest.serialization.Model): + """Defines the resource properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param memory_size_mb: Gets or sets memory size in MBs for the vm. + :type memory_size_mb: int + :param num_cp_us: Gets or sets the number of vCPUs for the vm. + :type num_cp_us: int + :param num_cores_per_socket: Gets or sets the number of cores per socket for the vm. Defaults + to 1 if unspecified. + :type num_cores_per_socket: int + :ivar cpu_hot_add_enabled: Gets or sets a value indicating whether virtual processors can be + added while this virtual machine is running. + :vartype cpu_hot_add_enabled: bool + :ivar cpu_hot_remove_enabled: Gets or sets a value indicating whether virtual processors can be + removed while this virtual machine is running. + :vartype cpu_hot_remove_enabled: bool + :ivar memory_hot_add_enabled: Gets or sets a value indicating whether memory can be added while + this virtual machine is running. + :vartype memory_hot_add_enabled: bool + """ + + _validation = { + 'cpu_hot_add_enabled': {'readonly': True}, + 'cpu_hot_remove_enabled': {'readonly': True}, + 'memory_hot_add_enabled': {'readonly': True}, + } + + _attribute_map = { + 'memory_size_mb': {'key': 'memorySizeMB', 'type': 'int'}, + 'num_cp_us': {'key': 'numCPUs', 'type': 'int'}, + 'num_cores_per_socket': {'key': 'numCoresPerSocket', 'type': 'int'}, + 'cpu_hot_add_enabled': {'key': 'cpuHotAddEnabled', 'type': 'bool'}, + 'cpu_hot_remove_enabled': {'key': 'cpuHotRemoveEnabled', 'type': 'bool'}, + 'memory_hot_add_enabled': {'key': 'memoryHotAddEnabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(HardwareProfile, self).__init__(**kwargs) + self.memory_size_mb = kwargs.get('memory_size_mb', None) + self.num_cp_us = kwargs.get('num_cp_us', None) + self.num_cores_per_socket = kwargs.get('num_cores_per_socket', None) + self.cpu_hot_add_enabled = None + self.cpu_hot_remove_enabled = None + self.memory_hot_add_enabled = None + + +class HybridIdentityMetadata(ProxyResource): + """Defines the HybridIdentityMetadata. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: The system data. + :vartype system_data: ~azure_arc_vmware_management_service_api.models.SystemData + :param vm_id: Gets or sets the Vm Id. + :type vm_id: str + :param public_key: Gets or sets the Public Key. + :type public_key: str + :ivar identity: The identity of the resource. + :vartype identity: ~azure_arc_vmware_management_service_api.models.Identity + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'identity': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + 'public_key': {'key': 'properties.publicKey', 'type': 'str'}, + 'identity': {'key': 'properties.identity', 'type': 'Identity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HybridIdentityMetadata, self).__init__(**kwargs) + self.system_data = None + self.vm_id = kwargs.get('vm_id', None) + self.public_key = kwargs.get('public_key', None) + self.identity = None + self.provisioning_state = None + + +class HybridIdentityMetadataList(msrest.serialization.Model): + """List of HybridIdentityMetadata. + + All required parameters must be populated in order to send to Azure. + + :param next_link: Url to follow for getting next page of HybridIdentityMetadata. + :type next_link: str + :param value: Required. Array of HybridIdentityMetadata. + :type value: list[~azure_arc_vmware_management_service_api.models.HybridIdentityMetadata] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[HybridIdentityMetadata]'}, + } + + def __init__( + self, + **kwargs + ): + super(HybridIdentityMetadataList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs['value'] + + +class Identity(msrest.serialization.Model): + """Managed service identity. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar principal_id: The principal id of managed service identity. + :vartype principal_id: str + :ivar tenant_id: The tenant of managed service identity. + :vartype tenant_id: str + :param type: Required. The type of managed service identity. Possible values include: "None", + "SystemAssigned". + :type type: str or ~azure_arc_vmware_management_service_api.models.IdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs['type'] + + +class InventoryItem(ProxyResource): + """Defines the inventory item. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: The system data. + :vartype system_data: ~azure_arc_vmware_management_service_api.models.SystemData + :param inventory_type: Required. They inventory type.Constant filled by server. Possible + values include: "ResourcePool", "VirtualMachine", "VirtualMachineTemplate", "VirtualNetwork". + :type inventory_type: str or ~azure_arc_vmware_management_service_api.models.InventoryType + :param managed_resource_id: Gets or sets the tracked resource id corresponding to the inventory + resource. + :type managed_resource_id: str + :param mo_ref_id: Gets or sets the MoRef (Managed Object Reference) ID for the inventory item. + :type mo_ref_id: str + :param mo_name: Gets or sets the vCenter Managed Object name for the inventory item. + :type mo_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'inventory_type': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'inventory_type': {'key': 'properties.inventoryType', 'type': 'str'}, + 'managed_resource_id': {'key': 'properties.managedResourceId', 'type': 'str'}, + 'mo_ref_id': {'key': 'properties.moRefId', 'type': 'str'}, + 'mo_name': {'key': 'properties.moName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(InventoryItem, self).__init__(**kwargs) + self.system_data = None + self.inventory_type = None # type: Optional[str] + self.managed_resource_id = kwargs.get('managed_resource_id', None) + self.mo_ref_id = kwargs.get('mo_ref_id', None) + self.mo_name = kwargs.get('mo_name', None) + self.provisioning_state = None + + +class InventoryItemDetails(msrest.serialization.Model): + """Defines the resource properties. + + :param inventory_item_id: Gets or sets the inventory Item ID for the resource. + :type inventory_item_id: str + :param mo_name: Gets or sets the vCenter Managed Object name for the resource. + :type mo_name: str + """ + + _attribute_map = { + 'inventory_item_id': {'key': 'inventoryItemId', 'type': 'str'}, + 'mo_name': {'key': 'moName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(InventoryItemDetails, self).__init__(**kwargs) + self.inventory_item_id = kwargs.get('inventory_item_id', None) + self.mo_name = kwargs.get('mo_name', None) + + +class InventoryItemProperties(msrest.serialization.Model): + """Defines the resource properties. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ResourcePoolInventoryItem, VirtualMachineInventoryItem, VirtualMachineTemplateInventoryItem, VirtualNetworkInventoryItem. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param inventory_type: Required. They inventory type.Constant filled by server. Possible + values include: "ResourcePool", "VirtualMachine", "VirtualMachineTemplate", "VirtualNetwork". + :type inventory_type: str or ~azure_arc_vmware_management_service_api.models.InventoryType + :param managed_resource_id: Gets or sets the tracked resource id corresponding to the inventory + resource. + :type managed_resource_id: str + :param mo_ref_id: Gets or sets the MoRef (Managed Object Reference) ID for the inventory item. + :type mo_ref_id: str + :param mo_name: Gets or sets the vCenter Managed Object name for the inventory item. + :type mo_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'inventory_type': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'inventory_type': {'key': 'inventoryType', 'type': 'str'}, + 'managed_resource_id': {'key': 'managedResourceId', 'type': 'str'}, + 'mo_ref_id': {'key': 'moRefId', 'type': 'str'}, + 'mo_name': {'key': 'moName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + _subtype_map = { + 'inventory_type': {'ResourcePool': 'ResourcePoolInventoryItem', 'VirtualMachine': 'VirtualMachineInventoryItem', 'VirtualMachineTemplate': 'VirtualMachineTemplateInventoryItem', 'VirtualNetwork': 'VirtualNetworkInventoryItem'} + } + + def __init__( + self, + **kwargs + ): + super(InventoryItemProperties, self).__init__(**kwargs) + self.inventory_type = None # type: Optional[str] + self.managed_resource_id = kwargs.get('managed_resource_id', None) + self.mo_ref_id = kwargs.get('mo_ref_id', None) + self.mo_name = kwargs.get('mo_name', None) + self.provisioning_state = None + + +class InventoryItemsList(msrest.serialization.Model): + """List of InventoryItems. + + All required parameters must be populated in order to send to Azure. + + :param next_link: Url to follow for getting next page of InventoryItems. + :type next_link: str + :param value: Required. Array of InventoryItems. + :type value: list[~azure_arc_vmware_management_service_api.models.InventoryItem] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[InventoryItem]'}, + } + + def __init__( + self, + **kwargs + ): + super(InventoryItemsList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs['value'] + + +class MachineExtension(msrest.serialization.Model): + """Describes a Machine Extension. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param location: Gets or sets the location. + :type location: str + :ivar system_data: The system data. + :vartype system_data: ~azure_arc_vmware_management_service_api.models.SystemData + :param tags: A set of tags. Gets or sets the Resource tags. + :type tags: dict[str, str] + :ivar name: Gets or sets the name. + :vartype name: str + :ivar id: Gets or sets the Id. + :vartype id: str + :ivar type: Gets or sets the type of the resource. + :vartype type: str + :param force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type_properties_type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :type type_properties_type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor + version if one is available at deployment time. Once deployed, however, the extension will not + upgrade minor versions unless redeployed, even with this property set to true. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :param instance_view: The machine extension instance view. + :type instance_view: + ~azure_arc_vmware_management_service_api.models.MachineExtensionPropertiesInstanceView + """ + + _validation = { + 'system_data': {'readonly': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, + 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'MachineExtensionPropertiesInstanceView'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineExtension, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.system_data = None + self.tags = kwargs.get('tags', None) + self.name = None + self.id = None + self.type = None + self.force_update_tag = kwargs.get('force_update_tag', None) + self.publisher = kwargs.get('publisher', None) + self.type_properties_type = kwargs.get('type_properties_type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.settings = kwargs.get('settings', None) + self.protected_settings = kwargs.get('protected_settings', None) + self.provisioning_state = None + self.instance_view = kwargs.get('instance_view', None) + + +class MachineExtensionInstanceView(msrest.serialization.Model): + """Describes the Machine Extension Instance View. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The machine extension name. + :vartype name: str + :ivar type: Specifies the type of the extension; an example is "CustomScriptExtension". + :vartype type: str + :ivar type_handler_version: Specifies the version of the script handler. + :vartype type_handler_version: str + :param status: Instance view status. + :type status: + ~azure_arc_vmware_management_service_api.models.MachineExtensionInstanceViewStatus + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'type_handler_version': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'MachineExtensionInstanceViewStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineExtensionInstanceView, self).__init__(**kwargs) + self.name = None + self.type = None + self.type_handler_version = None + self.status = kwargs.get('status', None) + + +class MachineExtensionInstanceViewStatus(msrest.serialization.Model): + """Instance view status. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The status code. + :vartype code: str + :ivar level: The level code. Possible values include: "Info", "Warning", "Error". + :vartype level: str or ~azure_arc_vmware_management_service_api.models.StatusLevelTypes + :ivar display_status: The short localizable label for the status. + :vartype display_status: str + :ivar message: The detailed status message, including for alerts and error messages. + :vartype message: str + :ivar time: The time of the status. + :vartype time: ~datetime.datetime + """ + + _validation = { + 'code': {'readonly': True}, + 'level': {'readonly': True}, + 'display_status': {'readonly': True}, + 'message': {'readonly': True}, + 'time': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'level': {'key': 'level', 'type': 'str'}, + 'display_status': {'key': 'displayStatus', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineExtensionInstanceViewStatus, self).__init__(**kwargs) + self.code = None + self.level = None + self.display_status = None + self.message = None + self.time = None + + +class MachineExtensionPropertiesInstanceView(MachineExtensionInstanceView): + """The machine extension instance view. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The machine extension name. + :vartype name: str + :ivar type: Specifies the type of the extension; an example is "CustomScriptExtension". + :vartype type: str + :ivar type_handler_version: Specifies the version of the script handler. + :vartype type_handler_version: str + :param status: Instance view status. + :type status: + ~azure_arc_vmware_management_service_api.models.MachineExtensionInstanceViewStatus + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'type_handler_version': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'MachineExtensionInstanceViewStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineExtensionPropertiesInstanceView, self).__init__(**kwargs) + + +class MachineExtensionsListResult(msrest.serialization.Model): + """Describes the Machine Extensions List Result. + + :param value: The list of extensions. + :type value: list[~azure_arc_vmware_management_service_api.models.MachineExtension] + :param next_link: The uri to fetch the next page of machine extensions. Call ListNext() with + this to fetch the next page of extensions. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MachineExtension]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineExtensionsListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ResourcePatch(msrest.serialization.Model): + """Object containing updates for patch operations. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourcePatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class MachineExtensionUpdate(ResourcePatch): + """Describes a Machine Extension Update. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type: Specifies the type of the extension; an example is "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor + version if one is available at deployment time. Once deployed, however, the extension will not + upgrade minor versions unless redeployed, even with this property set to true. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'type': {'key': 'properties.type', 'type': 'str'}, + 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineExtensionUpdate, self).__init__(**kwargs) + self.force_update_tag = kwargs.get('force_update_tag', None) + self.publisher = kwargs.get('publisher', None) + self.type = kwargs.get('type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.settings = kwargs.get('settings', None) + self.protected_settings = kwargs.get('protected_settings', None) + + +class NetworkInterface(msrest.serialization.Model): + """Network Interface model. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param name: Gets or sets the name of the network interface. + :type name: str + :ivar label: Gets or sets the label of the virtual network in vCenter that the nic is connected + to. + :vartype label: str + :ivar ip_addresses: Gets or sets the nic ip addresses. + :vartype ip_addresses: list[str] + :ivar mac_address: Gets or sets the NIC MAC address. + :vartype mac_address: str + :param network_id: Gets or sets the ARM Id of the network resource to connect the virtual + machine. + :type network_id: str + :param nic_type: NIC type. Possible values include: "vmxnet3", "vmxnet2", "vmxnet", "e1000", + "e1000e", "pcnet32". + :type nic_type: str or ~azure_arc_vmware_management_service_api.models.NICType + :param power_on_boot: Gets or sets the power on boot. Possible values include: "enabled", + "disabled". + :type power_on_boot: str or ~azure_arc_vmware_management_service_api.models.PowerOnBootOption + :ivar network_mo_ref_id: Gets or sets the vCenter MoRef (Managed Object Reference) ID of the + virtual network + that the nic is connected to. + :vartype network_mo_ref_id: str + :ivar network_mo_name: Gets or sets the name of the virtual network in vCenter that the nic is + connected to. + :vartype network_mo_name: str + :param device_key: Gets or sets the device key value. + :type device_key: int + :param ip_settings: Gets or sets the ipsettings. + :type ip_settings: ~azure_arc_vmware_management_service_api.models.NicIPSettings + """ + + _validation = { + 'label': {'readonly': True}, + 'ip_addresses': {'readonly': True}, + 'mac_address': {'readonly': True}, + 'network_mo_ref_id': {'readonly': True}, + 'network_mo_name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + 'ip_addresses': {'key': 'ipAddresses', 'type': '[str]'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + 'network_id': {'key': 'networkId', 'type': 'str'}, + 'nic_type': {'key': 'nicType', 'type': 'str'}, + 'power_on_boot': {'key': 'powerOnBoot', 'type': 'str'}, + 'network_mo_ref_id': {'key': 'networkMoRefId', 'type': 'str'}, + 'network_mo_name': {'key': 'networkMoName', 'type': 'str'}, + 'device_key': {'key': 'deviceKey', 'type': 'int'}, + 'ip_settings': {'key': 'ipSettings', 'type': 'NicIPSettings'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkInterface, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.label = None + self.ip_addresses = None + self.mac_address = None + self.network_id = kwargs.get('network_id', None) + self.nic_type = kwargs.get('nic_type', None) + self.power_on_boot = kwargs.get('power_on_boot', None) + self.network_mo_ref_id = None + self.network_mo_name = None + self.device_key = kwargs.get('device_key', None) + self.ip_settings = kwargs.get('ip_settings', None) + + +class NetworkInterfaceUpdate(msrest.serialization.Model): + """Defines the network interface update. + + :param name: Gets or sets the name of the network interface. + :type name: str + :param network_id: Gets or sets the ARM Id of the network resource to connect the virtual + machine. + :type network_id: str + :param nic_type: NIC type. Possible values include: "vmxnet3", "vmxnet2", "vmxnet", "e1000", + "e1000e", "pcnet32". + :type nic_type: str or ~azure_arc_vmware_management_service_api.models.NICType + :param power_on_boot: Gets or sets the power on boot. Possible values include: "enabled", + "disabled". + :type power_on_boot: str or ~azure_arc_vmware_management_service_api.models.PowerOnBootOption + :param device_key: Gets or sets the device key value. + :type device_key: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'network_id': {'key': 'networkId', 'type': 'str'}, + 'nic_type': {'key': 'nicType', 'type': 'str'}, + 'power_on_boot': {'key': 'powerOnBoot', 'type': 'str'}, + 'device_key': {'key': 'deviceKey', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkInterfaceUpdate, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.network_id = kwargs.get('network_id', None) + self.nic_type = kwargs.get('nic_type', None) + self.power_on_boot = kwargs.get('power_on_boot', None) + self.device_key = kwargs.get('device_key', None) + + +class NetworkProfile(msrest.serialization.Model): + """Defines the resource properties. + + :param network_interfaces: Gets or sets the list of network interfaces associated with the + virtual machine. + :type network_interfaces: + list[~azure_arc_vmware_management_service_api.models.NetworkInterface] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[NetworkInterface]'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkProfile, self).__init__(**kwargs) + self.network_interfaces = kwargs.get('network_interfaces', None) + + +class NetworkProfileUpdate(msrest.serialization.Model): + """Defines the update resource properties. + + :param network_interfaces: Gets or sets the list of network interfaces associated with the + virtual machine. + :type network_interfaces: + list[~azure_arc_vmware_management_service_api.models.NetworkInterfaceUpdate] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[NetworkInterfaceUpdate]'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkProfileUpdate, self).__init__(**kwargs) + self.network_interfaces = kwargs.get('network_interfaces', None) + + +class NicIPAddressSettings(msrest.serialization.Model): + """IP address information for a virtual network adapter reported by the fabric. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar allocation_method: Gets the ip address allocation method. + :vartype allocation_method: str + :ivar ip_address: Gets the ip address for the nic. + :vartype ip_address: str + :ivar subnet_mask: Gets the mask. + :vartype subnet_mask: str + """ + + _validation = { + 'allocation_method': {'readonly': True}, + 'ip_address': {'readonly': True}, + 'subnet_mask': {'readonly': True}, + } + + _attribute_map = { + 'allocation_method': {'key': 'allocationMethod', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'subnet_mask': {'key': 'subnetMask', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NicIPAddressSettings, self).__init__(**kwargs) + self.allocation_method = None + self.ip_address = None + self.subnet_mask = None + + +class NicIPSettings(msrest.serialization.Model): + """Defines the network interface ip settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param allocation_method: Gets or sets the nic allocation method. Possible values include: + "unset", "dynamic", "static", "linklayer", "random", "other". + :type allocation_method: str or + ~azure_arc_vmware_management_service_api.models.IPAddressAllocationMethod + :param dns_servers: Gets or sets the dns servers. + :type dns_servers: list[str] + :param gateway: Gets or sets the gateway. + :type gateway: list[str] + :param ip_address: Gets or sets the ip address for the nic. + :type ip_address: str + :param subnet_mask: Gets or sets the mask. + :type subnet_mask: str + :ivar primary_wins_server: Gets or sets the primary server. + :vartype primary_wins_server: str + :ivar secondary_wins_server: Gets or sets the secondary server. + :vartype secondary_wins_server: str + :ivar ip_address_info: Gets or sets the IP address information being reported for this NIC. + This contains the same IPv4 information above plus IPV6 information. + :vartype ip_address_info: + list[~azure_arc_vmware_management_service_api.models.NicIPAddressSettings] + """ + + _validation = { + 'primary_wins_server': {'readonly': True}, + 'secondary_wins_server': {'readonly': True}, + 'ip_address_info': {'readonly': True}, + } + + _attribute_map = { + 'allocation_method': {'key': 'allocationMethod', 'type': 'str'}, + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + 'gateway': {'key': 'gateway', 'type': '[str]'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'subnet_mask': {'key': 'subnetMask', 'type': 'str'}, + 'primary_wins_server': {'key': 'primaryWinsServer', 'type': 'str'}, + 'secondary_wins_server': {'key': 'secondaryWinsServer', 'type': 'str'}, + 'ip_address_info': {'key': 'ipAddressInfo', 'type': '[NicIPAddressSettings]'}, + } + + def __init__( + self, + **kwargs + ): + super(NicIPSettings, self).__init__(**kwargs) + self.allocation_method = kwargs.get('allocation_method', None) + self.dns_servers = kwargs.get('dns_servers', None) + self.gateway = kwargs.get('gateway', None) + self.ip_address = kwargs.get('ip_address', None) + self.subnet_mask = kwargs.get('subnet_mask', None) + self.primary_wins_server = None + self.secondary_wins_server = None + self.ip_address_info = None + + +class Operation(msrest.serialization.Model): + """Operation provided by provider. + + :param name: Name of the operation. + :type name: str + :param is_data_action: Indicates whether the operation is data action or not. + :type is_data_action: bool + :param display: Properties of the operation. + :type display: ~azure_arc_vmware_management_service_api.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.is_data_action = kwargs.get('is_data_action', None) + self.display = kwargs.get('display', None) + + +class OperationDisplay(msrest.serialization.Model): + """Properties of the operation. + + :param provider: Provider name. + :type provider: str + :param resource: Resource name. + :type resource: str + :param operation: Operation name. + :type operation: str + :param description: Description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class OperationsList(msrest.serialization.Model): + """Lists the operations available. + + All required parameters must be populated in order to send to Azure. + + :param next_link: Url to follow for getting next page of operations. + :type next_link: str + :param value: Required. Array of operations. + :type value: list[~azure_arc_vmware_management_service_api.models.Operation] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationsList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs['value'] + + +class OsProfile(msrest.serialization.Model): + """Defines the resource properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param computer_name: Gets or sets computer name. + :type computer_name: str + :param admin_username: Gets or sets administrator username. + :type admin_username: str + :param admin_password: Gets or sets administrator password. + :type admin_password: str + :ivar os_type: Gets or sets the type of the os. Possible values include: "Windows", "Linux", + "Other". + :vartype os_type: str or ~azure_arc_vmware_management_service_api.models.OsType + :ivar os_name: Gets or sets os name. + :vartype os_name: str + :ivar tools_running_status: Gets or sets the current running status of VMware Tools running in + the guest operating system. + :vartype tools_running_status: str + :ivar tools_version_status: Gets or sets the current version status of VMware Tools installed + in the guest operating system. + :vartype tools_version_status: str + :ivar tools_version: Gets or sets the current version of VMware Tools. + :vartype tools_version: str + """ + + _validation = { + 'os_type': {'readonly': True}, + 'os_name': {'readonly': True}, + 'tools_running_status': {'readonly': True}, + 'tools_version_status': {'readonly': True}, + 'tools_version': {'readonly': True}, + } + + _attribute_map = { + 'computer_name': {'key': 'computerName', 'type': 'str'}, + 'admin_username': {'key': 'adminUsername', 'type': 'str'}, + 'admin_password': {'key': 'adminPassword', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'os_name': {'key': 'osName', 'type': 'str'}, + 'tools_running_status': {'key': 'toolsRunningStatus', 'type': 'str'}, + 'tools_version_status': {'key': 'toolsVersionStatus', 'type': 'str'}, + 'tools_version': {'key': 'toolsVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OsProfile, self).__init__(**kwargs) + self.computer_name = kwargs.get('computer_name', None) + self.admin_username = kwargs.get('admin_username', None) + self.admin_password = kwargs.get('admin_password', None) + self.os_type = None + self.os_name = None + self.tools_running_status = None + self.tools_version_status = None + self.tools_version = None + + +class ResourcePool(msrest.serialization.Model): + """Define the resourcePool. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. Gets or sets the location. + :type location: str + :param extended_location: Gets or sets the extended location. + :type extended_location: ~azure_arc_vmware_management_service_api.models.ExtendedLocation + :ivar system_data: The system data. + :vartype system_data: ~azure_arc_vmware_management_service_api.models.SystemData + :param tags: A set of tags. Gets or sets the Resource tags. + :type tags: dict[str, str] + :ivar name: Gets or sets the name. + :vartype name: str + :ivar id: Gets or sets the Id. + :vartype id: str + :ivar type: Gets or sets the type of the resource. + :vartype type: str + :param kind: Metadata used by portal/tooling/etc to render different UX experiences for + resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, + the resource provider must validate and persist this value. + :type kind: str + :ivar uuid: Gets or sets a unique identifier for this resource. + :vartype uuid: str + :param v_center_id: Gets or sets the ARM Id of the vCenter resource in which this resource pool + resides. + :type v_center_id: str + :param mo_ref_id: Gets or sets the vCenter MoRef (Managed Object Reference) ID for the resource + pool. + :type mo_ref_id: str + :param inventory_item_id: Gets or sets the inventory Item ID for the resource pool. + :type inventory_item_id: str + :ivar mo_name: Gets or sets the vCenter Managed Object name for the resource pool. + :vartype mo_name: str + :ivar cpu_shares_level: Gets or sets CPUSharesLevel which specifies the CPU allocation level + for this pool. + This property is used in relative allocation between resource consumers. + :vartype cpu_shares_level: str + :ivar cpu_reservation_m_hz: Gets or sets CPUReservationMHz which specifies the CPU size in MHz + that is guaranteed + to be available. + :vartype cpu_reservation_m_hz: long + :ivar cpu_limit_m_hz: Gets or sets CPULimitMHz which specifies a CPU usage limit in MHz. + Utilization will not exceed this limit even if there are available resources. + :vartype cpu_limit_m_hz: long + :ivar mem_shares_level: Gets or sets CPUSharesLevel which specifies the memory allocation level + for this pool. + This property is used in relative allocation between resource consumers. + :vartype mem_shares_level: str + :ivar mem_reservation_mb: Gets or sets MemReservationMB which specifies the guaranteed + available memory in + megabytes. + :vartype mem_reservation_mb: long + :ivar mem_limit_mb: Gets or sets MemLimitMB specifies a memory usage limit in megabytes. + Utilization will not exceed the specified limit even if there are available resources. + :vartype mem_limit_mb: long + :ivar custom_resource_name: Gets the name of the corresponding resource in Kubernetes. + :vartype custom_resource_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'uuid': {'readonly': True}, + 'mo_name': {'readonly': True}, + 'cpu_shares_level': {'readonly': True}, + 'cpu_reservation_m_hz': {'readonly': True}, + 'cpu_limit_m_hz': {'readonly': True}, + 'mem_shares_level': {'readonly': True}, + 'mem_reservation_mb': {'readonly': True}, + 'mem_limit_mb': {'readonly': True}, + 'custom_resource_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'uuid': {'key': 'properties.uuid', 'type': 'str'}, + 'v_center_id': {'key': 'properties.vCenterId', 'type': 'str'}, + 'mo_ref_id': {'key': 'properties.moRefId', 'type': 'str'}, + 'inventory_item_id': {'key': 'properties.inventoryItemId', 'type': 'str'}, + 'mo_name': {'key': 'properties.moName', 'type': 'str'}, + 'cpu_shares_level': {'key': 'properties.cpuSharesLevel', 'type': 'str'}, + 'cpu_reservation_m_hz': {'key': 'properties.cpuReservationMHz', 'type': 'long'}, + 'cpu_limit_m_hz': {'key': 'properties.cpuLimitMHz', 'type': 'long'}, + 'mem_shares_level': {'key': 'properties.memSharesLevel', 'type': 'str'}, + 'mem_reservation_mb': {'key': 'properties.memReservationMB', 'type': 'long'}, + 'mem_limit_mb': {'key': 'properties.memLimitMB', 'type': 'long'}, + 'custom_resource_name': {'key': 'properties.customResourceName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourcePool, self).__init__(**kwargs) + self.location = kwargs['location'] + self.extended_location = kwargs.get('extended_location', None) + self.system_data = None + self.tags = kwargs.get('tags', None) + self.name = None + self.id = None + self.type = None + self.kind = kwargs.get('kind', None) + self.uuid = None + self.v_center_id = kwargs.get('v_center_id', None) + self.mo_ref_id = kwargs.get('mo_ref_id', None) + self.inventory_item_id = kwargs.get('inventory_item_id', None) + self.mo_name = None + self.cpu_shares_level = None + self.cpu_reservation_m_hz = None + self.cpu_limit_m_hz = None + self.mem_shares_level = None + self.mem_reservation_mb = None + self.mem_limit_mb = None + self.custom_resource_name = None + self.provisioning_state = None + + +class ResourcePoolInventoryItem(InventoryItemProperties): + """The resource pool inventory item. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param inventory_type: Required. They inventory type.Constant filled by server. Possible + values include: "ResourcePool", "VirtualMachine", "VirtualMachineTemplate", "VirtualNetwork". + :type inventory_type: str or ~azure_arc_vmware_management_service_api.models.InventoryType + :param managed_resource_id: Gets or sets the tracked resource id corresponding to the inventory + resource. + :type managed_resource_id: str + :param mo_ref_id: Gets or sets the MoRef (Managed Object Reference) ID for the inventory item. + :type mo_ref_id: str + :param mo_name: Gets or sets the vCenter Managed Object name for the inventory item. + :type mo_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :param parent: Parent resourcePool inventory resource details. + :type parent: ~azure_arc_vmware_management_service_api.models.InventoryItemDetails + """ + + _validation = { + 'inventory_type': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'inventory_type': {'key': 'inventoryType', 'type': 'str'}, + 'managed_resource_id': {'key': 'managedResourceId', 'type': 'str'}, + 'mo_ref_id': {'key': 'moRefId', 'type': 'str'}, + 'mo_name': {'key': 'moName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'parent': {'key': 'parent', 'type': 'InventoryItemDetails'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourcePoolInventoryItem, self).__init__(**kwargs) + self.inventory_type = 'ResourcePool' # type: str + self.parent = kwargs.get('parent', None) + + +class ResourcePoolsList(msrest.serialization.Model): + """List of ResourcePools. + + All required parameters must be populated in order to send to Azure. + + :param next_link: Url to follow for getting next page of ResourcePools. + :type next_link: str + :param value: Required. Array of ResourcePools. + :type value: list[~azure_arc_vmware_management_service_api.models.ResourcePool] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[ResourcePool]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourcePoolsList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs['value'] + + +class StopVirtualMachineOptions(msrest.serialization.Model): + """Defines the stop action properties. + + :param skip_shutdown: Gets or sets a value indicating whether to request non-graceful VM + shutdown. True value for this flag indicates non-graceful shutdown whereas false indicates + otherwise. Defaults to false. + :type skip_shutdown: bool + """ + + _attribute_map = { + 'skip_shutdown': {'key': 'skipShutdown', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(StopVirtualMachineOptions, self).__init__(**kwargs) + self.skip_shutdown = kwargs.get('skip_shutdown', False) + + +class StorageProfile(msrest.serialization.Model): + """Defines the resource properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param disks: Gets or sets the list of virtual disks associated with the virtual machine. + :type disks: list[~azure_arc_vmware_management_service_api.models.VirtualDisk] + :ivar scsi_controllers: Gets or sets the list of virtual SCSI controllers associated with the + virtual machine. + :vartype scsi_controllers: + list[~azure_arc_vmware_management_service_api.models.VirtualSCSIController] + """ + + _validation = { + 'scsi_controllers': {'readonly': True}, + } + + _attribute_map = { + 'disks': {'key': 'disks', 'type': '[VirtualDisk]'}, + 'scsi_controllers': {'key': 'scsiControllers', 'type': '[VirtualSCSIController]'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageProfile, self).__init__(**kwargs) + self.disks = kwargs.get('disks', None) + self.scsi_controllers = None + + +class StorageProfileUpdate(msrest.serialization.Model): + """Defines the resource update properties. + + :param disks: Gets or sets the list of virtual disks associated with the virtual machine. + :type disks: list[~azure_arc_vmware_management_service_api.models.VirtualDiskUpdate] + """ + + _attribute_map = { + 'disks': {'key': 'disks', 'type': '[VirtualDiskUpdate]'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageProfileUpdate, self).__init__(**kwargs) + self.disks = kwargs.get('disks', None) + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure_arc_vmware_management_service_api.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or + ~azure_arc_vmware_management_service_api.models.CreatedByType + :param last_modified_at: The type of identity that last modified the resource. + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class VCenter(msrest.serialization.Model): + """Defines the vCenter. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. Gets or sets the location. + :type location: str + :param extended_location: Gets or sets the extended location. + :type extended_location: ~azure_arc_vmware_management_service_api.models.ExtendedLocation + :ivar system_data: The system data. + :vartype system_data: ~azure_arc_vmware_management_service_api.models.SystemData + :param tags: A set of tags. Gets or sets the Resource tags. + :type tags: dict[str, str] + :ivar name: Gets or sets the name. + :vartype name: str + :ivar id: Gets or sets the Id. + :vartype id: str + :ivar type: Gets or sets the type of the resource. + :vartype type: str + :param kind: Metadata used by portal/tooling/etc to render different UX experiences for + resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, + the resource provider must validate and persist this value. + :type kind: str + :ivar uuid: Gets or sets a unique identifier for this resource. + :vartype uuid: str + :param fqdn: Required. Gets or sets the FQDN/IPAddress of the vCenter. + :type fqdn: str + :param port: Gets or sets the port of the vCenter. + :type port: int + :ivar version: Gets or sets the version of the vCenter. + :vartype version: str + :ivar instance_uuid: Gets or sets the instance UUID of the vCenter. + :vartype instance_uuid: str + :ivar connection_status: Gets or sets the connection status to the vCenter. + :vartype connection_status: str + :ivar custom_resource_name: Gets the name of the corresponding resource in Kubernetes. + :vartype custom_resource_name: str + :param credentials: Username / Password Credentials to connect to vcenter. + :type credentials: ~azure_arc_vmware_management_service_api.models.VICredential + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'uuid': {'readonly': True}, + 'fqdn': {'required': True}, + 'port': {'maximum': 65535, 'minimum': 1}, + 'version': {'readonly': True}, + 'instance_uuid': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'custom_resource_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'uuid': {'key': 'properties.uuid', 'type': 'str'}, + 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'instance_uuid': {'key': 'properties.instanceUuid', 'type': 'str'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'custom_resource_name': {'key': 'properties.customResourceName', 'type': 'str'}, + 'credentials': {'key': 'properties.credentials', 'type': 'VICredential'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VCenter, self).__init__(**kwargs) + self.location = kwargs['location'] + self.extended_location = kwargs.get('extended_location', None) + self.system_data = None + self.tags = kwargs.get('tags', None) + self.name = None + self.id = None + self.type = None + self.kind = kwargs.get('kind', None) + self.uuid = None + self.fqdn = kwargs['fqdn'] + self.port = kwargs.get('port', None) + self.version = None + self.instance_uuid = None + self.connection_status = None + self.custom_resource_name = None + self.credentials = kwargs.get('credentials', None) + self.provisioning_state = None + + +class VCentersList(msrest.serialization.Model): + """List of VCenters. + + All required parameters must be populated in order to send to Azure. + + :param next_link: Url to follow for getting next page of VCenters. + :type next_link: str + :param value: Required. Array of VCenters. + :type value: list[~azure_arc_vmware_management_service_api.models.VCenter] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[VCenter]'}, + } + + def __init__( + self, + **kwargs + ): + super(VCentersList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs['value'] + + +class VICredential(msrest.serialization.Model): + """Username / Password Credentials to connect to vcenter. + + :param username: Gets or sets username to connect with the vCenter. + :type username: str + :param password: Gets or sets the password to connect with the vCenter. + :type password: str + """ + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VICredential, self).__init__(**kwargs) + self.username = kwargs.get('username', None) + self.password = kwargs.get('password', None) + + +class VirtualDisk(msrest.serialization.Model): + """Virtual disk model. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param name: Gets or sets the name of the virtual disk. + :type name: str + :ivar label: Gets or sets the label of the virtual disk in vCenter. + :vartype label: str + :ivar disk_object_id: Gets or sets the disk object id. + :vartype disk_object_id: str + :param disk_size_gb: Gets or sets the disk total size. + :type disk_size_gb: int + :param device_key: Gets or sets the device key value. + :type device_key: int + :param disk_mode: Gets or sets the disk mode. Possible values include: "persistent", + "independent_persistent", "independent_nonpersistent". + :type disk_mode: str or ~azure_arc_vmware_management_service_api.models.DiskMode + :param controller_key: Gets or sets the controller id. + :type controller_key: int + :param unit_number: Gets or sets the unit number of the disk on the controller. + :type unit_number: int + """ + + _validation = { + 'label': {'readonly': True}, + 'disk_object_id': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + 'disk_object_id': {'key': 'diskObjectId', 'type': 'str'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'device_key': {'key': 'deviceKey', 'type': 'int'}, + 'disk_mode': {'key': 'diskMode', 'type': 'str'}, + 'controller_key': {'key': 'controllerKey', 'type': 'int'}, + 'unit_number': {'key': 'unitNumber', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualDisk, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.label = None + self.disk_object_id = None + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.device_key = kwargs.get('device_key', None) + self.disk_mode = kwargs.get('disk_mode', None) + self.controller_key = kwargs.get('controller_key', None) + self.unit_number = kwargs.get('unit_number', None) + + +class VirtualDiskUpdate(msrest.serialization.Model): + """Defines the virtual disk update. + + :param name: Gets or sets the name of the virtual disk. + :type name: str + :param disk_size_gb: Gets or sets the disk total size. + :type disk_size_gb: int + :param device_key: Gets or sets the device key value. + :type device_key: int + :param disk_mode: Gets or sets the disk mode. Possible values include: "persistent", + "independent_persistent", "independent_nonpersistent". + :type disk_mode: str or ~azure_arc_vmware_management_service_api.models.DiskMode + :param controller_key: Gets or sets the controller id. + :type controller_key: int + :param unit_number: Gets or sets the unit number of the disk on the controller. + :type unit_number: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'device_key': {'key': 'deviceKey', 'type': 'int'}, + 'disk_mode': {'key': 'diskMode', 'type': 'str'}, + 'controller_key': {'key': 'controllerKey', 'type': 'int'}, + 'unit_number': {'key': 'unitNumber', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualDiskUpdate, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.device_key = kwargs.get('device_key', None) + self.disk_mode = kwargs.get('disk_mode', None) + self.controller_key = kwargs.get('controller_key', None) + self.unit_number = kwargs.get('unit_number', None) + + +class VirtualMachine(msrest.serialization.Model): + """Define the virtualMachine. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. Gets or sets the location. + :type location: str + :param extended_location: Gets or sets the extended location. + :type extended_location: ~azure_arc_vmware_management_service_api.models.ExtendedLocation + :ivar system_data: The system data. + :vartype system_data: ~azure_arc_vmware_management_service_api.models.SystemData + :param tags: A set of tags. Gets or sets the Resource tags. + :type tags: dict[str, str] + :ivar name: Gets or sets the name. + :vartype name: str + :ivar id: Gets or sets the Id. + :vartype id: str + :ivar type: Gets or sets the type of the resource. + :vartype type: str + :param kind: Metadata used by portal/tooling/etc to render different UX experiences for + resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, + the resource provider must validate and persist this value. + :type kind: str + :param identity: The identity of the resource. + :type identity: ~azure_arc_vmware_management_service_api.models.Identity + :param resource_pool_id: Gets or sets the ARM Id of the resourcePool resource on which this + virtual machine will + deploy. + :type resource_pool_id: str + :param template_id: Gets or sets the ARM Id of the template resource to deploy the virtual + machine. + :type template_id: str + :param v_center_id: Gets or sets the ARM Id of the vCenter resource in which this resource pool + resides. + :type v_center_id: str + :param os_profile: OS properties. + :type os_profile: ~azure_arc_vmware_management_service_api.models.OsProfile + :param hardware_profile: Hardware properties. + :type hardware_profile: ~azure_arc_vmware_management_service_api.models.HardwareProfile + :param network_profile: Network properties. + :type network_profile: ~azure_arc_vmware_management_service_api.models.NetworkProfile + :param storage_profile: Storage properties. + :type storage_profile: ~azure_arc_vmware_management_service_api.models.StorageProfile + :param mo_ref_id: Gets or sets the vCenter MoRef (Managed Object Reference) ID for the virtual + machine. + :type mo_ref_id: str + :param inventory_item_id: Gets or sets the inventory Item ID for the virtual machine. + :type inventory_item_id: str + :ivar mo_name: Gets or sets the vCenter Managed Object name for the virtual machine. + :vartype mo_name: str + :ivar folder_path: Gets or sets the folder path of the vm. + :vartype folder_path: str + :ivar instance_uuid: Gets or sets the instance uuid of the vm. + :vartype instance_uuid: str + :ivar power_state: Gets the power state of the virtual machine. + :vartype power_state: str + :ivar custom_resource_name: Gets the name of the corresponding resource in Kubernetes. + :vartype custom_resource_name: str + :ivar uuid: Gets or sets a unique identifier for this resource. + :vartype uuid: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :ivar vm_id: Gets or sets a unique identifier for the vm resource. + :vartype vm_id: str + """ + + _validation = { + 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'mo_name': {'readonly': True}, + 'folder_path': {'readonly': True}, + 'instance_uuid': {'readonly': True}, + 'power_state': {'readonly': True}, + 'custom_resource_name': {'readonly': True}, + 'uuid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'vm_id': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'resource_pool_id': {'key': 'properties.resourcePoolId', 'type': 'str'}, + 'template_id': {'key': 'properties.templateId', 'type': 'str'}, + 'v_center_id': {'key': 'properties.vCenterId', 'type': 'str'}, + 'os_profile': {'key': 'properties.osProfile', 'type': 'OsProfile'}, + 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + 'mo_ref_id': {'key': 'properties.moRefId', 'type': 'str'}, + 'inventory_item_id': {'key': 'properties.inventoryItemId', 'type': 'str'}, + 'mo_name': {'key': 'properties.moName', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'instance_uuid': {'key': 'properties.instanceUuid', 'type': 'str'}, + 'power_state': {'key': 'properties.powerState', 'type': 'str'}, + 'custom_resource_name': {'key': 'properties.customResourceName', 'type': 'str'}, + 'uuid': {'key': 'properties.uuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachine, self).__init__(**kwargs) + self.location = kwargs['location'] + self.extended_location = kwargs.get('extended_location', None) + self.system_data = None + self.tags = kwargs.get('tags', None) + self.name = None + self.id = None + self.type = None + self.kind = kwargs.get('kind', None) + self.identity = kwargs.get('identity', None) + self.resource_pool_id = kwargs.get('resource_pool_id', None) + self.template_id = kwargs.get('template_id', None) + self.v_center_id = kwargs.get('v_center_id', None) + self.os_profile = kwargs.get('os_profile', None) + self.hardware_profile = kwargs.get('hardware_profile', None) + self.network_profile = kwargs.get('network_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.mo_ref_id = kwargs.get('mo_ref_id', None) + self.inventory_item_id = kwargs.get('inventory_item_id', None) + self.mo_name = None + self.folder_path = None + self.instance_uuid = None + self.power_state = None + self.custom_resource_name = None + self.uuid = None + self.provisioning_state = None + self.vm_id = None + + +class VirtualMachineInventoryItem(InventoryItemProperties): + """The VM inventory item. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param inventory_type: Required. They inventory type.Constant filled by server. Possible + values include: "ResourcePool", "VirtualMachine", "VirtualMachineTemplate", "VirtualNetwork". + :type inventory_type: str or ~azure_arc_vmware_management_service_api.models.InventoryType + :param managed_resource_id: Gets or sets the tracked resource id corresponding to the inventory + resource. + :type managed_resource_id: str + :param mo_ref_id: Gets or sets the MoRef (Managed Object Reference) ID for the inventory item. + :type mo_ref_id: str + :param mo_name: Gets or sets the vCenter Managed Object name for the inventory item. + :type mo_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :ivar os_type: Gets or sets the type of the os. Possible values include: "Windows", "Linux", + "Other". + :vartype os_type: str or ~azure_arc_vmware_management_service_api.models.OsType + :param os_name: Gets or sets os name. + :type os_name: str + :param ip_addresses: Gets or sets the nic ip addresses. + :type ip_addresses: list[str] + :param folder_path: Gets or sets the folder path of the vm. + :type folder_path: str + :param host: Host inventory resource details. + :type host: ~azure_arc_vmware_management_service_api.models.InventoryItemDetails + :param resource_pool: ResourcePool inventory resource details. + :type resource_pool: ~azure_arc_vmware_management_service_api.models.InventoryItemDetails + :param instance_uuid: Gets or sets the instance uuid of the vm. + :type instance_uuid: str + """ + + _validation = { + 'inventory_type': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'os_type': {'readonly': True}, + } + + _attribute_map = { + 'inventory_type': {'key': 'inventoryType', 'type': 'str'}, + 'managed_resource_id': {'key': 'managedResourceId', 'type': 'str'}, + 'mo_ref_id': {'key': 'moRefId', 'type': 'str'}, + 'mo_name': {'key': 'moName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'os_name': {'key': 'osName', 'type': 'str'}, + 'ip_addresses': {'key': 'ipAddresses', 'type': '[str]'}, + 'folder_path': {'key': 'folderPath', 'type': 'str'}, + 'host': {'key': 'host', 'type': 'InventoryItemDetails'}, + 'resource_pool': {'key': 'resourcePool', 'type': 'InventoryItemDetails'}, + 'instance_uuid': {'key': 'instanceUuid', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineInventoryItem, self).__init__(**kwargs) + self.inventory_type = 'VirtualMachine' # type: str + self.os_type = None + self.os_name = kwargs.get('os_name', None) + self.ip_addresses = kwargs.get('ip_addresses', None) + self.folder_path = kwargs.get('folder_path', None) + self.host = kwargs.get('host', None) + self.resource_pool = kwargs.get('resource_pool', None) + self.instance_uuid = kwargs.get('instance_uuid', None) + + +class VirtualMachinesList(msrest.serialization.Model): + """List of VirtualMachines. + + All required parameters must be populated in order to send to Azure. + + :param next_link: Url to follow for getting next page of VirtualMachines. + :type next_link: str + :param value: Required. Array of VirtualMachines. + :type value: list[~azure_arc_vmware_management_service_api.models.VirtualMachine] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[VirtualMachine]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachinesList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs['value'] + + +class VirtualMachineTemplate(msrest.serialization.Model): + """Define the virtualMachineTemplate. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. Gets or sets the location. + :type location: str + :param extended_location: Gets or sets the extended location. + :type extended_location: ~azure_arc_vmware_management_service_api.models.ExtendedLocation + :ivar system_data: The system data. + :vartype system_data: ~azure_arc_vmware_management_service_api.models.SystemData + :param tags: A set of tags. Gets or sets the Resource tags. + :type tags: dict[str, str] + :ivar name: Gets or sets the name. + :vartype name: str + :ivar id: Gets or sets the Id. + :vartype id: str + :ivar type: Gets or sets the type of the resource. + :vartype type: str + :param kind: Metadata used by portal/tooling/etc to render different UX experiences for + resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, + the resource provider must validate and persist this value. + :type kind: str + :ivar uuid: Gets or sets a unique identifier for this resource. + :vartype uuid: str + :param v_center_id: Gets or sets the ARM Id of the vCenter resource in which this template + resides. + :type v_center_id: str + :param mo_ref_id: Gets or sets the vCenter MoRef (Managed Object Reference) ID for the virtual + machine + template. + :type mo_ref_id: str + :param inventory_item_id: Gets or sets the inventory Item ID for the virtual machine template. + :type inventory_item_id: str + :ivar mo_name: Gets or sets the vCenter Managed Object name for the virtual machine template. + :vartype mo_name: str + :ivar memory_size_mb: Gets or sets memory size in MBs for the template. + :vartype memory_size_mb: int + :ivar num_cp_us: Gets or sets the number of vCPUs for the template. + :vartype num_cp_us: int + :ivar num_cores_per_socket: Gets or sets the number of cores per socket for the template. + Defaults to 1 if unspecified. + :vartype num_cores_per_socket: int + :ivar os_type: Gets or sets the type of the os. Possible values include: "Windows", "Linux", + "Other". + :vartype os_type: str or ~azure_arc_vmware_management_service_api.models.OsType + :ivar os_name: Gets or sets os name. + :vartype os_name: str + :ivar folder_path: Gets or sets the folder path of the template. + :vartype folder_path: str + :ivar network_interfaces: Gets or sets the network interfaces of the template. + :vartype network_interfaces: + list[~azure_arc_vmware_management_service_api.models.NetworkInterface] + :ivar disks: Gets or sets the disks the template. + :vartype disks: list[~azure_arc_vmware_management_service_api.models.VirtualDisk] + :ivar custom_resource_name: Gets the name of the corresponding resource in Kubernetes. + :vartype custom_resource_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'uuid': {'readonly': True}, + 'mo_name': {'readonly': True}, + 'memory_size_mb': {'readonly': True}, + 'num_cp_us': {'readonly': True}, + 'num_cores_per_socket': {'readonly': True}, + 'os_type': {'readonly': True}, + 'os_name': {'readonly': True}, + 'folder_path': {'readonly': True}, + 'network_interfaces': {'readonly': True}, + 'disks': {'readonly': True}, + 'custom_resource_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'uuid': {'key': 'properties.uuid', 'type': 'str'}, + 'v_center_id': {'key': 'properties.vCenterId', 'type': 'str'}, + 'mo_ref_id': {'key': 'properties.moRefId', 'type': 'str'}, + 'inventory_item_id': {'key': 'properties.inventoryItemId', 'type': 'str'}, + 'mo_name': {'key': 'properties.moName', 'type': 'str'}, + 'memory_size_mb': {'key': 'properties.memorySizeMB', 'type': 'int'}, + 'num_cp_us': {'key': 'properties.numCPUs', 'type': 'int'}, + 'num_cores_per_socket': {'key': 'properties.numCoresPerSocket', 'type': 'int'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'os_name': {'key': 'properties.osName', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'network_interfaces': {'key': 'properties.networkInterfaces', 'type': '[NetworkInterface]'}, + 'disks': {'key': 'properties.disks', 'type': '[VirtualDisk]'}, + 'custom_resource_name': {'key': 'properties.customResourceName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineTemplate, self).__init__(**kwargs) + self.location = kwargs['location'] + self.extended_location = kwargs.get('extended_location', None) + self.system_data = None + self.tags = kwargs.get('tags', None) + self.name = None + self.id = None + self.type = None + self.kind = kwargs.get('kind', None) + self.uuid = None + self.v_center_id = kwargs.get('v_center_id', None) + self.mo_ref_id = kwargs.get('mo_ref_id', None) + self.inventory_item_id = kwargs.get('inventory_item_id', None) + self.mo_name = None + self.memory_size_mb = None + self.num_cp_us = None + self.num_cores_per_socket = None + self.os_type = None + self.os_name = None + self.folder_path = None + self.network_interfaces = None + self.disks = None + self.custom_resource_name = None + self.provisioning_state = None + + +class VirtualMachineTemplateInventoryItem(InventoryItemProperties): + """The VM Template inventory item. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param inventory_type: Required. They inventory type.Constant filled by server. Possible + values include: "ResourcePool", "VirtualMachine", "VirtualMachineTemplate", "VirtualNetwork". + :type inventory_type: str or ~azure_arc_vmware_management_service_api.models.InventoryType + :param managed_resource_id: Gets or sets the tracked resource id corresponding to the inventory + resource. + :type managed_resource_id: str + :param mo_ref_id: Gets or sets the MoRef (Managed Object Reference) ID for the inventory item. + :type mo_ref_id: str + :param mo_name: Gets or sets the vCenter Managed Object name for the inventory item. + :type mo_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :param memory_size_mb: Gets or sets memory size in MBs for the template. + :type memory_size_mb: int + :param num_cp_us: Gets or sets the number of vCPUs for the template. + :type num_cp_us: int + :param num_cores_per_socket: Gets or sets the number of cores per socket for the template. + Defaults to 1 if unspecified. + :type num_cores_per_socket: int + :ivar os_type: Gets or sets the type of the os. Possible values include: "Windows", "Linux", + "Other". + :vartype os_type: str or ~azure_arc_vmware_management_service_api.models.OsType + :param os_name: Gets or sets os name. + :type os_name: str + :param folder_path: Gets or sets the folder path of the template. + :type folder_path: str + """ + + _validation = { + 'inventory_type': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'os_type': {'readonly': True}, + } + + _attribute_map = { + 'inventory_type': {'key': 'inventoryType', 'type': 'str'}, + 'managed_resource_id': {'key': 'managedResourceId', 'type': 'str'}, + 'mo_ref_id': {'key': 'moRefId', 'type': 'str'}, + 'mo_name': {'key': 'moName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'memory_size_mb': {'key': 'memorySizeMB', 'type': 'int'}, + 'num_cp_us': {'key': 'numCPUs', 'type': 'int'}, + 'num_cores_per_socket': {'key': 'numCoresPerSocket', 'type': 'int'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'os_name': {'key': 'osName', 'type': 'str'}, + 'folder_path': {'key': 'folderPath', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineTemplateInventoryItem, self).__init__(**kwargs) + self.inventory_type = 'VirtualMachineTemplate' # type: str + self.memory_size_mb = kwargs.get('memory_size_mb', None) + self.num_cp_us = kwargs.get('num_cp_us', None) + self.num_cores_per_socket = kwargs.get('num_cores_per_socket', None) + self.os_type = None + self.os_name = kwargs.get('os_name', None) + self.folder_path = kwargs.get('folder_path', None) + + +class VirtualMachineTemplatesList(msrest.serialization.Model): + """List of VirtualMachineTemplates. + + All required parameters must be populated in order to send to Azure. + + :param next_link: Url to follow for getting next page of VirtualMachineTemplates. + :type next_link: str + :param value: Required. Array of VirtualMachineTemplates. + :type value: list[~azure_arc_vmware_management_service_api.models.VirtualMachineTemplate] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[VirtualMachineTemplate]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineTemplatesList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs['value'] + + +class VirtualMachineUpdate(msrest.serialization.Model): + """Defines the virtualMachineUpdate. + + :param tags: A set of tags. Gets or sets the Resource tags. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure_arc_vmware_management_service_api.models.Identity + :param hardware_profile: Defines the resource properties. + :type hardware_profile: ~azure_arc_vmware_management_service_api.models.HardwareProfile + :param storage_profile: Defines the resource update properties. + :type storage_profile: ~azure_arc_vmware_management_service_api.models.StorageProfileUpdate + :param network_profile: Defines the update resource properties. + :type network_profile: ~azure_arc_vmware_management_service_api.models.NetworkProfileUpdate + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfileUpdate'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfileUpdate'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.hardware_profile = kwargs.get('hardware_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.network_profile = kwargs.get('network_profile', None) + + +class VirtualNetwork(msrest.serialization.Model): + """Define the virtualNetwork. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. Gets or sets the location. + :type location: str + :param extended_location: Gets or sets the extended location. + :type extended_location: ~azure_arc_vmware_management_service_api.models.ExtendedLocation + :ivar system_data: The system data. + :vartype system_data: ~azure_arc_vmware_management_service_api.models.SystemData + :param tags: A set of tags. Gets or sets the Resource tags. + :type tags: dict[str, str] + :ivar name: Gets or sets the name. + :vartype name: str + :ivar id: Gets or sets the Id. + :vartype id: str + :ivar type: Gets or sets the type of the resource. + :vartype type: str + :param kind: Metadata used by portal/tooling/etc to render different UX experiences for + resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, + the resource provider must validate and persist this value. + :type kind: str + :ivar uuid: Gets or sets a unique identifier for this resource. + :vartype uuid: str + :param v_center_id: Gets or sets the ARM Id of the vCenter resource in which this template + resides. + :type v_center_id: str + :param mo_ref_id: Gets or sets the vCenter MoRef (Managed Object Reference) ID for the virtual + network. + :type mo_ref_id: str + :param inventory_item_id: Gets or sets the inventory Item ID for the virtual network. + :type inventory_item_id: str + :ivar mo_name: Gets or sets the vCenter Managed Object name for the virtual network. + :vartype mo_name: str + :ivar custom_resource_name: Gets the name of the corresponding resource in Kubernetes. + :vartype custom_resource_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'uuid': {'readonly': True}, + 'mo_name': {'readonly': True}, + 'custom_resource_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'uuid': {'key': 'properties.uuid', 'type': 'str'}, + 'v_center_id': {'key': 'properties.vCenterId', 'type': 'str'}, + 'mo_ref_id': {'key': 'properties.moRefId', 'type': 'str'}, + 'inventory_item_id': {'key': 'properties.inventoryItemId', 'type': 'str'}, + 'mo_name': {'key': 'properties.moName', 'type': 'str'}, + 'custom_resource_name': {'key': 'properties.customResourceName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetwork, self).__init__(**kwargs) + self.location = kwargs['location'] + self.extended_location = kwargs.get('extended_location', None) + self.system_data = None + self.tags = kwargs.get('tags', None) + self.name = None + self.id = None + self.type = None + self.kind = kwargs.get('kind', None) + self.uuid = None + self.v_center_id = kwargs.get('v_center_id', None) + self.mo_ref_id = kwargs.get('mo_ref_id', None) + self.inventory_item_id = kwargs.get('inventory_item_id', None) + self.mo_name = None + self.custom_resource_name = None + self.provisioning_state = None + + +class VirtualNetworkInventoryItem(InventoryItemProperties): + """The Virtual network inventory item. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param inventory_type: Required. They inventory type.Constant filled by server. Possible + values include: "ResourcePool", "VirtualMachine", "VirtualMachineTemplate", "VirtualNetwork". + :type inventory_type: str or ~azure_arc_vmware_management_service_api.models.InventoryType + :param managed_resource_id: Gets or sets the tracked resource id corresponding to the inventory + resource. + :type managed_resource_id: str + :param mo_ref_id: Gets or sets the MoRef (Managed Object Reference) ID for the inventory item. + :type mo_ref_id: str + :param mo_name: Gets or sets the vCenter Managed Object name for the inventory item. + :type mo_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'inventory_type': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'inventory_type': {'key': 'inventoryType', 'type': 'str'}, + 'managed_resource_id': {'key': 'managedResourceId', 'type': 'str'}, + 'mo_ref_id': {'key': 'moRefId', 'type': 'str'}, + 'mo_name': {'key': 'moName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkInventoryItem, self).__init__(**kwargs) + self.inventory_type = 'VirtualNetwork' # type: str + + +class VirtualNetworksList(msrest.serialization.Model): + """List of VirtualNetworks. + + All required parameters must be populated in order to send to Azure. + + :param next_link: Url to follow for getting next page of VirtualNetworks. + :type next_link: str + :param value: Required. Array of VirtualNetworks. + :type value: list[~azure_arc_vmware_management_service_api.models.VirtualNetwork] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[VirtualNetwork]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworksList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs['value'] + + +class VirtualSCSIController(msrest.serialization.Model): + """This data object type contains the properties of a SCSI controller device attached to a virtual machine that is reported by the controller. + + :param type: Gets or sets the controller type. Possible values include: "lsilogic", "buslogic", + "pvscsi", "lsilogicsas". + :type type: str or ~azure_arc_vmware_management_service_api.models.SCSIControllerType + :param controller_key: Gets or sets the key of the controller. + :type controller_key: int + :param bus_number: Gets or sets the bus number of the controller. + :type bus_number: int + :param scsi_ctlr_unit_number: Gets or sets the SCSI controller unit number. + :type scsi_ctlr_unit_number: int + :param sharing: Gets or sets the sharing mode. Possible values include: "noSharing", + "physicalSharing", "virtualSharing". + :type sharing: str or ~azure_arc_vmware_management_service_api.models.VirtualSCSISharing + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'controller_key': {'key': 'controllerKey', 'type': 'int'}, + 'bus_number': {'key': 'busNumber', 'type': 'int'}, + 'scsi_ctlr_unit_number': {'key': 'scsiCtlrUnitNumber', 'type': 'int'}, + 'sharing': {'key': 'sharing', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualSCSIController, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.controller_key = kwargs.get('controller_key', None) + self.bus_number = kwargs.get('bus_number', None) + self.scsi_ctlr_unit_number = kwargs.get('scsi_ctlr_unit_number', None) + self.sharing = kwargs.get('sharing', None) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/_models_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/_models_py3.py new file mode 100644 index 00000000000..9d03d5a0e0d --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/_models_py3.py @@ -0,0 +1,2898 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._azure_arc_vmware_management_service_api_enums import * + + +class Condition(msrest.serialization.Model): + """Condition defines an extension to status. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status: Status of the condition. + :vartype status: str + :ivar reason: The reason for the condition's status. + :vartype reason: str + :ivar message: A human readable message indicating details about the status. + :vartype message: str + :ivar severity: Severity with which to treat failures of this type of condition. + :vartype severity: str + """ + + _validation = { + 'status': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + 'severity': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'severity': {'key': 'severity', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Condition, self).__init__(**kwargs) + self.status = None + self.reason = None + self.message = None + self.severity = None + + +class ErrorDefinition(msrest.serialization.Model): + """Error definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Service specific error code which serves as the substatus for the HTTP error code. + :vartype code: str + :ivar message: Description of the error. + :vartype message: str + :ivar details: Internal error details. + :vartype details: list[~azure_arc_vmware_management_service_api.models.ErrorDefinition] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDefinition]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDefinition, self).__init__(**kwargs) + self.code = None + self.message = None + self.details = None + + +class ErrorResponse(msrest.serialization.Model): + """Error response. + + :param error: The error details. + :type error: ~azure_arc_vmware_management_service_api.models.ErrorDefinition + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDefinition'}, + } + + def __init__( + self, + *, + error: Optional["ErrorDefinition"] = None, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ExtendedLocation(msrest.serialization.Model): + """The extended location. + + :param type: The extended location type. + :type type: str + :param name: The extended location name. + :type name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[str] = None, + name: Optional[str] = None, + **kwargs + ): + super(ExtendedLocation, self).__init__(**kwargs) + self.type = type + self.name = name + + +class Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class ProxyResource(Resource): + """The resource model definition for an Azure Resource Manager proxy resource. It will have everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + + +class GuestAgent(ProxyResource): + """Defines the GuestAgent. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: The system data. + :vartype system_data: ~azure_arc_vmware_management_service_api.models.SystemData + :param credentials: Username / Password Credentials to provision guest agent. + :type credentials: ~azure_arc_vmware_management_service_api.models.GuestCredential + :param provisioning_action: Gets or sets the guest agent provisioning action. Possible values + include: "install", "uninstall", "repair". + :type provisioning_action: str or + ~azure_arc_vmware_management_service_api.models.ProvisioningAction + :ivar status: Gets or sets the guest agent status. + :vartype status: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'credentials': {'key': 'properties.credentials', 'type': 'GuestCredential'}, + 'provisioning_action': {'key': 'properties.provisioningAction', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + credentials: Optional["GuestCredential"] = None, + provisioning_action: Optional[Union[str, "ProvisioningAction"]] = None, + **kwargs + ): + super(GuestAgent, self).__init__(**kwargs) + self.system_data = None + self.credentials = credentials + self.provisioning_action = provisioning_action + self.status = None + self.provisioning_state = None + + +class GuestAgentList(msrest.serialization.Model): + """List of GuestAgent. + + All required parameters must be populated in order to send to Azure. + + :param next_link: Url to follow for getting next page of GuestAgent. + :type next_link: str + :param value: Required. Array of GuestAgent. + :type value: list[~azure_arc_vmware_management_service_api.models.GuestAgent] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[GuestAgent]'}, + } + + def __init__( + self, + *, + value: List["GuestAgent"], + next_link: Optional[str] = None, + **kwargs + ): + super(GuestAgentList, self).__init__(**kwargs) + self.next_link = next_link + self.value = value + + +class GuestCredential(msrest.serialization.Model): + """Username / Password Credentials to connect to guest. + + :param username: Gets or sets username to connect with the guest. + :type username: str + :param password: Gets or sets the password to connect with the guest. + :type password: str + """ + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__( + self, + *, + username: Optional[str] = None, + password: Optional[str] = None, + **kwargs + ): + super(GuestCredential, self).__init__(**kwargs) + self.username = username + self.password = password + + +class HardwareProfile(msrest.serialization.Model): + """Defines the resource properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param memory_size_mb: Gets or sets memory size in MBs for the vm. + :type memory_size_mb: int + :param num_cp_us: Gets or sets the number of vCPUs for the vm. + :type num_cp_us: int + :param num_cores_per_socket: Gets or sets the number of cores per socket for the vm. Defaults + to 1 if unspecified. + :type num_cores_per_socket: int + :ivar cpu_hot_add_enabled: Gets or sets a value indicating whether virtual processors can be + added while this virtual machine is running. + :vartype cpu_hot_add_enabled: bool + :ivar cpu_hot_remove_enabled: Gets or sets a value indicating whether virtual processors can be + removed while this virtual machine is running. + :vartype cpu_hot_remove_enabled: bool + :ivar memory_hot_add_enabled: Gets or sets a value indicating whether memory can be added while + this virtual machine is running. + :vartype memory_hot_add_enabled: bool + """ + + _validation = { + 'cpu_hot_add_enabled': {'readonly': True}, + 'cpu_hot_remove_enabled': {'readonly': True}, + 'memory_hot_add_enabled': {'readonly': True}, + } + + _attribute_map = { + 'memory_size_mb': {'key': 'memorySizeMB', 'type': 'int'}, + 'num_cp_us': {'key': 'numCPUs', 'type': 'int'}, + 'num_cores_per_socket': {'key': 'numCoresPerSocket', 'type': 'int'}, + 'cpu_hot_add_enabled': {'key': 'cpuHotAddEnabled', 'type': 'bool'}, + 'cpu_hot_remove_enabled': {'key': 'cpuHotRemoveEnabled', 'type': 'bool'}, + 'memory_hot_add_enabled': {'key': 'memoryHotAddEnabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + memory_size_mb: Optional[int] = None, + num_cp_us: Optional[int] = None, + num_cores_per_socket: Optional[int] = None, + **kwargs + ): + super(HardwareProfile, self).__init__(**kwargs) + self.memory_size_mb = memory_size_mb + self.num_cp_us = num_cp_us + self.num_cores_per_socket = num_cores_per_socket + self.cpu_hot_add_enabled = None + self.cpu_hot_remove_enabled = None + self.memory_hot_add_enabled = None + + +class HybridIdentityMetadata(ProxyResource): + """Defines the HybridIdentityMetadata. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: The system data. + :vartype system_data: ~azure_arc_vmware_management_service_api.models.SystemData + :param vm_id: Gets or sets the Vm Id. + :type vm_id: str + :param public_key: Gets or sets the Public Key. + :type public_key: str + :ivar identity: The identity of the resource. + :vartype identity: ~azure_arc_vmware_management_service_api.models.Identity + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'identity': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + 'public_key': {'key': 'properties.publicKey', 'type': 'str'}, + 'identity': {'key': 'properties.identity', 'type': 'Identity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + vm_id: Optional[str] = None, + public_key: Optional[str] = None, + **kwargs + ): + super(HybridIdentityMetadata, self).__init__(**kwargs) + self.system_data = None + self.vm_id = vm_id + self.public_key = public_key + self.identity = None + self.provisioning_state = None + + +class HybridIdentityMetadataList(msrest.serialization.Model): + """List of HybridIdentityMetadata. + + All required parameters must be populated in order to send to Azure. + + :param next_link: Url to follow for getting next page of HybridIdentityMetadata. + :type next_link: str + :param value: Required. Array of HybridIdentityMetadata. + :type value: list[~azure_arc_vmware_management_service_api.models.HybridIdentityMetadata] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[HybridIdentityMetadata]'}, + } + + def __init__( + self, + *, + value: List["HybridIdentityMetadata"], + next_link: Optional[str] = None, + **kwargs + ): + super(HybridIdentityMetadataList, self).__init__(**kwargs) + self.next_link = next_link + self.value = value + + +class Identity(msrest.serialization.Model): + """Managed service identity. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar principal_id: The principal id of managed service identity. + :vartype principal_id: str + :ivar tenant_id: The tenant of managed service identity. + :vartype tenant_id: str + :param type: Required. The type of managed service identity. Possible values include: "None", + "SystemAssigned". + :type type: str or ~azure_arc_vmware_management_service_api.models.IdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Union[str, "IdentityType"], + **kwargs + ): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + + +class InventoryItem(ProxyResource): + """Defines the inventory item. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: The system data. + :vartype system_data: ~azure_arc_vmware_management_service_api.models.SystemData + :param inventory_type: Required. They inventory type.Constant filled by server. Possible + values include: "ResourcePool", "VirtualMachine", "VirtualMachineTemplate", "VirtualNetwork". + :type inventory_type: str or ~azure_arc_vmware_management_service_api.models.InventoryType + :param managed_resource_id: Gets or sets the tracked resource id corresponding to the inventory + resource. + :type managed_resource_id: str + :param mo_ref_id: Gets or sets the MoRef (Managed Object Reference) ID for the inventory item. + :type mo_ref_id: str + :param mo_name: Gets or sets the vCenter Managed Object name for the inventory item. + :type mo_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'inventory_type': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'inventory_type': {'key': 'properties.inventoryType', 'type': 'str'}, + 'managed_resource_id': {'key': 'properties.managedResourceId', 'type': 'str'}, + 'mo_ref_id': {'key': 'properties.moRefId', 'type': 'str'}, + 'mo_name': {'key': 'properties.moName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + managed_resource_id: Optional[str] = None, + mo_ref_id: Optional[str] = None, + mo_name: Optional[str] = None, + **kwargs + ): + super(InventoryItem, self).__init__(**kwargs) + self.system_data = None + self.inventory_type = None # type: Optional[str] + self.managed_resource_id = managed_resource_id + self.mo_ref_id = mo_ref_id + self.mo_name = mo_name + self.provisioning_state = None + + +class InventoryItemDetails(msrest.serialization.Model): + """Defines the resource properties. + + :param inventory_item_id: Gets or sets the inventory Item ID for the resource. + :type inventory_item_id: str + :param mo_name: Gets or sets the vCenter Managed Object name for the resource. + :type mo_name: str + """ + + _attribute_map = { + 'inventory_item_id': {'key': 'inventoryItemId', 'type': 'str'}, + 'mo_name': {'key': 'moName', 'type': 'str'}, + } + + def __init__( + self, + *, + inventory_item_id: Optional[str] = None, + mo_name: Optional[str] = None, + **kwargs + ): + super(InventoryItemDetails, self).__init__(**kwargs) + self.inventory_item_id = inventory_item_id + self.mo_name = mo_name + + +class InventoryItemProperties(msrest.serialization.Model): + """Defines the resource properties. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ResourcePoolInventoryItem, VirtualMachineInventoryItem, VirtualMachineTemplateInventoryItem, VirtualNetworkInventoryItem. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param inventory_type: Required. They inventory type.Constant filled by server. Possible + values include: "ResourcePool", "VirtualMachine", "VirtualMachineTemplate", "VirtualNetwork". + :type inventory_type: str or ~azure_arc_vmware_management_service_api.models.InventoryType + :param managed_resource_id: Gets or sets the tracked resource id corresponding to the inventory + resource. + :type managed_resource_id: str + :param mo_ref_id: Gets or sets the MoRef (Managed Object Reference) ID for the inventory item. + :type mo_ref_id: str + :param mo_name: Gets or sets the vCenter Managed Object name for the inventory item. + :type mo_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'inventory_type': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'inventory_type': {'key': 'inventoryType', 'type': 'str'}, + 'managed_resource_id': {'key': 'managedResourceId', 'type': 'str'}, + 'mo_ref_id': {'key': 'moRefId', 'type': 'str'}, + 'mo_name': {'key': 'moName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + _subtype_map = { + 'inventory_type': {'ResourcePool': 'ResourcePoolInventoryItem', 'VirtualMachine': 'VirtualMachineInventoryItem', 'VirtualMachineTemplate': 'VirtualMachineTemplateInventoryItem', 'VirtualNetwork': 'VirtualNetworkInventoryItem'} + } + + def __init__( + self, + *, + managed_resource_id: Optional[str] = None, + mo_ref_id: Optional[str] = None, + mo_name: Optional[str] = None, + **kwargs + ): + super(InventoryItemProperties, self).__init__(**kwargs) + self.inventory_type = None # type: Optional[str] + self.managed_resource_id = managed_resource_id + self.mo_ref_id = mo_ref_id + self.mo_name = mo_name + self.provisioning_state = None + + +class InventoryItemsList(msrest.serialization.Model): + """List of InventoryItems. + + All required parameters must be populated in order to send to Azure. + + :param next_link: Url to follow for getting next page of InventoryItems. + :type next_link: str + :param value: Required. Array of InventoryItems. + :type value: list[~azure_arc_vmware_management_service_api.models.InventoryItem] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[InventoryItem]'}, + } + + def __init__( + self, + *, + value: List["InventoryItem"], + next_link: Optional[str] = None, + **kwargs + ): + super(InventoryItemsList, self).__init__(**kwargs) + self.next_link = next_link + self.value = value + + +class MachineExtension(msrest.serialization.Model): + """Describes a Machine Extension. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param location: Gets or sets the location. + :type location: str + :ivar system_data: The system data. + :vartype system_data: ~azure_arc_vmware_management_service_api.models.SystemData + :param tags: A set of tags. Gets or sets the Resource tags. + :type tags: dict[str, str] + :ivar name: Gets or sets the name. + :vartype name: str + :ivar id: Gets or sets the Id. + :vartype id: str + :ivar type: Gets or sets the type of the resource. + :vartype type: str + :param force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type_properties_type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :type type_properties_type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor + version if one is available at deployment time. Once deployed, however, the extension will not + upgrade minor versions unless redeployed, even with this property set to true. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :param instance_view: The machine extension instance view. + :type instance_view: + ~azure_arc_vmware_management_service_api.models.MachineExtensionPropertiesInstanceView + """ + + _validation = { + 'system_data': {'readonly': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, + 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'MachineExtensionPropertiesInstanceView'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + force_update_tag: Optional[str] = None, + publisher: Optional[str] = None, + type_properties_type: Optional[str] = None, + type_handler_version: Optional[str] = None, + auto_upgrade_minor_version: Optional[bool] = None, + settings: Optional[object] = None, + protected_settings: Optional[object] = None, + instance_view: Optional["MachineExtensionPropertiesInstanceView"] = None, + **kwargs + ): + super(MachineExtension, self).__init__(**kwargs) + self.location = location + self.system_data = None + self.tags = tags + self.name = None + self.id = None + self.type = None + self.force_update_tag = force_update_tag + self.publisher = publisher + self.type_properties_type = type_properties_type + self.type_handler_version = type_handler_version + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.settings = settings + self.protected_settings = protected_settings + self.provisioning_state = None + self.instance_view = instance_view + + +class MachineExtensionInstanceView(msrest.serialization.Model): + """Describes the Machine Extension Instance View. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The machine extension name. + :vartype name: str + :ivar type: Specifies the type of the extension; an example is "CustomScriptExtension". + :vartype type: str + :ivar type_handler_version: Specifies the version of the script handler. + :vartype type_handler_version: str + :param status: Instance view status. + :type status: + ~azure_arc_vmware_management_service_api.models.MachineExtensionInstanceViewStatus + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'type_handler_version': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'MachineExtensionInstanceViewStatus'}, + } + + def __init__( + self, + *, + status: Optional["MachineExtensionInstanceViewStatus"] = None, + **kwargs + ): + super(MachineExtensionInstanceView, self).__init__(**kwargs) + self.name = None + self.type = None + self.type_handler_version = None + self.status = status + + +class MachineExtensionInstanceViewStatus(msrest.serialization.Model): + """Instance view status. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The status code. + :vartype code: str + :ivar level: The level code. Possible values include: "Info", "Warning", "Error". + :vartype level: str or ~azure_arc_vmware_management_service_api.models.StatusLevelTypes + :ivar display_status: The short localizable label for the status. + :vartype display_status: str + :ivar message: The detailed status message, including for alerts and error messages. + :vartype message: str + :ivar time: The time of the status. + :vartype time: ~datetime.datetime + """ + + _validation = { + 'code': {'readonly': True}, + 'level': {'readonly': True}, + 'display_status': {'readonly': True}, + 'message': {'readonly': True}, + 'time': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'level': {'key': 'level', 'type': 'str'}, + 'display_status': {'key': 'displayStatus', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(MachineExtensionInstanceViewStatus, self).__init__(**kwargs) + self.code = None + self.level = None + self.display_status = None + self.message = None + self.time = None + + +class MachineExtensionPropertiesInstanceView(MachineExtensionInstanceView): + """The machine extension instance view. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The machine extension name. + :vartype name: str + :ivar type: Specifies the type of the extension; an example is "CustomScriptExtension". + :vartype type: str + :ivar type_handler_version: Specifies the version of the script handler. + :vartype type_handler_version: str + :param status: Instance view status. + :type status: + ~azure_arc_vmware_management_service_api.models.MachineExtensionInstanceViewStatus + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'type_handler_version': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'MachineExtensionInstanceViewStatus'}, + } + + def __init__( + self, + *, + status: Optional["MachineExtensionInstanceViewStatus"] = None, + **kwargs + ): + super(MachineExtensionPropertiesInstanceView, self).__init__(status=status, **kwargs) + + +class MachineExtensionsListResult(msrest.serialization.Model): + """Describes the Machine Extensions List Result. + + :param value: The list of extensions. + :type value: list[~azure_arc_vmware_management_service_api.models.MachineExtension] + :param next_link: The uri to fetch the next page of machine extensions. Call ListNext() with + this to fetch the next page of extensions. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MachineExtension]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["MachineExtension"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(MachineExtensionsListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ResourcePatch(msrest.serialization.Model): + """Object containing updates for patch operations. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(ResourcePatch, self).__init__(**kwargs) + self.tags = tags + + +class MachineExtensionUpdate(ResourcePatch): + """Describes a Machine Extension Update. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type: Specifies the type of the extension; an example is "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: Indicates whether the extension should use a newer minor + version if one is available at deployment time. Once deployed, however, the extension will not + upgrade minor versions unless redeployed, even with this property set to true. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either protectedSettings or + protectedSettingsFromKeyVault or no protected settings at all. + :type protected_settings: object + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'type': {'key': 'properties.type', 'type': 'str'}, + 'type_handler_version': {'key': 'properties.typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + force_update_tag: Optional[str] = None, + publisher: Optional[str] = None, + type: Optional[str] = None, + type_handler_version: Optional[str] = None, + auto_upgrade_minor_version: Optional[bool] = None, + settings: Optional[object] = None, + protected_settings: Optional[object] = None, + **kwargs + ): + super(MachineExtensionUpdate, self).__init__(tags=tags, **kwargs) + self.force_update_tag = force_update_tag + self.publisher = publisher + self.type = type + self.type_handler_version = type_handler_version + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.settings = settings + self.protected_settings = protected_settings + + +class NetworkInterface(msrest.serialization.Model): + """Network Interface model. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param name: Gets or sets the name of the network interface. + :type name: str + :ivar label: Gets or sets the label of the virtual network in vCenter that the nic is connected + to. + :vartype label: str + :ivar ip_addresses: Gets or sets the nic ip addresses. + :vartype ip_addresses: list[str] + :ivar mac_address: Gets or sets the NIC MAC address. + :vartype mac_address: str + :param network_id: Gets or sets the ARM Id of the network resource to connect the virtual + machine. + :type network_id: str + :param nic_type: NIC type. Possible values include: "vmxnet3", "vmxnet2", "vmxnet", "e1000", + "e1000e", "pcnet32". + :type nic_type: str or ~azure_arc_vmware_management_service_api.models.NICType + :param power_on_boot: Gets or sets the power on boot. Possible values include: "enabled", + "disabled". + :type power_on_boot: str or ~azure_arc_vmware_management_service_api.models.PowerOnBootOption + :ivar network_mo_ref_id: Gets or sets the vCenter MoRef (Managed Object Reference) ID of the + virtual network + that the nic is connected to. + :vartype network_mo_ref_id: str + :ivar network_mo_name: Gets or sets the name of the virtual network in vCenter that the nic is + connected to. + :vartype network_mo_name: str + :param device_key: Gets or sets the device key value. + :type device_key: int + :param ip_settings: Gets or sets the ipsettings. + :type ip_settings: ~azure_arc_vmware_management_service_api.models.NicIPSettings + """ + + _validation = { + 'label': {'readonly': True}, + 'ip_addresses': {'readonly': True}, + 'mac_address': {'readonly': True}, + 'network_mo_ref_id': {'readonly': True}, + 'network_mo_name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + 'ip_addresses': {'key': 'ipAddresses', 'type': '[str]'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + 'network_id': {'key': 'networkId', 'type': 'str'}, + 'nic_type': {'key': 'nicType', 'type': 'str'}, + 'power_on_boot': {'key': 'powerOnBoot', 'type': 'str'}, + 'network_mo_ref_id': {'key': 'networkMoRefId', 'type': 'str'}, + 'network_mo_name': {'key': 'networkMoName', 'type': 'str'}, + 'device_key': {'key': 'deviceKey', 'type': 'int'}, + 'ip_settings': {'key': 'ipSettings', 'type': 'NicIPSettings'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + network_id: Optional[str] = None, + nic_type: Optional[Union[str, "NICType"]] = None, + power_on_boot: Optional[Union[str, "PowerOnBootOption"]] = None, + device_key: Optional[int] = None, + ip_settings: Optional["NicIPSettings"] = None, + **kwargs + ): + super(NetworkInterface, self).__init__(**kwargs) + self.name = name + self.label = None + self.ip_addresses = None + self.mac_address = None + self.network_id = network_id + self.nic_type = nic_type + self.power_on_boot = power_on_boot + self.network_mo_ref_id = None + self.network_mo_name = None + self.device_key = device_key + self.ip_settings = ip_settings + + +class NetworkInterfaceUpdate(msrest.serialization.Model): + """Defines the network interface update. + + :param name: Gets or sets the name of the network interface. + :type name: str + :param network_id: Gets or sets the ARM Id of the network resource to connect the virtual + machine. + :type network_id: str + :param nic_type: NIC type. Possible values include: "vmxnet3", "vmxnet2", "vmxnet", "e1000", + "e1000e", "pcnet32". + :type nic_type: str or ~azure_arc_vmware_management_service_api.models.NICType + :param power_on_boot: Gets or sets the power on boot. Possible values include: "enabled", + "disabled". + :type power_on_boot: str or ~azure_arc_vmware_management_service_api.models.PowerOnBootOption + :param device_key: Gets or sets the device key value. + :type device_key: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'network_id': {'key': 'networkId', 'type': 'str'}, + 'nic_type': {'key': 'nicType', 'type': 'str'}, + 'power_on_boot': {'key': 'powerOnBoot', 'type': 'str'}, + 'device_key': {'key': 'deviceKey', 'type': 'int'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + network_id: Optional[str] = None, + nic_type: Optional[Union[str, "NICType"]] = None, + power_on_boot: Optional[Union[str, "PowerOnBootOption"]] = None, + device_key: Optional[int] = None, + **kwargs + ): + super(NetworkInterfaceUpdate, self).__init__(**kwargs) + self.name = name + self.network_id = network_id + self.nic_type = nic_type + self.power_on_boot = power_on_boot + self.device_key = device_key + + +class NetworkProfile(msrest.serialization.Model): + """Defines the resource properties. + + :param network_interfaces: Gets or sets the list of network interfaces associated with the + virtual machine. + :type network_interfaces: + list[~azure_arc_vmware_management_service_api.models.NetworkInterface] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[NetworkInterface]'}, + } + + def __init__( + self, + *, + network_interfaces: Optional[List["NetworkInterface"]] = None, + **kwargs + ): + super(NetworkProfile, self).__init__(**kwargs) + self.network_interfaces = network_interfaces + + +class NetworkProfileUpdate(msrest.serialization.Model): + """Defines the update resource properties. + + :param network_interfaces: Gets or sets the list of network interfaces associated with the + virtual machine. + :type network_interfaces: + list[~azure_arc_vmware_management_service_api.models.NetworkInterfaceUpdate] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[NetworkInterfaceUpdate]'}, + } + + def __init__( + self, + *, + network_interfaces: Optional[List["NetworkInterfaceUpdate"]] = None, + **kwargs + ): + super(NetworkProfileUpdate, self).__init__(**kwargs) + self.network_interfaces = network_interfaces + + +class NicIPAddressSettings(msrest.serialization.Model): + """IP address information for a virtual network adapter reported by the fabric. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar allocation_method: Gets the ip address allocation method. + :vartype allocation_method: str + :ivar ip_address: Gets the ip address for the nic. + :vartype ip_address: str + :ivar subnet_mask: Gets the mask. + :vartype subnet_mask: str + """ + + _validation = { + 'allocation_method': {'readonly': True}, + 'ip_address': {'readonly': True}, + 'subnet_mask': {'readonly': True}, + } + + _attribute_map = { + 'allocation_method': {'key': 'allocationMethod', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'subnet_mask': {'key': 'subnetMask', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NicIPAddressSettings, self).__init__(**kwargs) + self.allocation_method = None + self.ip_address = None + self.subnet_mask = None + + +class NicIPSettings(msrest.serialization.Model): + """Defines the network interface ip settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param allocation_method: Gets or sets the nic allocation method. Possible values include: + "unset", "dynamic", "static", "linklayer", "random", "other". + :type allocation_method: str or + ~azure_arc_vmware_management_service_api.models.IPAddressAllocationMethod + :param dns_servers: Gets or sets the dns servers. + :type dns_servers: list[str] + :param gateway: Gets or sets the gateway. + :type gateway: list[str] + :param ip_address: Gets or sets the ip address for the nic. + :type ip_address: str + :param subnet_mask: Gets or sets the mask. + :type subnet_mask: str + :ivar primary_wins_server: Gets or sets the primary server. + :vartype primary_wins_server: str + :ivar secondary_wins_server: Gets or sets the secondary server. + :vartype secondary_wins_server: str + :ivar ip_address_info: Gets or sets the IP address information being reported for this NIC. + This contains the same IPv4 information above plus IPV6 information. + :vartype ip_address_info: + list[~azure_arc_vmware_management_service_api.models.NicIPAddressSettings] + """ + + _validation = { + 'primary_wins_server': {'readonly': True}, + 'secondary_wins_server': {'readonly': True}, + 'ip_address_info': {'readonly': True}, + } + + _attribute_map = { + 'allocation_method': {'key': 'allocationMethod', 'type': 'str'}, + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + 'gateway': {'key': 'gateway', 'type': '[str]'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'subnet_mask': {'key': 'subnetMask', 'type': 'str'}, + 'primary_wins_server': {'key': 'primaryWinsServer', 'type': 'str'}, + 'secondary_wins_server': {'key': 'secondaryWinsServer', 'type': 'str'}, + 'ip_address_info': {'key': 'ipAddressInfo', 'type': '[NicIPAddressSettings]'}, + } + + def __init__( + self, + *, + allocation_method: Optional[Union[str, "IPAddressAllocationMethod"]] = None, + dns_servers: Optional[List[str]] = None, + gateway: Optional[List[str]] = None, + ip_address: Optional[str] = None, + subnet_mask: Optional[str] = None, + **kwargs + ): + super(NicIPSettings, self).__init__(**kwargs) + self.allocation_method = allocation_method + self.dns_servers = dns_servers + self.gateway = gateway + self.ip_address = ip_address + self.subnet_mask = subnet_mask + self.primary_wins_server = None + self.secondary_wins_server = None + self.ip_address_info = None + + +class Operation(msrest.serialization.Model): + """Operation provided by provider. + + :param name: Name of the operation. + :type name: str + :param is_data_action: Indicates whether the operation is data action or not. + :type is_data_action: bool + :param display: Properties of the operation. + :type display: ~azure_arc_vmware_management_service_api.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + is_data_action: Optional[bool] = None, + display: Optional["OperationDisplay"] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = name + self.is_data_action = is_data_action + self.display = display + + +class OperationDisplay(msrest.serialization.Model): + """Properties of the operation. + + :param provider: Provider name. + :type provider: str + :param resource: Resource name. + :type resource: str + :param operation: Operation name. + :type operation: str + :param description: Description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class OperationsList(msrest.serialization.Model): + """Lists the operations available. + + All required parameters must be populated in order to send to Azure. + + :param next_link: Url to follow for getting next page of operations. + :type next_link: str + :param value: Required. Array of operations. + :type value: list[~azure_arc_vmware_management_service_api.models.Operation] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__( + self, + *, + value: List["Operation"], + next_link: Optional[str] = None, + **kwargs + ): + super(OperationsList, self).__init__(**kwargs) + self.next_link = next_link + self.value = value + + +class OsProfile(msrest.serialization.Model): + """Defines the resource properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param computer_name: Gets or sets computer name. + :type computer_name: str + :param admin_username: Gets or sets administrator username. + :type admin_username: str + :param admin_password: Gets or sets administrator password. + :type admin_password: str + :ivar os_type: Gets or sets the type of the os. Possible values include: "Windows", "Linux", + "Other". + :vartype os_type: str or ~azure_arc_vmware_management_service_api.models.OsType + :ivar os_name: Gets or sets os name. + :vartype os_name: str + :ivar tools_running_status: Gets or sets the current running status of VMware Tools running in + the guest operating system. + :vartype tools_running_status: str + :ivar tools_version_status: Gets or sets the current version status of VMware Tools installed + in the guest operating system. + :vartype tools_version_status: str + :ivar tools_version: Gets or sets the current version of VMware Tools. + :vartype tools_version: str + """ + + _validation = { + 'os_type': {'readonly': True}, + 'os_name': {'readonly': True}, + 'tools_running_status': {'readonly': True}, + 'tools_version_status': {'readonly': True}, + 'tools_version': {'readonly': True}, + } + + _attribute_map = { + 'computer_name': {'key': 'computerName', 'type': 'str'}, + 'admin_username': {'key': 'adminUsername', 'type': 'str'}, + 'admin_password': {'key': 'adminPassword', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'os_name': {'key': 'osName', 'type': 'str'}, + 'tools_running_status': {'key': 'toolsRunningStatus', 'type': 'str'}, + 'tools_version_status': {'key': 'toolsVersionStatus', 'type': 'str'}, + 'tools_version': {'key': 'toolsVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + computer_name: Optional[str] = None, + admin_username: Optional[str] = None, + admin_password: Optional[str] = None, + **kwargs + ): + super(OsProfile, self).__init__(**kwargs) + self.computer_name = computer_name + self.admin_username = admin_username + self.admin_password = admin_password + self.os_type = None + self.os_name = None + self.tools_running_status = None + self.tools_version_status = None + self.tools_version = None + + +class ResourcePool(msrest.serialization.Model): + """Define the resourcePool. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. Gets or sets the location. + :type location: str + :param extended_location: Gets or sets the extended location. + :type extended_location: ~azure_arc_vmware_management_service_api.models.ExtendedLocation + :ivar system_data: The system data. + :vartype system_data: ~azure_arc_vmware_management_service_api.models.SystemData + :param tags: A set of tags. Gets or sets the Resource tags. + :type tags: dict[str, str] + :ivar name: Gets or sets the name. + :vartype name: str + :ivar id: Gets or sets the Id. + :vartype id: str + :ivar type: Gets or sets the type of the resource. + :vartype type: str + :param kind: Metadata used by portal/tooling/etc to render different UX experiences for + resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, + the resource provider must validate and persist this value. + :type kind: str + :ivar uuid: Gets or sets a unique identifier for this resource. + :vartype uuid: str + :param v_center_id: Gets or sets the ARM Id of the vCenter resource in which this resource pool + resides. + :type v_center_id: str + :param mo_ref_id: Gets or sets the vCenter MoRef (Managed Object Reference) ID for the resource + pool. + :type mo_ref_id: str + :param inventory_item_id: Gets or sets the inventory Item ID for the resource pool. + :type inventory_item_id: str + :ivar mo_name: Gets or sets the vCenter Managed Object name for the resource pool. + :vartype mo_name: str + :ivar cpu_shares_level: Gets or sets CPUSharesLevel which specifies the CPU allocation level + for this pool. + This property is used in relative allocation between resource consumers. + :vartype cpu_shares_level: str + :ivar cpu_reservation_m_hz: Gets or sets CPUReservationMHz which specifies the CPU size in MHz + that is guaranteed + to be available. + :vartype cpu_reservation_m_hz: long + :ivar cpu_limit_m_hz: Gets or sets CPULimitMHz which specifies a CPU usage limit in MHz. + Utilization will not exceed this limit even if there are available resources. + :vartype cpu_limit_m_hz: long + :ivar mem_shares_level: Gets or sets CPUSharesLevel which specifies the memory allocation level + for this pool. + This property is used in relative allocation between resource consumers. + :vartype mem_shares_level: str + :ivar mem_reservation_mb: Gets or sets MemReservationMB which specifies the guaranteed + available memory in + megabytes. + :vartype mem_reservation_mb: long + :ivar mem_limit_mb: Gets or sets MemLimitMB specifies a memory usage limit in megabytes. + Utilization will not exceed the specified limit even if there are available resources. + :vartype mem_limit_mb: long + :ivar custom_resource_name: Gets the name of the corresponding resource in Kubernetes. + :vartype custom_resource_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'uuid': {'readonly': True}, + 'mo_name': {'readonly': True}, + 'cpu_shares_level': {'readonly': True}, + 'cpu_reservation_m_hz': {'readonly': True}, + 'cpu_limit_m_hz': {'readonly': True}, + 'mem_shares_level': {'readonly': True}, + 'mem_reservation_mb': {'readonly': True}, + 'mem_limit_mb': {'readonly': True}, + 'custom_resource_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'uuid': {'key': 'properties.uuid', 'type': 'str'}, + 'v_center_id': {'key': 'properties.vCenterId', 'type': 'str'}, + 'mo_ref_id': {'key': 'properties.moRefId', 'type': 'str'}, + 'inventory_item_id': {'key': 'properties.inventoryItemId', 'type': 'str'}, + 'mo_name': {'key': 'properties.moName', 'type': 'str'}, + 'cpu_shares_level': {'key': 'properties.cpuSharesLevel', 'type': 'str'}, + 'cpu_reservation_m_hz': {'key': 'properties.cpuReservationMHz', 'type': 'long'}, + 'cpu_limit_m_hz': {'key': 'properties.cpuLimitMHz', 'type': 'long'}, + 'mem_shares_level': {'key': 'properties.memSharesLevel', 'type': 'str'}, + 'mem_reservation_mb': {'key': 'properties.memReservationMB', 'type': 'long'}, + 'mem_limit_mb': {'key': 'properties.memLimitMB', 'type': 'long'}, + 'custom_resource_name': {'key': 'properties.customResourceName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + extended_location: Optional["ExtendedLocation"] = None, + tags: Optional[Dict[str, str]] = None, + kind: Optional[str] = None, + v_center_id: Optional[str] = None, + mo_ref_id: Optional[str] = None, + inventory_item_id: Optional[str] = None, + **kwargs + ): + super(ResourcePool, self).__init__(**kwargs) + self.location = location + self.extended_location = extended_location + self.system_data = None + self.tags = tags + self.name = None + self.id = None + self.type = None + self.kind = kind + self.uuid = None + self.v_center_id = v_center_id + self.mo_ref_id = mo_ref_id + self.inventory_item_id = inventory_item_id + self.mo_name = None + self.cpu_shares_level = None + self.cpu_reservation_m_hz = None + self.cpu_limit_m_hz = None + self.mem_shares_level = None + self.mem_reservation_mb = None + self.mem_limit_mb = None + self.custom_resource_name = None + self.provisioning_state = None + + +class ResourcePoolInventoryItem(InventoryItemProperties): + """The resource pool inventory item. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param inventory_type: Required. They inventory type.Constant filled by server. Possible + values include: "ResourcePool", "VirtualMachine", "VirtualMachineTemplate", "VirtualNetwork". + :type inventory_type: str or ~azure_arc_vmware_management_service_api.models.InventoryType + :param managed_resource_id: Gets or sets the tracked resource id corresponding to the inventory + resource. + :type managed_resource_id: str + :param mo_ref_id: Gets or sets the MoRef (Managed Object Reference) ID for the inventory item. + :type mo_ref_id: str + :param mo_name: Gets or sets the vCenter Managed Object name for the inventory item. + :type mo_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :param parent: Parent resourcePool inventory resource details. + :type parent: ~azure_arc_vmware_management_service_api.models.InventoryItemDetails + """ + + _validation = { + 'inventory_type': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'inventory_type': {'key': 'inventoryType', 'type': 'str'}, + 'managed_resource_id': {'key': 'managedResourceId', 'type': 'str'}, + 'mo_ref_id': {'key': 'moRefId', 'type': 'str'}, + 'mo_name': {'key': 'moName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'parent': {'key': 'parent', 'type': 'InventoryItemDetails'}, + } + + def __init__( + self, + *, + managed_resource_id: Optional[str] = None, + mo_ref_id: Optional[str] = None, + mo_name: Optional[str] = None, + parent: Optional["InventoryItemDetails"] = None, + **kwargs + ): + super(ResourcePoolInventoryItem, self).__init__(managed_resource_id=managed_resource_id, mo_ref_id=mo_ref_id, mo_name=mo_name, **kwargs) + self.inventory_type = 'ResourcePool' # type: str + self.parent = parent + + +class ResourcePoolsList(msrest.serialization.Model): + """List of ResourcePools. + + All required parameters must be populated in order to send to Azure. + + :param next_link: Url to follow for getting next page of ResourcePools. + :type next_link: str + :param value: Required. Array of ResourcePools. + :type value: list[~azure_arc_vmware_management_service_api.models.ResourcePool] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[ResourcePool]'}, + } + + def __init__( + self, + *, + value: List["ResourcePool"], + next_link: Optional[str] = None, + **kwargs + ): + super(ResourcePoolsList, self).__init__(**kwargs) + self.next_link = next_link + self.value = value + + +class StopVirtualMachineOptions(msrest.serialization.Model): + """Defines the stop action properties. + + :param skip_shutdown: Gets or sets a value indicating whether to request non-graceful VM + shutdown. True value for this flag indicates non-graceful shutdown whereas false indicates + otherwise. Defaults to false. + :type skip_shutdown: bool + """ + + _attribute_map = { + 'skip_shutdown': {'key': 'skipShutdown', 'type': 'bool'}, + } + + def __init__( + self, + *, + skip_shutdown: Optional[bool] = False, + **kwargs + ): + super(StopVirtualMachineOptions, self).__init__(**kwargs) + self.skip_shutdown = skip_shutdown + + +class StorageProfile(msrest.serialization.Model): + """Defines the resource properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param disks: Gets or sets the list of virtual disks associated with the virtual machine. + :type disks: list[~azure_arc_vmware_management_service_api.models.VirtualDisk] + :ivar scsi_controllers: Gets or sets the list of virtual SCSI controllers associated with the + virtual machine. + :vartype scsi_controllers: + list[~azure_arc_vmware_management_service_api.models.VirtualSCSIController] + """ + + _validation = { + 'scsi_controllers': {'readonly': True}, + } + + _attribute_map = { + 'disks': {'key': 'disks', 'type': '[VirtualDisk]'}, + 'scsi_controllers': {'key': 'scsiControllers', 'type': '[VirtualSCSIController]'}, + } + + def __init__( + self, + *, + disks: Optional[List["VirtualDisk"]] = None, + **kwargs + ): + super(StorageProfile, self).__init__(**kwargs) + self.disks = disks + self.scsi_controllers = None + + +class StorageProfileUpdate(msrest.serialization.Model): + """Defines the resource update properties. + + :param disks: Gets or sets the list of virtual disks associated with the virtual machine. + :type disks: list[~azure_arc_vmware_management_service_api.models.VirtualDiskUpdate] + """ + + _attribute_map = { + 'disks': {'key': 'disks', 'type': '[VirtualDiskUpdate]'}, + } + + def __init__( + self, + *, + disks: Optional[List["VirtualDiskUpdate"]] = None, + **kwargs + ): + super(StorageProfileUpdate, self).__init__(**kwargs) + self.disks = disks + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure_arc_vmware_management_service_api.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or + ~azure_arc_vmware_management_service_api.models.CreatedByType + :param last_modified_at: The type of identity that last modified the resource. + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class VCenter(msrest.serialization.Model): + """Defines the vCenter. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. Gets or sets the location. + :type location: str + :param extended_location: Gets or sets the extended location. + :type extended_location: ~azure_arc_vmware_management_service_api.models.ExtendedLocation + :ivar system_data: The system data. + :vartype system_data: ~azure_arc_vmware_management_service_api.models.SystemData + :param tags: A set of tags. Gets or sets the Resource tags. + :type tags: dict[str, str] + :ivar name: Gets or sets the name. + :vartype name: str + :ivar id: Gets or sets the Id. + :vartype id: str + :ivar type: Gets or sets the type of the resource. + :vartype type: str + :param kind: Metadata used by portal/tooling/etc to render different UX experiences for + resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, + the resource provider must validate and persist this value. + :type kind: str + :ivar uuid: Gets or sets a unique identifier for this resource. + :vartype uuid: str + :param fqdn: Required. Gets or sets the FQDN/IPAddress of the vCenter. + :type fqdn: str + :param port: Gets or sets the port of the vCenter. + :type port: int + :ivar version: Gets or sets the version of the vCenter. + :vartype version: str + :ivar instance_uuid: Gets or sets the instance UUID of the vCenter. + :vartype instance_uuid: str + :ivar connection_status: Gets or sets the connection status to the vCenter. + :vartype connection_status: str + :ivar custom_resource_name: Gets the name of the corresponding resource in Kubernetes. + :vartype custom_resource_name: str + :param credentials: Username / Password Credentials to connect to vcenter. + :type credentials: ~azure_arc_vmware_management_service_api.models.VICredential + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'uuid': {'readonly': True}, + 'fqdn': {'required': True}, + 'port': {'maximum': 65535, 'minimum': 1}, + 'version': {'readonly': True}, + 'instance_uuid': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'custom_resource_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'uuid': {'key': 'properties.uuid', 'type': 'str'}, + 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'instance_uuid': {'key': 'properties.instanceUuid', 'type': 'str'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'custom_resource_name': {'key': 'properties.customResourceName', 'type': 'str'}, + 'credentials': {'key': 'properties.credentials', 'type': 'VICredential'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + fqdn: str, + extended_location: Optional["ExtendedLocation"] = None, + tags: Optional[Dict[str, str]] = None, + kind: Optional[str] = None, + port: Optional[int] = None, + credentials: Optional["VICredential"] = None, + **kwargs + ): + super(VCenter, self).__init__(**kwargs) + self.location = location + self.extended_location = extended_location + self.system_data = None + self.tags = tags + self.name = None + self.id = None + self.type = None + self.kind = kind + self.uuid = None + self.fqdn = fqdn + self.port = port + self.version = None + self.instance_uuid = None + self.connection_status = None + self.custom_resource_name = None + self.credentials = credentials + self.provisioning_state = None + + +class VCentersList(msrest.serialization.Model): + """List of VCenters. + + All required parameters must be populated in order to send to Azure. + + :param next_link: Url to follow for getting next page of VCenters. + :type next_link: str + :param value: Required. Array of VCenters. + :type value: list[~azure_arc_vmware_management_service_api.models.VCenter] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[VCenter]'}, + } + + def __init__( + self, + *, + value: List["VCenter"], + next_link: Optional[str] = None, + **kwargs + ): + super(VCentersList, self).__init__(**kwargs) + self.next_link = next_link + self.value = value + + +class VICredential(msrest.serialization.Model): + """Username / Password Credentials to connect to vcenter. + + :param username: Gets or sets username to connect with the vCenter. + :type username: str + :param password: Gets or sets the password to connect with the vCenter. + :type password: str + """ + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__( + self, + *, + username: Optional[str] = None, + password: Optional[str] = None, + **kwargs + ): + super(VICredential, self).__init__(**kwargs) + self.username = username + self.password = password + + +class VirtualDisk(msrest.serialization.Model): + """Virtual disk model. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param name: Gets or sets the name of the virtual disk. + :type name: str + :ivar label: Gets or sets the label of the virtual disk in vCenter. + :vartype label: str + :ivar disk_object_id: Gets or sets the disk object id. + :vartype disk_object_id: str + :param disk_size_gb: Gets or sets the disk total size. + :type disk_size_gb: int + :param device_key: Gets or sets the device key value. + :type device_key: int + :param disk_mode: Gets or sets the disk mode. Possible values include: "persistent", + "independent_persistent", "independent_nonpersistent". + :type disk_mode: str or ~azure_arc_vmware_management_service_api.models.DiskMode + :param controller_key: Gets or sets the controller id. + :type controller_key: int + :param unit_number: Gets or sets the unit number of the disk on the controller. + :type unit_number: int + """ + + _validation = { + 'label': {'readonly': True}, + 'disk_object_id': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + 'disk_object_id': {'key': 'diskObjectId', 'type': 'str'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'device_key': {'key': 'deviceKey', 'type': 'int'}, + 'disk_mode': {'key': 'diskMode', 'type': 'str'}, + 'controller_key': {'key': 'controllerKey', 'type': 'int'}, + 'unit_number': {'key': 'unitNumber', 'type': 'int'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + disk_size_gb: Optional[int] = None, + device_key: Optional[int] = None, + disk_mode: Optional[Union[str, "DiskMode"]] = None, + controller_key: Optional[int] = None, + unit_number: Optional[int] = None, + **kwargs + ): + super(VirtualDisk, self).__init__(**kwargs) + self.name = name + self.label = None + self.disk_object_id = None + self.disk_size_gb = disk_size_gb + self.device_key = device_key + self.disk_mode = disk_mode + self.controller_key = controller_key + self.unit_number = unit_number + + +class VirtualDiskUpdate(msrest.serialization.Model): + """Defines the virtual disk update. + + :param name: Gets or sets the name of the virtual disk. + :type name: str + :param disk_size_gb: Gets or sets the disk total size. + :type disk_size_gb: int + :param device_key: Gets or sets the device key value. + :type device_key: int + :param disk_mode: Gets or sets the disk mode. Possible values include: "persistent", + "independent_persistent", "independent_nonpersistent". + :type disk_mode: str or ~azure_arc_vmware_management_service_api.models.DiskMode + :param controller_key: Gets or sets the controller id. + :type controller_key: int + :param unit_number: Gets or sets the unit number of the disk on the controller. + :type unit_number: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'device_key': {'key': 'deviceKey', 'type': 'int'}, + 'disk_mode': {'key': 'diskMode', 'type': 'str'}, + 'controller_key': {'key': 'controllerKey', 'type': 'int'}, + 'unit_number': {'key': 'unitNumber', 'type': 'int'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + disk_size_gb: Optional[int] = None, + device_key: Optional[int] = None, + disk_mode: Optional[Union[str, "DiskMode"]] = None, + controller_key: Optional[int] = None, + unit_number: Optional[int] = None, + **kwargs + ): + super(VirtualDiskUpdate, self).__init__(**kwargs) + self.name = name + self.disk_size_gb = disk_size_gb + self.device_key = device_key + self.disk_mode = disk_mode + self.controller_key = controller_key + self.unit_number = unit_number + + +class VirtualMachine(msrest.serialization.Model): + """Define the virtualMachine. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. Gets or sets the location. + :type location: str + :param extended_location: Gets or sets the extended location. + :type extended_location: ~azure_arc_vmware_management_service_api.models.ExtendedLocation + :ivar system_data: The system data. + :vartype system_data: ~azure_arc_vmware_management_service_api.models.SystemData + :param tags: A set of tags. Gets or sets the Resource tags. + :type tags: dict[str, str] + :ivar name: Gets or sets the name. + :vartype name: str + :ivar id: Gets or sets the Id. + :vartype id: str + :ivar type: Gets or sets the type of the resource. + :vartype type: str + :param kind: Metadata used by portal/tooling/etc to render different UX experiences for + resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, + the resource provider must validate and persist this value. + :type kind: str + :param identity: The identity of the resource. + :type identity: ~azure_arc_vmware_management_service_api.models.Identity + :param resource_pool_id: Gets or sets the ARM Id of the resourcePool resource on which this + virtual machine will + deploy. + :type resource_pool_id: str + :param template_id: Gets or sets the ARM Id of the template resource to deploy the virtual + machine. + :type template_id: str + :param v_center_id: Gets or sets the ARM Id of the vCenter resource in which this resource pool + resides. + :type v_center_id: str + :param os_profile: OS properties. + :type os_profile: ~azure_arc_vmware_management_service_api.models.OsProfile + :param hardware_profile: Hardware properties. + :type hardware_profile: ~azure_arc_vmware_management_service_api.models.HardwareProfile + :param network_profile: Network properties. + :type network_profile: ~azure_arc_vmware_management_service_api.models.NetworkProfile + :param storage_profile: Storage properties. + :type storage_profile: ~azure_arc_vmware_management_service_api.models.StorageProfile + :param mo_ref_id: Gets or sets the vCenter MoRef (Managed Object Reference) ID for the virtual + machine. + :type mo_ref_id: str + :param inventory_item_id: Gets or sets the inventory Item ID for the virtual machine. + :type inventory_item_id: str + :ivar mo_name: Gets or sets the vCenter Managed Object name for the virtual machine. + :vartype mo_name: str + :ivar folder_path: Gets or sets the folder path of the vm. + :vartype folder_path: str + :ivar instance_uuid: Gets or sets the instance uuid of the vm. + :vartype instance_uuid: str + :ivar power_state: Gets the power state of the virtual machine. + :vartype power_state: str + :ivar custom_resource_name: Gets the name of the corresponding resource in Kubernetes. + :vartype custom_resource_name: str + :ivar uuid: Gets or sets a unique identifier for this resource. + :vartype uuid: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :ivar vm_id: Gets or sets a unique identifier for the vm resource. + :vartype vm_id: str + """ + + _validation = { + 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'mo_name': {'readonly': True}, + 'folder_path': {'readonly': True}, + 'instance_uuid': {'readonly': True}, + 'power_state': {'readonly': True}, + 'custom_resource_name': {'readonly': True}, + 'uuid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'vm_id': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'resource_pool_id': {'key': 'properties.resourcePoolId', 'type': 'str'}, + 'template_id': {'key': 'properties.templateId', 'type': 'str'}, + 'v_center_id': {'key': 'properties.vCenterId', 'type': 'str'}, + 'os_profile': {'key': 'properties.osProfile', 'type': 'OsProfile'}, + 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + 'mo_ref_id': {'key': 'properties.moRefId', 'type': 'str'}, + 'inventory_item_id': {'key': 'properties.inventoryItemId', 'type': 'str'}, + 'mo_name': {'key': 'properties.moName', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'instance_uuid': {'key': 'properties.instanceUuid', 'type': 'str'}, + 'power_state': {'key': 'properties.powerState', 'type': 'str'}, + 'custom_resource_name': {'key': 'properties.customResourceName', 'type': 'str'}, + 'uuid': {'key': 'properties.uuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + extended_location: Optional["ExtendedLocation"] = None, + tags: Optional[Dict[str, str]] = None, + kind: Optional[str] = None, + identity: Optional["Identity"] = None, + resource_pool_id: Optional[str] = None, + template_id: Optional[str] = None, + v_center_id: Optional[str] = None, + os_profile: Optional["OsProfile"] = None, + hardware_profile: Optional["HardwareProfile"] = None, + network_profile: Optional["NetworkProfile"] = None, + storage_profile: Optional["StorageProfile"] = None, + mo_ref_id: Optional[str] = None, + inventory_item_id: Optional[str] = None, + **kwargs + ): + super(VirtualMachine, self).__init__(**kwargs) + self.location = location + self.extended_location = extended_location + self.system_data = None + self.tags = tags + self.name = None + self.id = None + self.type = None + self.kind = kind + self.identity = identity + self.resource_pool_id = resource_pool_id + self.template_id = template_id + self.v_center_id = v_center_id + self.os_profile = os_profile + self.hardware_profile = hardware_profile + self.network_profile = network_profile + self.storage_profile = storage_profile + self.mo_ref_id = mo_ref_id + self.inventory_item_id = inventory_item_id + self.mo_name = None + self.folder_path = None + self.instance_uuid = None + self.power_state = None + self.custom_resource_name = None + self.uuid = None + self.provisioning_state = None + self.vm_id = None + + +class VirtualMachineInventoryItem(InventoryItemProperties): + """The VM inventory item. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param inventory_type: Required. They inventory type.Constant filled by server. Possible + values include: "ResourcePool", "VirtualMachine", "VirtualMachineTemplate", "VirtualNetwork". + :type inventory_type: str or ~azure_arc_vmware_management_service_api.models.InventoryType + :param managed_resource_id: Gets or sets the tracked resource id corresponding to the inventory + resource. + :type managed_resource_id: str + :param mo_ref_id: Gets or sets the MoRef (Managed Object Reference) ID for the inventory item. + :type mo_ref_id: str + :param mo_name: Gets or sets the vCenter Managed Object name for the inventory item. + :type mo_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :ivar os_type: Gets or sets the type of the os. Possible values include: "Windows", "Linux", + "Other". + :vartype os_type: str or ~azure_arc_vmware_management_service_api.models.OsType + :param os_name: Gets or sets os name. + :type os_name: str + :param ip_addresses: Gets or sets the nic ip addresses. + :type ip_addresses: list[str] + :param folder_path: Gets or sets the folder path of the vm. + :type folder_path: str + :param host: Host inventory resource details. + :type host: ~azure_arc_vmware_management_service_api.models.InventoryItemDetails + :param resource_pool: ResourcePool inventory resource details. + :type resource_pool: ~azure_arc_vmware_management_service_api.models.InventoryItemDetails + :param instance_uuid: Gets or sets the instance uuid of the vm. + :type instance_uuid: str + """ + + _validation = { + 'inventory_type': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'os_type': {'readonly': True}, + } + + _attribute_map = { + 'inventory_type': {'key': 'inventoryType', 'type': 'str'}, + 'managed_resource_id': {'key': 'managedResourceId', 'type': 'str'}, + 'mo_ref_id': {'key': 'moRefId', 'type': 'str'}, + 'mo_name': {'key': 'moName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'os_name': {'key': 'osName', 'type': 'str'}, + 'ip_addresses': {'key': 'ipAddresses', 'type': '[str]'}, + 'folder_path': {'key': 'folderPath', 'type': 'str'}, + 'host': {'key': 'host', 'type': 'InventoryItemDetails'}, + 'resource_pool': {'key': 'resourcePool', 'type': 'InventoryItemDetails'}, + 'instance_uuid': {'key': 'instanceUuid', 'type': 'str'}, + } + + def __init__( + self, + *, + managed_resource_id: Optional[str] = None, + mo_ref_id: Optional[str] = None, + mo_name: Optional[str] = None, + os_name: Optional[str] = None, + ip_addresses: Optional[List[str]] = None, + folder_path: Optional[str] = None, + host: Optional["InventoryItemDetails"] = None, + resource_pool: Optional["InventoryItemDetails"] = None, + instance_uuid: Optional[str] = None, + **kwargs + ): + super(VirtualMachineInventoryItem, self).__init__(managed_resource_id=managed_resource_id, mo_ref_id=mo_ref_id, mo_name=mo_name, **kwargs) + self.inventory_type = 'VirtualMachine' # type: str + self.os_type = None + self.os_name = os_name + self.ip_addresses = ip_addresses + self.folder_path = folder_path + self.host = host + self.resource_pool = resource_pool + self.instance_uuid = instance_uuid + + +class VirtualMachinesList(msrest.serialization.Model): + """List of VirtualMachines. + + All required parameters must be populated in order to send to Azure. + + :param next_link: Url to follow for getting next page of VirtualMachines. + :type next_link: str + :param value: Required. Array of VirtualMachines. + :type value: list[~azure_arc_vmware_management_service_api.models.VirtualMachine] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[VirtualMachine]'}, + } + + def __init__( + self, + *, + value: List["VirtualMachine"], + next_link: Optional[str] = None, + **kwargs + ): + super(VirtualMachinesList, self).__init__(**kwargs) + self.next_link = next_link + self.value = value + + +class VirtualMachineTemplate(msrest.serialization.Model): + """Define the virtualMachineTemplate. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. Gets or sets the location. + :type location: str + :param extended_location: Gets or sets the extended location. + :type extended_location: ~azure_arc_vmware_management_service_api.models.ExtendedLocation + :ivar system_data: The system data. + :vartype system_data: ~azure_arc_vmware_management_service_api.models.SystemData + :param tags: A set of tags. Gets or sets the Resource tags. + :type tags: dict[str, str] + :ivar name: Gets or sets the name. + :vartype name: str + :ivar id: Gets or sets the Id. + :vartype id: str + :ivar type: Gets or sets the type of the resource. + :vartype type: str + :param kind: Metadata used by portal/tooling/etc to render different UX experiences for + resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, + the resource provider must validate and persist this value. + :type kind: str + :ivar uuid: Gets or sets a unique identifier for this resource. + :vartype uuid: str + :param v_center_id: Gets or sets the ARM Id of the vCenter resource in which this template + resides. + :type v_center_id: str + :param mo_ref_id: Gets or sets the vCenter MoRef (Managed Object Reference) ID for the virtual + machine + template. + :type mo_ref_id: str + :param inventory_item_id: Gets or sets the inventory Item ID for the virtual machine template. + :type inventory_item_id: str + :ivar mo_name: Gets or sets the vCenter Managed Object name for the virtual machine template. + :vartype mo_name: str + :ivar memory_size_mb: Gets or sets memory size in MBs for the template. + :vartype memory_size_mb: int + :ivar num_cp_us: Gets or sets the number of vCPUs for the template. + :vartype num_cp_us: int + :ivar num_cores_per_socket: Gets or sets the number of cores per socket for the template. + Defaults to 1 if unspecified. + :vartype num_cores_per_socket: int + :ivar os_type: Gets or sets the type of the os. Possible values include: "Windows", "Linux", + "Other". + :vartype os_type: str or ~azure_arc_vmware_management_service_api.models.OsType + :ivar os_name: Gets or sets os name. + :vartype os_name: str + :ivar folder_path: Gets or sets the folder path of the template. + :vartype folder_path: str + :ivar network_interfaces: Gets or sets the network interfaces of the template. + :vartype network_interfaces: + list[~azure_arc_vmware_management_service_api.models.NetworkInterface] + :ivar disks: Gets or sets the disks the template. + :vartype disks: list[~azure_arc_vmware_management_service_api.models.VirtualDisk] + :ivar custom_resource_name: Gets the name of the corresponding resource in Kubernetes. + :vartype custom_resource_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'uuid': {'readonly': True}, + 'mo_name': {'readonly': True}, + 'memory_size_mb': {'readonly': True}, + 'num_cp_us': {'readonly': True}, + 'num_cores_per_socket': {'readonly': True}, + 'os_type': {'readonly': True}, + 'os_name': {'readonly': True}, + 'folder_path': {'readonly': True}, + 'network_interfaces': {'readonly': True}, + 'disks': {'readonly': True}, + 'custom_resource_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'uuid': {'key': 'properties.uuid', 'type': 'str'}, + 'v_center_id': {'key': 'properties.vCenterId', 'type': 'str'}, + 'mo_ref_id': {'key': 'properties.moRefId', 'type': 'str'}, + 'inventory_item_id': {'key': 'properties.inventoryItemId', 'type': 'str'}, + 'mo_name': {'key': 'properties.moName', 'type': 'str'}, + 'memory_size_mb': {'key': 'properties.memorySizeMB', 'type': 'int'}, + 'num_cp_us': {'key': 'properties.numCPUs', 'type': 'int'}, + 'num_cores_per_socket': {'key': 'properties.numCoresPerSocket', 'type': 'int'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'os_name': {'key': 'properties.osName', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'network_interfaces': {'key': 'properties.networkInterfaces', 'type': '[NetworkInterface]'}, + 'disks': {'key': 'properties.disks', 'type': '[VirtualDisk]'}, + 'custom_resource_name': {'key': 'properties.customResourceName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + extended_location: Optional["ExtendedLocation"] = None, + tags: Optional[Dict[str, str]] = None, + kind: Optional[str] = None, + v_center_id: Optional[str] = None, + mo_ref_id: Optional[str] = None, + inventory_item_id: Optional[str] = None, + **kwargs + ): + super(VirtualMachineTemplate, self).__init__(**kwargs) + self.location = location + self.extended_location = extended_location + self.system_data = None + self.tags = tags + self.name = None + self.id = None + self.type = None + self.kind = kind + self.uuid = None + self.v_center_id = v_center_id + self.mo_ref_id = mo_ref_id + self.inventory_item_id = inventory_item_id + self.mo_name = None + self.memory_size_mb = None + self.num_cp_us = None + self.num_cores_per_socket = None + self.os_type = None + self.os_name = None + self.folder_path = None + self.network_interfaces = None + self.disks = None + self.custom_resource_name = None + self.provisioning_state = None + + +class VirtualMachineTemplateInventoryItem(InventoryItemProperties): + """The VM Template inventory item. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param inventory_type: Required. They inventory type.Constant filled by server. Possible + values include: "ResourcePool", "VirtualMachine", "VirtualMachineTemplate", "VirtualNetwork". + :type inventory_type: str or ~azure_arc_vmware_management_service_api.models.InventoryType + :param managed_resource_id: Gets or sets the tracked resource id corresponding to the inventory + resource. + :type managed_resource_id: str + :param mo_ref_id: Gets or sets the MoRef (Managed Object Reference) ID for the inventory item. + :type mo_ref_id: str + :param mo_name: Gets or sets the vCenter Managed Object name for the inventory item. + :type mo_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :param memory_size_mb: Gets or sets memory size in MBs for the template. + :type memory_size_mb: int + :param num_cp_us: Gets or sets the number of vCPUs for the template. + :type num_cp_us: int + :param num_cores_per_socket: Gets or sets the number of cores per socket for the template. + Defaults to 1 if unspecified. + :type num_cores_per_socket: int + :ivar os_type: Gets or sets the type of the os. Possible values include: "Windows", "Linux", + "Other". + :vartype os_type: str or ~azure_arc_vmware_management_service_api.models.OsType + :param os_name: Gets or sets os name. + :type os_name: str + :param folder_path: Gets or sets the folder path of the template. + :type folder_path: str + """ + + _validation = { + 'inventory_type': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'os_type': {'readonly': True}, + } + + _attribute_map = { + 'inventory_type': {'key': 'inventoryType', 'type': 'str'}, + 'managed_resource_id': {'key': 'managedResourceId', 'type': 'str'}, + 'mo_ref_id': {'key': 'moRefId', 'type': 'str'}, + 'mo_name': {'key': 'moName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'memory_size_mb': {'key': 'memorySizeMB', 'type': 'int'}, + 'num_cp_us': {'key': 'numCPUs', 'type': 'int'}, + 'num_cores_per_socket': {'key': 'numCoresPerSocket', 'type': 'int'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'os_name': {'key': 'osName', 'type': 'str'}, + 'folder_path': {'key': 'folderPath', 'type': 'str'}, + } + + def __init__( + self, + *, + managed_resource_id: Optional[str] = None, + mo_ref_id: Optional[str] = None, + mo_name: Optional[str] = None, + memory_size_mb: Optional[int] = None, + num_cp_us: Optional[int] = None, + num_cores_per_socket: Optional[int] = None, + os_name: Optional[str] = None, + folder_path: Optional[str] = None, + **kwargs + ): + super(VirtualMachineTemplateInventoryItem, self).__init__(managed_resource_id=managed_resource_id, mo_ref_id=mo_ref_id, mo_name=mo_name, **kwargs) + self.inventory_type = 'VirtualMachineTemplate' # type: str + self.memory_size_mb = memory_size_mb + self.num_cp_us = num_cp_us + self.num_cores_per_socket = num_cores_per_socket + self.os_type = None + self.os_name = os_name + self.folder_path = folder_path + + +class VirtualMachineTemplatesList(msrest.serialization.Model): + """List of VirtualMachineTemplates. + + All required parameters must be populated in order to send to Azure. + + :param next_link: Url to follow for getting next page of VirtualMachineTemplates. + :type next_link: str + :param value: Required. Array of VirtualMachineTemplates. + :type value: list[~azure_arc_vmware_management_service_api.models.VirtualMachineTemplate] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[VirtualMachineTemplate]'}, + } + + def __init__( + self, + *, + value: List["VirtualMachineTemplate"], + next_link: Optional[str] = None, + **kwargs + ): + super(VirtualMachineTemplatesList, self).__init__(**kwargs) + self.next_link = next_link + self.value = value + + +class VirtualMachineUpdate(msrest.serialization.Model): + """Defines the virtualMachineUpdate. + + :param tags: A set of tags. Gets or sets the Resource tags. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure_arc_vmware_management_service_api.models.Identity + :param hardware_profile: Defines the resource properties. + :type hardware_profile: ~azure_arc_vmware_management_service_api.models.HardwareProfile + :param storage_profile: Defines the resource update properties. + :type storage_profile: ~azure_arc_vmware_management_service_api.models.StorageProfileUpdate + :param network_profile: Defines the update resource properties. + :type network_profile: ~azure_arc_vmware_management_service_api.models.NetworkProfileUpdate + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfileUpdate'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfileUpdate'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + identity: Optional["Identity"] = None, + hardware_profile: Optional["HardwareProfile"] = None, + storage_profile: Optional["StorageProfileUpdate"] = None, + network_profile: Optional["NetworkProfileUpdate"] = None, + **kwargs + ): + super(VirtualMachineUpdate, self).__init__(**kwargs) + self.tags = tags + self.identity = identity + self.hardware_profile = hardware_profile + self.storage_profile = storage_profile + self.network_profile = network_profile + + +class VirtualNetwork(msrest.serialization.Model): + """Define the virtualNetwork. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. Gets or sets the location. + :type location: str + :param extended_location: Gets or sets the extended location. + :type extended_location: ~azure_arc_vmware_management_service_api.models.ExtendedLocation + :ivar system_data: The system data. + :vartype system_data: ~azure_arc_vmware_management_service_api.models.SystemData + :param tags: A set of tags. Gets or sets the Resource tags. + :type tags: dict[str, str] + :ivar name: Gets or sets the name. + :vartype name: str + :ivar id: Gets or sets the Id. + :vartype id: str + :ivar type: Gets or sets the type of the resource. + :vartype type: str + :param kind: Metadata used by portal/tooling/etc to render different UX experiences for + resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, + the resource provider must validate and persist this value. + :type kind: str + :ivar uuid: Gets or sets a unique identifier for this resource. + :vartype uuid: str + :param v_center_id: Gets or sets the ARM Id of the vCenter resource in which this template + resides. + :type v_center_id: str + :param mo_ref_id: Gets or sets the vCenter MoRef (Managed Object Reference) ID for the virtual + network. + :type mo_ref_id: str + :param inventory_item_id: Gets or sets the inventory Item ID for the virtual network. + :type inventory_item_id: str + :ivar mo_name: Gets or sets the vCenter Managed Object name for the virtual network. + :vartype mo_name: str + :ivar custom_resource_name: Gets the name of the corresponding resource in Kubernetes. + :vartype custom_resource_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'uuid': {'readonly': True}, + 'mo_name': {'readonly': True}, + 'custom_resource_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'uuid': {'key': 'properties.uuid', 'type': 'str'}, + 'v_center_id': {'key': 'properties.vCenterId', 'type': 'str'}, + 'mo_ref_id': {'key': 'properties.moRefId', 'type': 'str'}, + 'inventory_item_id': {'key': 'properties.inventoryItemId', 'type': 'str'}, + 'mo_name': {'key': 'properties.moName', 'type': 'str'}, + 'custom_resource_name': {'key': 'properties.customResourceName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + extended_location: Optional["ExtendedLocation"] = None, + tags: Optional[Dict[str, str]] = None, + kind: Optional[str] = None, + v_center_id: Optional[str] = None, + mo_ref_id: Optional[str] = None, + inventory_item_id: Optional[str] = None, + **kwargs + ): + super(VirtualNetwork, self).__init__(**kwargs) + self.location = location + self.extended_location = extended_location + self.system_data = None + self.tags = tags + self.name = None + self.id = None + self.type = None + self.kind = kind + self.uuid = None + self.v_center_id = v_center_id + self.mo_ref_id = mo_ref_id + self.inventory_item_id = inventory_item_id + self.mo_name = None + self.custom_resource_name = None + self.provisioning_state = None + + +class VirtualNetworkInventoryItem(InventoryItemProperties): + """The Virtual network inventory item. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param inventory_type: Required. They inventory type.Constant filled by server. Possible + values include: "ResourcePool", "VirtualMachine", "VirtualMachineTemplate", "VirtualNetwork". + :type inventory_type: str or ~azure_arc_vmware_management_service_api.models.InventoryType + :param managed_resource_id: Gets or sets the tracked resource id corresponding to the inventory + resource. + :type managed_resource_id: str + :param mo_ref_id: Gets or sets the MoRef (Managed Object Reference) ID for the inventory item. + :type mo_ref_id: str + :param mo_name: Gets or sets the vCenter Managed Object name for the inventory item. + :type mo_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'inventory_type': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'inventory_type': {'key': 'inventoryType', 'type': 'str'}, + 'managed_resource_id': {'key': 'managedResourceId', 'type': 'str'}, + 'mo_ref_id': {'key': 'moRefId', 'type': 'str'}, + 'mo_name': {'key': 'moName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + managed_resource_id: Optional[str] = None, + mo_ref_id: Optional[str] = None, + mo_name: Optional[str] = None, + **kwargs + ): + super(VirtualNetworkInventoryItem, self).__init__(managed_resource_id=managed_resource_id, mo_ref_id=mo_ref_id, mo_name=mo_name, **kwargs) + self.inventory_type = 'VirtualNetwork' # type: str + + +class VirtualNetworksList(msrest.serialization.Model): + """List of VirtualNetworks. + + All required parameters must be populated in order to send to Azure. + + :param next_link: Url to follow for getting next page of VirtualNetworks. + :type next_link: str + :param value: Required. Array of VirtualNetworks. + :type value: list[~azure_arc_vmware_management_service_api.models.VirtualNetwork] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[VirtualNetwork]'}, + } + + def __init__( + self, + *, + value: List["VirtualNetwork"], + next_link: Optional[str] = None, + **kwargs + ): + super(VirtualNetworksList, self).__init__(**kwargs) + self.next_link = next_link + self.value = value + + +class VirtualSCSIController(msrest.serialization.Model): + """This data object type contains the properties of a SCSI controller device attached to a virtual machine that is reported by the controller. + + :param type: Gets or sets the controller type. Possible values include: "lsilogic", "buslogic", + "pvscsi", "lsilogicsas". + :type type: str or ~azure_arc_vmware_management_service_api.models.SCSIControllerType + :param controller_key: Gets or sets the key of the controller. + :type controller_key: int + :param bus_number: Gets or sets the bus number of the controller. + :type bus_number: int + :param scsi_ctlr_unit_number: Gets or sets the SCSI controller unit number. + :type scsi_ctlr_unit_number: int + :param sharing: Gets or sets the sharing mode. Possible values include: "noSharing", + "physicalSharing", "virtualSharing". + :type sharing: str or ~azure_arc_vmware_management_service_api.models.VirtualSCSISharing + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'controller_key': {'key': 'controllerKey', 'type': 'int'}, + 'bus_number': {'key': 'busNumber', 'type': 'int'}, + 'scsi_ctlr_unit_number': {'key': 'scsiCtlrUnitNumber', 'type': 'int'}, + 'sharing': {'key': 'sharing', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "SCSIControllerType"]] = None, + controller_key: Optional[int] = None, + bus_number: Optional[int] = None, + scsi_ctlr_unit_number: Optional[int] = None, + sharing: Optional[Union[str, "VirtualSCSISharing"]] = None, + **kwargs + ): + super(VirtualSCSIController, self).__init__(**kwargs) + self.type = type + self.controller_key = controller_key + self.bus_number = bus_number + self.scsi_ctlr_unit_number = scsi_ctlr_unit_number + self.sharing = sharing diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/azure_arc_vmware_management_service_api_enums.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/azure_arc_vmware_management_service_api_enums.py new file mode 100644 index 00000000000..3c2ad959410 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/azure_arc_vmware_management_service_api_enums.py @@ -0,0 +1,83 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class CreatedByType(str, Enum): + + user = "User" + application = "Application" + managed_identity = "ManagedIdentity" + key = "Key" + + +class DiskMode(str, Enum): + + persistent = "persistent" + independent_persistent = "independent_persistent" + independent_nonpersistent = "independent_nonpersistent" + + +class OsType(str, Enum): + + windows = "Windows" + linux = "Linux" + other = "Other" + + +class NICType(str, Enum): + + vmxnet3 = "vmxnet3" + vmxnet2 = "vmxnet2" + vmxnet = "vmxnet" + e1000 = "e1000" + e1000e = "e1000e" + pcnet32 = "pcnet32" + + +class PowerOnBootOption(str, Enum): + + enabled = "enabled" + disabled = "disabled" + + +class IPAddressAllocationMethod(str, Enum): + + unset = "unset" + dynamic = "dynamic" + static = "static" + linklayer = "linklayer" + random = "random" + other = "other" + + +class SCSIControllerType(str, Enum): + + lsilogic = "lsilogic" + buslogic = "buslogic" + pvscsi = "pvscsi" + lsilogicsas = "lsilogicsas" + + +class VirtualSCSISharing(str, Enum): + + no_sharing = "noSharing" + physical_sharing = "physicalSharing" + virtual_sharing = "virtualSharing" + + +class InventoryType(str, Enum): + + resource_pool = "ResourcePool" + virtual_machine = "VirtualMachine" + virtual_machine_template = "VirtualMachineTemplate" + virtual_network = "VirtualNetwork" diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/azure_entity_resource.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/azure_entity_resource.py new file mode 100644 index 00000000000..4c573d97a1e --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/azure_entity_resource.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class AzureEntityResource(Resource): + """The resource model definition for an Azure Resource Manager resource with + an etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/azure_entity_resource_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/azure_entity_resource_py3.py new file mode 100644 index 00000000000..8c49aaf60d8 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/azure_entity_resource_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class AzureEntityResource(Resource): + """The resource model definition for an Azure Resource Manager resource with + an etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/condition.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/condition.py new file mode 100644 index 00000000000..4da8ab5adbf --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/condition.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Condition(Model): + """Condition defines an extension to status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: Status of the condition. + :vartype status: str + :ivar reason: The reason for the condition's status. + :vartype reason: str + :ivar message: A human readable message indicating details about the + status. + :vartype message: str + :ivar severity: Severity with which to treat failures of this type of + condition. + :vartype severity: str + """ + + _validation = { + 'status': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + 'severity': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'severity': {'key': 'severity', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Condition, self).__init__(**kwargs) + self.status = None + self.reason = None + self.message = None + self.severity = None diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/condition_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/condition_py3.py new file mode 100644 index 00000000000..59bca746453 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/condition_py3.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Condition(Model): + """Condition defines an extension to status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: Status of the condition. + :vartype status: str + :ivar reason: The reason for the condition's status. + :vartype reason: str + :ivar message: A human readable message indicating details about the + status. + :vartype message: str + :ivar severity: Severity with which to treat failures of this type of + condition. + :vartype severity: str + """ + + _validation = { + 'status': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + 'severity': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'severity': {'key': 'severity', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Condition, self).__init__(**kwargs) + self.status = None + self.reason = None + self.message = None + self.severity = None diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/error_definition.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/error_definition.py new file mode 100644 index 00000000000..65fbed2b097 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/error_definition.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ErrorDefinition(Model): + """Error definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Service specific error code which serves as the substatus for + the HTTP error code. + :vartype code: str + :ivar message: Description of the error. + :vartype message: str + :ivar details: Internal error details. + :vartype details: + list[~azure.mgmt.vmware.v2020_10_01_preview.models.ErrorDefinition] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDefinition]'}, + } + + def __init__(self, **kwargs): + super(ErrorDefinition, self).__init__(**kwargs) + self.code = None + self.message = None + self.details = None diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/error_definition_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/error_definition_py3.py new file mode 100644 index 00000000000..0f54fe27ba1 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/error_definition_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ErrorDefinition(Model): + """Error definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Service specific error code which serves as the substatus for + the HTTP error code. + :vartype code: str + :ivar message: Description of the error. + :vartype message: str + :ivar details: Internal error details. + :vartype details: + list[~azure.mgmt.vmware.v2020_10_01_preview.models.ErrorDefinition] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDefinition]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorDefinition, self).__init__(**kwargs) + self.code = None + self.message = None + self.details = None diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/error_response.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/error_response.py new file mode 100644 index 00000000000..5e69d01482d --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/error_response.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error response. + + :param error: The error details. + :type error: ~azure.mgmt.vmware.v2020_10_01_preview.models.ErrorDefinition + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDefinition'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/error_response_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/error_response_py3.py new file mode 100644 index 00000000000..a4b40875b6e --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/error_response_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error response. + + :param error: The error details. + :type error: ~azure.mgmt.vmware.v2020_10_01_preview.models.ErrorDefinition + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDefinition'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/extended_location.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/extended_location.py new file mode 100644 index 00000000000..23481757753 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/extended_location.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExtendedLocation(Model): + """The extended location. + + :param type: The extended location type. + :type type: str + :param name: The extended location name. + :type name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExtendedLocation, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.name = kwargs.get('name', None) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/extended_location_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/extended_location_py3.py new file mode 100644 index 00000000000..1a714156b2a --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/extended_location_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExtendedLocation(Model): + """The extended location. + + :param type: The extended location type. + :type type: str + :param name: The extended location name. + :type name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, type: str=None, name: str=None, **kwargs) -> None: + super(ExtendedLocation, self).__init__(**kwargs) + self.type = type + self.name = name diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/hardware_profile.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/hardware_profile.py new file mode 100644 index 00000000000..ee37336986a --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/hardware_profile.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class HardwareProfile(Model): + """Defines the resource properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param memory_size_mb: Gets or sets memory size in MBs for the vm. + :type memory_size_mb: int + :param num_cp_us: Gets or sets the number of vCPUs for the vm. + :type num_cp_us: int + :param num_cores_per_socket: Gets or sets the number of cores per socket + for the vm. Defaults to 1 if unspecified. + :type num_cores_per_socket: int + :ivar cpu_hot_add_enabled: Gets or sets a value indicating whether virtual + processors can be added while this virtual machine is running. + :vartype cpu_hot_add_enabled: bool + :ivar cpu_hot_remove_enabled: Gets or sets a value indicating whether + virtual processors can be removed while this virtual machine is running. + :vartype cpu_hot_remove_enabled: bool + :ivar memory_hot_add_enabled: Gets or sets a value indicating whether + memory can be added while this virtual machine is running. + :vartype memory_hot_add_enabled: bool + """ + + _validation = { + 'cpu_hot_add_enabled': {'readonly': True}, + 'cpu_hot_remove_enabled': {'readonly': True}, + 'memory_hot_add_enabled': {'readonly': True}, + } + + _attribute_map = { + 'memory_size_mb': {'key': 'memorySizeMB', 'type': 'int'}, + 'num_cp_us': {'key': 'numCPUs', 'type': 'int'}, + 'num_cores_per_socket': {'key': 'numCoresPerSocket', 'type': 'int'}, + 'cpu_hot_add_enabled': {'key': 'cpuHotAddEnabled', 'type': 'bool'}, + 'cpu_hot_remove_enabled': {'key': 'cpuHotRemoveEnabled', 'type': 'bool'}, + 'memory_hot_add_enabled': {'key': 'memoryHotAddEnabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(HardwareProfile, self).__init__(**kwargs) + self.memory_size_mb = kwargs.get('memory_size_mb', None) + self.num_cp_us = kwargs.get('num_cp_us', None) + self.num_cores_per_socket = kwargs.get('num_cores_per_socket', None) + self.cpu_hot_add_enabled = None + self.cpu_hot_remove_enabled = None + self.memory_hot_add_enabled = None diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/hardware_profile_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/hardware_profile_py3.py new file mode 100644 index 00000000000..c276b221a90 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/hardware_profile_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class HardwareProfile(Model): + """Defines the resource properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param memory_size_mb: Gets or sets memory size in MBs for the vm. + :type memory_size_mb: int + :param num_cp_us: Gets or sets the number of vCPUs for the vm. + :type num_cp_us: int + :param num_cores_per_socket: Gets or sets the number of cores per socket + for the vm. Defaults to 1 if unspecified. + :type num_cores_per_socket: int + :ivar cpu_hot_add_enabled: Gets or sets a value indicating whether virtual + processors can be added while this virtual machine is running. + :vartype cpu_hot_add_enabled: bool + :ivar cpu_hot_remove_enabled: Gets or sets a value indicating whether + virtual processors can be removed while this virtual machine is running. + :vartype cpu_hot_remove_enabled: bool + :ivar memory_hot_add_enabled: Gets or sets a value indicating whether + memory can be added while this virtual machine is running. + :vartype memory_hot_add_enabled: bool + """ + + _validation = { + 'cpu_hot_add_enabled': {'readonly': True}, + 'cpu_hot_remove_enabled': {'readonly': True}, + 'memory_hot_add_enabled': {'readonly': True}, + } + + _attribute_map = { + 'memory_size_mb': {'key': 'memorySizeMB', 'type': 'int'}, + 'num_cp_us': {'key': 'numCPUs', 'type': 'int'}, + 'num_cores_per_socket': {'key': 'numCoresPerSocket', 'type': 'int'}, + 'cpu_hot_add_enabled': {'key': 'cpuHotAddEnabled', 'type': 'bool'}, + 'cpu_hot_remove_enabled': {'key': 'cpuHotRemoveEnabled', 'type': 'bool'}, + 'memory_hot_add_enabled': {'key': 'memoryHotAddEnabled', 'type': 'bool'}, + } + + def __init__(self, *, memory_size_mb: int=None, num_cp_us: int=None, num_cores_per_socket: int=None, **kwargs) -> None: + super(HardwareProfile, self).__init__(**kwargs) + self.memory_size_mb = memory_size_mb + self.num_cp_us = num_cp_us + self.num_cores_per_socket = num_cores_per_socket + self.cpu_hot_add_enabled = None + self.cpu_hot_remove_enabled = None + self.memory_hot_add_enabled = None diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/inventory_item.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/inventory_item.py new file mode 100644 index 00000000000..019a1d72efc --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/inventory_item.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource import ProxyResource + + +class InventoryItem(ProxyResource): + """Defines the inventory item. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param managed_resource_id: Gets or sets the tracked resource id + corresponding to the inventory resource. + :type managed_resource_id: str + :param mo_ref_id: Gets or sets the MoRef (Managed Object Reference) ID for + the inventory item. + :type mo_ref_id: str + :param mo_name: Gets or sets the vCenter Managed Object name for the + inventory item. + :type mo_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :param system_data: The system data. + :type system_data: + ~azure.mgmt.vmware.v2020_10_01_preview.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'managed_resource_id': {'key': 'properties.managedResourceId', 'type': 'str'}, + 'mo_ref_id': {'key': 'properties.moRefId', 'type': 'str'}, + 'mo_name': {'key': 'properties.moName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__(self, **kwargs): + super(InventoryItem, self).__init__(**kwargs) + self.managed_resource_id = kwargs.get('managed_resource_id', None) + self.mo_ref_id = kwargs.get('mo_ref_id', None) + self.mo_name = kwargs.get('mo_name', None) + self.provisioning_state = None + self.system_data = kwargs.get('system_data', None) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/inventory_item_paged.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/inventory_item_paged.py new file mode 100644 index 00000000000..b6a52a2a5f9 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/inventory_item_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class InventoryItemPaged(Paged): + """ + A paging container for iterating over a list of :class:`InventoryItem ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[InventoryItem]'} + } + + def __init__(self, *args, **kwargs): + + super(InventoryItemPaged, self).__init__(*args, **kwargs) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/inventory_item_properties.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/inventory_item_properties.py new file mode 100644 index 00000000000..2ceb9cd822f --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/inventory_item_properties.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class InventoryItemProperties(Model): + """Defines the resource properties. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ResourcePoolInventoryItem, VirtualMachineInventoryItem, + VirtualMachineTemplateInventoryItem, VirtualNetworkInventoryItem + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param managed_resource_id: Gets or sets the tracked resource id + corresponding to the inventory resource. + :type managed_resource_id: str + :param mo_ref_id: Gets or sets the MoRef (Managed Object Reference) ID for + the inventory item. + :type mo_ref_id: str + :param mo_name: Gets or sets the vCenter Managed Object name for the + inventory item. + :type mo_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :param inventory_type: Required. Constant filled by server. + :type inventory_type: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'inventory_type': {'required': True}, + } + + _attribute_map = { + 'managed_resource_id': {'key': 'managedResourceId', 'type': 'str'}, + 'mo_ref_id': {'key': 'moRefId', 'type': 'str'}, + 'mo_name': {'key': 'moName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'inventory_type': {'key': 'inventoryType', 'type': 'str'}, + } + + _subtype_map = { + 'inventory_type': {'ResourcePool': 'ResourcePoolInventoryItem', 'VirtualMachine': 'VirtualMachineInventoryItem', 'VirtualMachineTemplate': 'VirtualMachineTemplateInventoryItem', 'VirtualNetwork': 'VirtualNetworkInventoryItem'} + } + + def __init__(self, **kwargs): + super(InventoryItemProperties, self).__init__(**kwargs) + self.managed_resource_id = kwargs.get('managed_resource_id', None) + self.mo_ref_id = kwargs.get('mo_ref_id', None) + self.mo_name = kwargs.get('mo_name', None) + self.provisioning_state = None + self.inventory_type = None diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/inventory_item_properties_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/inventory_item_properties_py3.py new file mode 100644 index 00000000000..8d95d5c76ef --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/inventory_item_properties_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class InventoryItemProperties(Model): + """Defines the resource properties. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ResourcePoolInventoryItem, VirtualMachineInventoryItem, + VirtualMachineTemplateInventoryItem, VirtualNetworkInventoryItem + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param managed_resource_id: Gets or sets the tracked resource id + corresponding to the inventory resource. + :type managed_resource_id: str + :param mo_ref_id: Gets or sets the MoRef (Managed Object Reference) ID for + the inventory item. + :type mo_ref_id: str + :param mo_name: Gets or sets the vCenter Managed Object name for the + inventory item. + :type mo_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :param inventory_type: Required. Constant filled by server. + :type inventory_type: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'inventory_type': {'required': True}, + } + + _attribute_map = { + 'managed_resource_id': {'key': 'managedResourceId', 'type': 'str'}, + 'mo_ref_id': {'key': 'moRefId', 'type': 'str'}, + 'mo_name': {'key': 'moName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'inventory_type': {'key': 'inventoryType', 'type': 'str'}, + } + + _subtype_map = { + 'inventory_type': {'ResourcePool': 'ResourcePoolInventoryItem', 'VirtualMachine': 'VirtualMachineInventoryItem', 'VirtualMachineTemplate': 'VirtualMachineTemplateInventoryItem', 'VirtualNetwork': 'VirtualNetworkInventoryItem'} + } + + def __init__(self, *, managed_resource_id: str=None, mo_ref_id: str=None, mo_name: str=None, **kwargs) -> None: + super(InventoryItemProperties, self).__init__(**kwargs) + self.managed_resource_id = managed_resource_id + self.mo_ref_id = mo_ref_id + self.mo_name = mo_name + self.provisioning_state = None + self.inventory_type = None diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/inventory_item_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/inventory_item_py3.py new file mode 100644 index 00000000000..efd4ae0f4cd --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/inventory_item_py3.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource_py3 import ProxyResource + + +class InventoryItem(ProxyResource): + """Defines the inventory item. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param managed_resource_id: Gets or sets the tracked resource id + corresponding to the inventory resource. + :type managed_resource_id: str + :param mo_ref_id: Gets or sets the MoRef (Managed Object Reference) ID for + the inventory item. + :type mo_ref_id: str + :param mo_name: Gets or sets the vCenter Managed Object name for the + inventory item. + :type mo_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :param system_data: The system data. + :type system_data: + ~azure.mgmt.vmware.v2020_10_01_preview.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'managed_resource_id': {'key': 'properties.managedResourceId', 'type': 'str'}, + 'mo_ref_id': {'key': 'properties.moRefId', 'type': 'str'}, + 'mo_name': {'key': 'properties.moName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__(self, *, managed_resource_id: str=None, mo_ref_id: str=None, mo_name: str=None, system_data=None, **kwargs) -> None: + super(InventoryItem, self).__init__(**kwargs) + self.managed_resource_id = managed_resource_id + self.mo_ref_id = mo_ref_id + self.mo_name = mo_name + self.provisioning_state = None + self.system_data = system_data diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_interface.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_interface.py new file mode 100644 index 00000000000..1a0af23287b --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_interface.py @@ -0,0 +1,89 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterface(Model): + """Network Interface model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: Gets or sets the name of the network interface. + :type name: str + :ivar label: Gets or sets the label of the virtual network in vCenter that + the nic is connected to. + :vartype label: str + :ivar ip_addresses: Gets or sets the nic ip addresses. + :vartype ip_addresses: list[str] + :ivar mac_address: Gets or sets the NIC MAC address. + :vartype mac_address: str + :param network_id: Gets or sets the ARM Id of the network resource to + connect the virtual machine. + :type network_id: str + :param nic_type: NIC type. Possible values include: 'vmxnet3', 'vmxnet2', + 'vmxnet', 'e1000', 'e1000e', 'pcnet32' + :type nic_type: str or + ~azure.mgmt.vmware.v2020_10_01_preview.models.NICType + :param power_on_boot: Gets or sets the power on boot. Possible values + include: 'enabled', 'disabled' + :type power_on_boot: str or + ~azure.mgmt.vmware.v2020_10_01_preview.models.PowerOnBootOption + :ivar network_mo_ref_id: Gets or sets the vCenter MoRef (Managed Object + Reference) ID of the virtual network + that the nic is connected to. + :vartype network_mo_ref_id: str + :ivar network_mo_name: Gets or sets the name of the virtual network in + vCenter that the nic is connected to. + :vartype network_mo_name: str + :param device_key: Gets or sets the device key value. + :type device_key: int + :param ip_settings: Gets or sets the ipsettings. + :type ip_settings: + ~azure.mgmt.vmware.v2020_10_01_preview.models.NicIPSettings + """ + + _validation = { + 'label': {'readonly': True}, + 'ip_addresses': {'readonly': True}, + 'mac_address': {'readonly': True}, + 'network_mo_ref_id': {'readonly': True}, + 'network_mo_name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + 'ip_addresses': {'key': 'ipAddresses', 'type': '[str]'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + 'network_id': {'key': 'networkId', 'type': 'str'}, + 'nic_type': {'key': 'nicType', 'type': 'str'}, + 'power_on_boot': {'key': 'powerOnBoot', 'type': 'str'}, + 'network_mo_ref_id': {'key': 'networkMoRefId', 'type': 'str'}, + 'network_mo_name': {'key': 'networkMoName', 'type': 'str'}, + 'device_key': {'key': 'deviceKey', 'type': 'int'}, + 'ip_settings': {'key': 'ipSettings', 'type': 'NicIPSettings'}, + } + + def __init__(self, **kwargs): + super(NetworkInterface, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.label = None + self.ip_addresses = None + self.mac_address = None + self.network_id = kwargs.get('network_id', None) + self.nic_type = kwargs.get('nic_type', None) + self.power_on_boot = kwargs.get('power_on_boot', None) + self.network_mo_ref_id = None + self.network_mo_name = None + self.device_key = kwargs.get('device_key', None) + self.ip_settings = kwargs.get('ip_settings', None) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_interface_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_interface_py3.py new file mode 100644 index 00000000000..edd1c972720 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_interface_py3.py @@ -0,0 +1,89 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterface(Model): + """Network Interface model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: Gets or sets the name of the network interface. + :type name: str + :ivar label: Gets or sets the label of the virtual network in vCenter that + the nic is connected to. + :vartype label: str + :ivar ip_addresses: Gets or sets the nic ip addresses. + :vartype ip_addresses: list[str] + :ivar mac_address: Gets or sets the NIC MAC address. + :vartype mac_address: str + :param network_id: Gets or sets the ARM Id of the network resource to + connect the virtual machine. + :type network_id: str + :param nic_type: NIC type. Possible values include: 'vmxnet3', 'vmxnet2', + 'vmxnet', 'e1000', 'e1000e', 'pcnet32' + :type nic_type: str or + ~azure.mgmt.vmware.v2020_10_01_preview.models.NICType + :param power_on_boot: Gets or sets the power on boot. Possible values + include: 'enabled', 'disabled' + :type power_on_boot: str or + ~azure.mgmt.vmware.v2020_10_01_preview.models.PowerOnBootOption + :ivar network_mo_ref_id: Gets or sets the vCenter MoRef (Managed Object + Reference) ID of the virtual network + that the nic is connected to. + :vartype network_mo_ref_id: str + :ivar network_mo_name: Gets or sets the name of the virtual network in + vCenter that the nic is connected to. + :vartype network_mo_name: str + :param device_key: Gets or sets the device key value. + :type device_key: int + :param ip_settings: Gets or sets the ipsettings. + :type ip_settings: + ~azure.mgmt.vmware.v2020_10_01_preview.models.NicIPSettings + """ + + _validation = { + 'label': {'readonly': True}, + 'ip_addresses': {'readonly': True}, + 'mac_address': {'readonly': True}, + 'network_mo_ref_id': {'readonly': True}, + 'network_mo_name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + 'ip_addresses': {'key': 'ipAddresses', 'type': '[str]'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + 'network_id': {'key': 'networkId', 'type': 'str'}, + 'nic_type': {'key': 'nicType', 'type': 'str'}, + 'power_on_boot': {'key': 'powerOnBoot', 'type': 'str'}, + 'network_mo_ref_id': {'key': 'networkMoRefId', 'type': 'str'}, + 'network_mo_name': {'key': 'networkMoName', 'type': 'str'}, + 'device_key': {'key': 'deviceKey', 'type': 'int'}, + 'ip_settings': {'key': 'ipSettings', 'type': 'NicIPSettings'}, + } + + def __init__(self, *, name: str=None, network_id: str=None, nic_type=None, power_on_boot=None, device_key: int=None, ip_settings=None, **kwargs) -> None: + super(NetworkInterface, self).__init__(**kwargs) + self.name = name + self.label = None + self.ip_addresses = None + self.mac_address = None + self.network_id = network_id + self.nic_type = nic_type + self.power_on_boot = power_on_boot + self.network_mo_ref_id = None + self.network_mo_name = None + self.device_key = device_key + self.ip_settings = ip_settings diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_interface_update.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_interface_update.py new file mode 100644 index 00000000000..8fbf75f404c --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_interface_update.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceUpdate(Model): + """Defines the network interface update. + + :param name: Gets or sets the name of the network interface. + :type name: str + :param network_id: Gets or sets the ARM Id of the network resource to + connect the virtual machine. + :type network_id: str + :param nic_type: NIC type. Possible values include: 'vmxnet3', 'vmxnet2', + 'vmxnet', 'e1000', 'e1000e', 'pcnet32' + :type nic_type: str or + ~azure.mgmt.vmware.v2020_10_01_preview.models.NICType + :param power_on_boot: Gets or sets the power on boot. Possible values + include: 'enabled', 'disabled' + :type power_on_boot: str or + ~azure.mgmt.vmware.v2020_10_01_preview.models.PowerOnBootOption + :param device_key: Gets or sets the device key value. + :type device_key: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'network_id': {'key': 'networkId', 'type': 'str'}, + 'nic_type': {'key': 'nicType', 'type': 'str'}, + 'power_on_boot': {'key': 'powerOnBoot', 'type': 'str'}, + 'device_key': {'key': 'deviceKey', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(NetworkInterfaceUpdate, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.network_id = kwargs.get('network_id', None) + self.nic_type = kwargs.get('nic_type', None) + self.power_on_boot = kwargs.get('power_on_boot', None) + self.device_key = kwargs.get('device_key', None) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_interface_update_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_interface_update_py3.py new file mode 100644 index 00000000000..64ffbb8e681 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_interface_update_py3.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceUpdate(Model): + """Defines the network interface update. + + :param name: Gets or sets the name of the network interface. + :type name: str + :param network_id: Gets or sets the ARM Id of the network resource to + connect the virtual machine. + :type network_id: str + :param nic_type: NIC type. Possible values include: 'vmxnet3', 'vmxnet2', + 'vmxnet', 'e1000', 'e1000e', 'pcnet32' + :type nic_type: str or + ~azure.mgmt.vmware.v2020_10_01_preview.models.NICType + :param power_on_boot: Gets or sets the power on boot. Possible values + include: 'enabled', 'disabled' + :type power_on_boot: str or + ~azure.mgmt.vmware.v2020_10_01_preview.models.PowerOnBootOption + :param device_key: Gets or sets the device key value. + :type device_key: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'network_id': {'key': 'networkId', 'type': 'str'}, + 'nic_type': {'key': 'nicType', 'type': 'str'}, + 'power_on_boot': {'key': 'powerOnBoot', 'type': 'str'}, + 'device_key': {'key': 'deviceKey', 'type': 'int'}, + } + + def __init__(self, *, name: str=None, network_id: str=None, nic_type=None, power_on_boot=None, device_key: int=None, **kwargs) -> None: + super(NetworkInterfaceUpdate, self).__init__(**kwargs) + self.name = name + self.network_id = network_id + self.nic_type = nic_type + self.power_on_boot = power_on_boot + self.device_key = device_key diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_profile.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_profile.py new file mode 100644 index 00000000000..916d230bbbf --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_profile.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkProfile(Model): + """Defines the resource properties. + + :param network_interfaces: Gets or sets the list of network interfaces + associated with the virtual machine. + :type network_interfaces: + list[~azure.mgmt.vmware.v2020_10_01_preview.models.NetworkInterface] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[NetworkInterface]'}, + } + + def __init__(self, **kwargs): + super(NetworkProfile, self).__init__(**kwargs) + self.network_interfaces = kwargs.get('network_interfaces', None) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_profile_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_profile_py3.py new file mode 100644 index 00000000000..5389d44b732 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_profile_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkProfile(Model): + """Defines the resource properties. + + :param network_interfaces: Gets or sets the list of network interfaces + associated with the virtual machine. + :type network_interfaces: + list[~azure.mgmt.vmware.v2020_10_01_preview.models.NetworkInterface] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[NetworkInterface]'}, + } + + def __init__(self, *, network_interfaces=None, **kwargs) -> None: + super(NetworkProfile, self).__init__(**kwargs) + self.network_interfaces = network_interfaces diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_profile_update.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_profile_update.py new file mode 100644 index 00000000000..bfcf01c69e7 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_profile_update.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkProfileUpdate(Model): + """Defines the update resource properties. + + :param network_interfaces: Gets or sets the list of network interfaces + associated with the virtual machine. + :type network_interfaces: + list[~azure.mgmt.vmware.v2020_10_01_preview.models.NetworkInterfaceUpdate] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[NetworkInterfaceUpdate]'}, + } + + def __init__(self, **kwargs): + super(NetworkProfileUpdate, self).__init__(**kwargs) + self.network_interfaces = kwargs.get('network_interfaces', None) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_profile_update_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_profile_update_py3.py new file mode 100644 index 00000000000..5c0285c72b1 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/network_profile_update_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkProfileUpdate(Model): + """Defines the update resource properties. + + :param network_interfaces: Gets or sets the list of network interfaces + associated with the virtual machine. + :type network_interfaces: + list[~azure.mgmt.vmware.v2020_10_01_preview.models.NetworkInterfaceUpdate] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[NetworkInterfaceUpdate]'}, + } + + def __init__(self, *, network_interfaces=None, **kwargs) -> None: + super(NetworkProfileUpdate, self).__init__(**kwargs) + self.network_interfaces = network_interfaces diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/nic_ip_address_settings.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/nic_ip_address_settings.py new file mode 100644 index 00000000000..b4fd9368d4b --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/nic_ip_address_settings.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NicIPAddressSettings(Model): + """IP address information for a virtual network adapter reported by the + fabric. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar allocation_method: Gets the ip address allocation method. + :vartype allocation_method: str + :ivar ip_address: Gets the ip address for the nic. + :vartype ip_address: str + :ivar subnet_mask: Gets the mask. + :vartype subnet_mask: str + """ + + _validation = { + 'allocation_method': {'readonly': True}, + 'ip_address': {'readonly': True}, + 'subnet_mask': {'readonly': True}, + } + + _attribute_map = { + 'allocation_method': {'key': 'allocationMethod', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'subnet_mask': {'key': 'subnetMask', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NicIPAddressSettings, self).__init__(**kwargs) + self.allocation_method = None + self.ip_address = None + self.subnet_mask = None diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/nic_ip_address_settings_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/nic_ip_address_settings_py3.py new file mode 100644 index 00000000000..4cffa1521e1 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/nic_ip_address_settings_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NicIPAddressSettings(Model): + """IP address information for a virtual network adapter reported by the + fabric. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar allocation_method: Gets the ip address allocation method. + :vartype allocation_method: str + :ivar ip_address: Gets the ip address for the nic. + :vartype ip_address: str + :ivar subnet_mask: Gets the mask. + :vartype subnet_mask: str + """ + + _validation = { + 'allocation_method': {'readonly': True}, + 'ip_address': {'readonly': True}, + 'subnet_mask': {'readonly': True}, + } + + _attribute_map = { + 'allocation_method': {'key': 'allocationMethod', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'subnet_mask': {'key': 'subnetMask', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(NicIPAddressSettings, self).__init__(**kwargs) + self.allocation_method = None + self.ip_address = None + self.subnet_mask = None diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/nic_ip_settings.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/nic_ip_settings.py new file mode 100644 index 00000000000..008a2925670 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/nic_ip_settings.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NicIPSettings(Model): + """Defines the network interface ip settings. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param allocation_method: Gets or sets the nic allocation method. Possible + values include: 'unset', 'dynamic', 'static', 'linklayer', 'random', + 'other' + :type allocation_method: str or + ~azure.mgmt.vmware.v2020_10_01_preview.models.IPAddressAllocationMethod + :param dns_servers: Gets or sets the dns servers. + :type dns_servers: list[str] + :param gateway: Gets or sets the gateway. + :type gateway: list[str] + :param ip_address: Gets or sets the ip address for the nic. + :type ip_address: str + :param subnet_mask: Gets or sets the mask. + :type subnet_mask: str + :ivar primary_wins_server: Gets or sets the primary server. + :vartype primary_wins_server: str + :ivar secondary_wins_server: Gets or sets the secondary server. + :vartype secondary_wins_server: str + :ivar ip_address_info: Gets or sets the IP address information being + reported for this NIC. This contains the same IPv4 information above plus + IPV6 information. + :vartype ip_address_info: + list[~azure.mgmt.vmware.v2020_10_01_preview.models.NicIPAddressSettings] + """ + + _validation = { + 'primary_wins_server': {'readonly': True}, + 'secondary_wins_server': {'readonly': True}, + 'ip_address_info': {'readonly': True}, + } + + _attribute_map = { + 'allocation_method': {'key': 'allocationMethod', 'type': 'str'}, + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + 'gateway': {'key': 'gateway', 'type': '[str]'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'subnet_mask': {'key': 'subnetMask', 'type': 'str'}, + 'primary_wins_server': {'key': 'primaryWinsServer', 'type': 'str'}, + 'secondary_wins_server': {'key': 'secondaryWinsServer', 'type': 'str'}, + 'ip_address_info': {'key': 'ipAddressInfo', 'type': '[NicIPAddressSettings]'}, + } + + def __init__(self, **kwargs): + super(NicIPSettings, self).__init__(**kwargs) + self.allocation_method = kwargs.get('allocation_method', None) + self.dns_servers = kwargs.get('dns_servers', None) + self.gateway = kwargs.get('gateway', None) + self.ip_address = kwargs.get('ip_address', None) + self.subnet_mask = kwargs.get('subnet_mask', None) + self.primary_wins_server = None + self.secondary_wins_server = None + self.ip_address_info = None diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/nic_ip_settings_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/nic_ip_settings_py3.py new file mode 100644 index 00000000000..8d39aed23da --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/nic_ip_settings_py3.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NicIPSettings(Model): + """Defines the network interface ip settings. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param allocation_method: Gets or sets the nic allocation method. Possible + values include: 'unset', 'dynamic', 'static', 'linklayer', 'random', + 'other' + :type allocation_method: str or + ~azure.mgmt.vmware.v2020_10_01_preview.models.IPAddressAllocationMethod + :param dns_servers: Gets or sets the dns servers. + :type dns_servers: list[str] + :param gateway: Gets or sets the gateway. + :type gateway: list[str] + :param ip_address: Gets or sets the ip address for the nic. + :type ip_address: str + :param subnet_mask: Gets or sets the mask. + :type subnet_mask: str + :ivar primary_wins_server: Gets or sets the primary server. + :vartype primary_wins_server: str + :ivar secondary_wins_server: Gets or sets the secondary server. + :vartype secondary_wins_server: str + :ivar ip_address_info: Gets or sets the IP address information being + reported for this NIC. This contains the same IPv4 information above plus + IPV6 information. + :vartype ip_address_info: + list[~azure.mgmt.vmware.v2020_10_01_preview.models.NicIPAddressSettings] + """ + + _validation = { + 'primary_wins_server': {'readonly': True}, + 'secondary_wins_server': {'readonly': True}, + 'ip_address_info': {'readonly': True}, + } + + _attribute_map = { + 'allocation_method': {'key': 'allocationMethod', 'type': 'str'}, + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + 'gateway': {'key': 'gateway', 'type': '[str]'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'subnet_mask': {'key': 'subnetMask', 'type': 'str'}, + 'primary_wins_server': {'key': 'primaryWinsServer', 'type': 'str'}, + 'secondary_wins_server': {'key': 'secondaryWinsServer', 'type': 'str'}, + 'ip_address_info': {'key': 'ipAddressInfo', 'type': '[NicIPAddressSettings]'}, + } + + def __init__(self, *, allocation_method=None, dns_servers=None, gateway=None, ip_address: str=None, subnet_mask: str=None, **kwargs) -> None: + super(NicIPSettings, self).__init__(**kwargs) + self.allocation_method = allocation_method + self.dns_servers = dns_servers + self.gateway = gateway + self.ip_address = ip_address + self.subnet_mask = subnet_mask + self.primary_wins_server = None + self.secondary_wins_server = None + self.ip_address_info = None diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/operation.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/operation.py new file mode 100644 index 00000000000..f56a174d71c --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/operation.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """Operation provided by provider. + + :param name: Name of the operation + :type name: str + :param is_data_action: Indicates whether the operation is data action or + not. + :type is_data_action: bool + :param display: Properties of the operation + :type display: + ~azure.mgmt.vmware.v2020_10_01_preview.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.is_data_action = kwargs.get('is_data_action', None) + self.display = kwargs.get('display', None) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/operation_display.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/operation_display.py new file mode 100644 index 00000000000..89c4bdd6ccb --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/operation_display.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """Properties of the operation. + + :param provider: Provider name + :type provider: str + :param resource: Resource name + :type resource: str + :param operation: Operation name + :type operation: str + :param description: Description of the operation + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/operation_display_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/operation_display_py3.py new file mode 100644 index 00000000000..fa3740dfc65 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/operation_display_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """Properties of the operation. + + :param provider: Provider name + :type provider: str + :param resource: Resource name + :type resource: str + :param operation: Operation name + :type operation: str + :param description: Description of the operation + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/operation_paged.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/operation_paged.py new file mode 100644 index 00000000000..25e166c9fa8 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/operation_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/operation_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/operation_py3.py new file mode 100644 index 00000000000..688496a564f --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/operation_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """Operation provided by provider. + + :param name: Name of the operation + :type name: str + :param is_data_action: Indicates whether the operation is data action or + not. + :type is_data_action: bool + :param display: Properties of the operation + :type display: + ~azure.mgmt.vmware.v2020_10_01_preview.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, name: str=None, is_data_action: bool=None, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.is_data_action = is_data_action + self.display = display diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/os_profile.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/os_profile.py new file mode 100644 index 00000000000..92bfbc928fc --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/os_profile.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OsProfile(Model): + """Defines the resource properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param computer_name: Gets or sets computer name. + :type computer_name: str + :param admin_username: Gets or sets administrator username. + :type admin_username: str + :param admin_password: Gets or sets administrator password. + :type admin_password: str + :ivar os_type: Gets or sets the type of the os. Possible values include: + 'Windows', 'Linux', 'Other' + :vartype os_type: str or + ~azure.mgmt.vmware.v2020_10_01_preview.models.OsType + :ivar os_name: Gets or sets os name. + :vartype os_name: str + :ivar tools_running_status: Gets or sets the current running status of + VMware Tools running in the guest operating system. + :vartype tools_running_status: str + :ivar tools_version_status: Gets or sets the current version status of + VMware Tools installed in the guest operating system. + :vartype tools_version_status: str + :ivar tools_version: Gets or sets the current version of VMware Tools. + :vartype tools_version: str + """ + + _validation = { + 'os_type': {'readonly': True}, + 'os_name': {'readonly': True}, + 'tools_running_status': {'readonly': True}, + 'tools_version_status': {'readonly': True}, + 'tools_version': {'readonly': True}, + } + + _attribute_map = { + 'computer_name': {'key': 'computerName', 'type': 'str'}, + 'admin_username': {'key': 'adminUsername', 'type': 'str'}, + 'admin_password': {'key': 'adminPassword', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'os_name': {'key': 'osName', 'type': 'str'}, + 'tools_running_status': {'key': 'toolsRunningStatus', 'type': 'str'}, + 'tools_version_status': {'key': 'toolsVersionStatus', 'type': 'str'}, + 'tools_version': {'key': 'toolsVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OsProfile, self).__init__(**kwargs) + self.computer_name = kwargs.get('computer_name', None) + self.admin_username = kwargs.get('admin_username', None) + self.admin_password = kwargs.get('admin_password', None) + self.os_type = None + self.os_name = None + self.tools_running_status = None + self.tools_version_status = None + self.tools_version = None diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/os_profile_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/os_profile_py3.py new file mode 100644 index 00000000000..24d96f9321b --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/os_profile_py3.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OsProfile(Model): + """Defines the resource properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param computer_name: Gets or sets computer name. + :type computer_name: str + :param admin_username: Gets or sets administrator username. + :type admin_username: str + :param admin_password: Gets or sets administrator password. + :type admin_password: str + :ivar os_type: Gets or sets the type of the os. Possible values include: + 'Windows', 'Linux', 'Other' + :vartype os_type: str or + ~azure.mgmt.vmware.v2020_10_01_preview.models.OsType + :ivar os_name: Gets or sets os name. + :vartype os_name: str + :ivar tools_running_status: Gets or sets the current running status of + VMware Tools running in the guest operating system. + :vartype tools_running_status: str + :ivar tools_version_status: Gets or sets the current version status of + VMware Tools installed in the guest operating system. + :vartype tools_version_status: str + :ivar tools_version: Gets or sets the current version of VMware Tools. + :vartype tools_version: str + """ + + _validation = { + 'os_type': {'readonly': True}, + 'os_name': {'readonly': True}, + 'tools_running_status': {'readonly': True}, + 'tools_version_status': {'readonly': True}, + 'tools_version': {'readonly': True}, + } + + _attribute_map = { + 'computer_name': {'key': 'computerName', 'type': 'str'}, + 'admin_username': {'key': 'adminUsername', 'type': 'str'}, + 'admin_password': {'key': 'adminPassword', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'os_name': {'key': 'osName', 'type': 'str'}, + 'tools_running_status': {'key': 'toolsRunningStatus', 'type': 'str'}, + 'tools_version_status': {'key': 'toolsVersionStatus', 'type': 'str'}, + 'tools_version': {'key': 'toolsVersion', 'type': 'str'}, + } + + def __init__(self, *, computer_name: str=None, admin_username: str=None, admin_password: str=None, **kwargs) -> None: + super(OsProfile, self).__init__(**kwargs) + self.computer_name = computer_name + self.admin_username = admin_username + self.admin_password = admin_password + self.os_type = None + self.os_name = None + self.tools_running_status = None + self.tools_version_status = None + self.tools_version = None diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/proxy_resource.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/proxy_resource.py new file mode 100644 index 00000000000..f50eecb5b1b --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/proxy_resource.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ProxyResource(Resource): + """The resource model definition for an Azure Resource Manager proxy resource. + It will have everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/proxy_resource_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/proxy_resource_py3.py new file mode 100644 index 00000000000..0175329f195 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/proxy_resource_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class ProxyResource(Resource): + """The resource model definition for an Azure Resource Manager proxy resource. + It will have everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource.py new file mode 100644 index 00000000000..88ac10c9bcc --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """Common fields that are returned in the response for all Azure Resource + Manager resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_patch.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_patch.py new file mode 100644 index 00000000000..85ec50189c5 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_patch.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourcePatch(Model): + """Object containing updates for patch operations. + + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ResourcePatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_patch_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_patch_py3.py new file mode 100644 index 00000000000..0700d72d92b --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_patch_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourcePatch(Model): + """Object containing updates for patch operations. + + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(ResourcePatch, self).__init__(**kwargs) + self.tags = tags diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_pool.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_pool.py new file mode 100644 index 00000000000..cf245383952 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_pool.py @@ -0,0 +1,154 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourcePool(Model): + """Define the resourcePool. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar uuid: Gets or sets a unique identifier for this resource. + :vartype uuid: str + :param v_center_id: Gets or sets the ARM Id of the vCenter resource in + which this resource pool resides. + :type v_center_id: str + :param mo_ref_id: Gets or sets the vCenter MoRef (Managed Object + Reference) ID for the resource pool. + :type mo_ref_id: str + :param inventory_item_id: Gets or sets the inventory Item ID for the + resource pool. + :type inventory_item_id: str + :ivar mo_name: Gets or sets the vCenter Managed Object name for the + resource pool. + :vartype mo_name: str + :ivar cpu_shares_level: Gets or sets CPUSharesLevel which specifies the + CPU allocation level for this pool. + This property is used in relative allocation between resource consumers. + :vartype cpu_shares_level: str + :ivar cpu_reservation_mhz: Gets or sets CPUReservationMHz which specifies + the CPU size in MHz that is guaranteed + to be available. + :vartype cpu_reservation_mhz: long + :ivar cpu_limit_mhz: Gets or sets CPULimitMHz which specifies a CPU usage + limit in MHz. + Utilization will not exceed this limit even if there are available + resources. + :vartype cpu_limit_mhz: long + :ivar mem_shares_level: Gets or sets CPUSharesLevel which specifies the + memory allocation level for this pool. + This property is used in relative allocation between resource consumers. + :vartype mem_shares_level: str + :ivar mem_reservation_mb: Gets or sets MemReservationMB which specifies + the guaranteed available memory in + megabytes. + :vartype mem_reservation_mb: long + :ivar mem_limit_mb: Gets or sets MemLimitMB specifies a memory usage limit + in megabytes. + Utilization will not exceed the specified limit even if there are + available resources. + :vartype mem_limit_mb: long + :ivar custom_resource_name: Gets the name of the corresponding resource in + Kubernetes. + :vartype custom_resource_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :param location: Required. Gets or sets the location. + :type location: str + :param extended_location: Gets or sets the extended location. + :type extended_location: + ~azure.mgmt.vmware.v2020_10_01_preview.models.ExtendedLocation + :param system_data: The system data. + :type system_data: + ~azure.mgmt.vmware.v2020_10_01_preview.models.SystemData + :param tags: Gets or sets the Resource tags. + :type tags: dict[str, str] + :ivar name: Gets or sets the name. + :vartype name: str + :ivar id: Gets or sets the Id. + :vartype id: str + :ivar type: Gets or sets the type of the resource. + :vartype type: str + :param kind: Metadata used by portal/tooling/etc to render different UX + experiences for resources of the same type; e.g. ApiApps are a kind of + Microsoft.Web/sites type. If supported, the resource provider must + validate and persist this value. + :type kind: str + """ + + _validation = { + 'uuid': {'readonly': True}, + 'mo_name': {'readonly': True}, + 'cpu_shares_level': {'readonly': True}, + 'cpu_reservation_mhz': {'readonly': True}, + 'cpu_limit_mhz': {'readonly': True}, + 'mem_shares_level': {'readonly': True}, + 'mem_reservation_mb': {'readonly': True}, + 'mem_limit_mb': {'readonly': True}, + 'custom_resource_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'location': {'required': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'uuid': {'key': 'properties.uuid', 'type': 'str'}, + 'v_center_id': {'key': 'properties.vCenterId', 'type': 'str'}, + 'mo_ref_id': {'key': 'properties.moRefId', 'type': 'str'}, + 'inventory_item_id': {'key': 'properties.inventoryItemId', 'type': 'str'}, + 'mo_name': {'key': 'properties.moName', 'type': 'str'}, + 'cpu_shares_level': {'key': 'properties.cpuSharesLevel', 'type': 'str'}, + 'cpu_reservation_mhz': {'key': 'properties.cpuReservationMHz', 'type': 'long'}, + 'cpu_limit_mhz': {'key': 'properties.cpuLimitMHz', 'type': 'long'}, + 'mem_shares_level': {'key': 'properties.memSharesLevel', 'type': 'str'}, + 'mem_reservation_mb': {'key': 'properties.memReservationMB', 'type': 'long'}, + 'mem_limit_mb': {'key': 'properties.memLimitMB', 'type': 'long'}, + 'custom_resource_name': {'key': 'properties.customResourceName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourcePool, self).__init__(**kwargs) + self.uuid = None + self.v_center_id = kwargs.get('v_center_id', None) + self.mo_ref_id = kwargs.get('mo_ref_id', None) + self.inventory_item_id = kwargs.get('inventory_item_id', None) + self.mo_name = None + self.cpu_shares_level = None + self.cpu_reservation_mhz = None + self.cpu_limit_mhz = None + self.mem_shares_level = None + self.mem_reservation_mb = None + self.mem_limit_mb = None + self.custom_resource_name = None + self.provisioning_state = None + self.location = kwargs.get('location', None) + self.extended_location = kwargs.get('extended_location', None) + self.system_data = kwargs.get('system_data', None) + self.tags = kwargs.get('tags', None) + self.name = None + self.id = None + self.type = None + self.kind = kwargs.get('kind', None) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_pool_inventory_item.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_pool_inventory_item.py new file mode 100644 index 00000000000..0e0e9f5e86b --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_pool_inventory_item.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .inventory_item_properties import InventoryItemProperties + + +class ResourcePoolInventoryItem(InventoryItemProperties): + """The resource pool inventory item. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param managed_resource_id: Gets or sets the tracked resource id + corresponding to the inventory resource. + :type managed_resource_id: str + :param mo_ref_id: Gets or sets the MoRef (Managed Object Reference) ID for + the inventory item. + :type mo_ref_id: str + :param mo_name: Gets or sets the vCenter Managed Object name for the + inventory item. + :type mo_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :param inventory_type: Required. Constant filled by server. + :type inventory_type: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'inventory_type': {'required': True}, + } + + _attribute_map = { + 'managed_resource_id': {'key': 'managedResourceId', 'type': 'str'}, + 'mo_ref_id': {'key': 'moRefId', 'type': 'str'}, + 'mo_name': {'key': 'moName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'inventory_type': {'key': 'inventoryType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourcePoolInventoryItem, self).__init__(**kwargs) + self.inventory_type = 'ResourcePool' diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_pool_inventory_item_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_pool_inventory_item_py3.py new file mode 100644 index 00000000000..8440f0530e3 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_pool_inventory_item_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .inventory_item_properties_py3 import InventoryItemProperties + + +class ResourcePoolInventoryItem(InventoryItemProperties): + """The resource pool inventory item. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param managed_resource_id: Gets or sets the tracked resource id + corresponding to the inventory resource. + :type managed_resource_id: str + :param mo_ref_id: Gets or sets the MoRef (Managed Object Reference) ID for + the inventory item. + :type mo_ref_id: str + :param mo_name: Gets or sets the vCenter Managed Object name for the + inventory item. + :type mo_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :param inventory_type: Required. Constant filled by server. + :type inventory_type: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'inventory_type': {'required': True}, + } + + _attribute_map = { + 'managed_resource_id': {'key': 'managedResourceId', 'type': 'str'}, + 'mo_ref_id': {'key': 'moRefId', 'type': 'str'}, + 'mo_name': {'key': 'moName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'inventory_type': {'key': 'inventoryType', 'type': 'str'}, + } + + def __init__(self, *, managed_resource_id: str=None, mo_ref_id: str=None, mo_name: str=None, **kwargs) -> None: + super(ResourcePoolInventoryItem, self).__init__(managed_resource_id=managed_resource_id, mo_ref_id=mo_ref_id, mo_name=mo_name, **kwargs) + self.inventory_type = 'ResourcePool' diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_pool_paged.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_pool_paged.py new file mode 100644 index 00000000000..65ec66597cb --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_pool_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ResourcePoolPaged(Paged): + """ + A paging container for iterating over a list of :class:`ResourcePool ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ResourcePool]'} + } + + def __init__(self, *args, **kwargs): + + super(ResourcePoolPaged, self).__init__(*args, **kwargs) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_pool_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_pool_py3.py new file mode 100644 index 00000000000..40552ce09e6 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_pool_py3.py @@ -0,0 +1,154 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourcePool(Model): + """Define the resourcePool. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar uuid: Gets or sets a unique identifier for this resource. + :vartype uuid: str + :param v_center_id: Gets or sets the ARM Id of the vCenter resource in + which this resource pool resides. + :type v_center_id: str + :param mo_ref_id: Gets or sets the vCenter MoRef (Managed Object + Reference) ID for the resource pool. + :type mo_ref_id: str + :param inventory_item_id: Gets or sets the inventory Item ID for the + resource pool. + :type inventory_item_id: str + :ivar mo_name: Gets or sets the vCenter Managed Object name for the + resource pool. + :vartype mo_name: str + :ivar cpu_shares_level: Gets or sets CPUSharesLevel which specifies the + CPU allocation level for this pool. + This property is used in relative allocation between resource consumers. + :vartype cpu_shares_level: str + :ivar cpu_reservation_mhz: Gets or sets CPUReservationMHz which specifies + the CPU size in MHz that is guaranteed + to be available. + :vartype cpu_reservation_mhz: long + :ivar cpu_limit_mhz: Gets or sets CPULimitMHz which specifies a CPU usage + limit in MHz. + Utilization will not exceed this limit even if there are available + resources. + :vartype cpu_limit_mhz: long + :ivar mem_shares_level: Gets or sets CPUSharesLevel which specifies the + memory allocation level for this pool. + This property is used in relative allocation between resource consumers. + :vartype mem_shares_level: str + :ivar mem_reservation_mb: Gets or sets MemReservationMB which specifies + the guaranteed available memory in + megabytes. + :vartype mem_reservation_mb: long + :ivar mem_limit_mb: Gets or sets MemLimitMB specifies a memory usage limit + in megabytes. + Utilization will not exceed the specified limit even if there are + available resources. + :vartype mem_limit_mb: long + :ivar custom_resource_name: Gets the name of the corresponding resource in + Kubernetes. + :vartype custom_resource_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :param location: Required. Gets or sets the location. + :type location: str + :param extended_location: Gets or sets the extended location. + :type extended_location: + ~azure.mgmt.vmware.v2020_10_01_preview.models.ExtendedLocation + :param system_data: The system data. + :type system_data: + ~azure.mgmt.vmware.v2020_10_01_preview.models.SystemData + :param tags: Gets or sets the Resource tags. + :type tags: dict[str, str] + :ivar name: Gets or sets the name. + :vartype name: str + :ivar id: Gets or sets the Id. + :vartype id: str + :ivar type: Gets or sets the type of the resource. + :vartype type: str + :param kind: Metadata used by portal/tooling/etc to render different UX + experiences for resources of the same type; e.g. ApiApps are a kind of + Microsoft.Web/sites type. If supported, the resource provider must + validate and persist this value. + :type kind: str + """ + + _validation = { + 'uuid': {'readonly': True}, + 'mo_name': {'readonly': True}, + 'cpu_shares_level': {'readonly': True}, + 'cpu_reservation_mhz': {'readonly': True}, + 'cpu_limit_mhz': {'readonly': True}, + 'mem_shares_level': {'readonly': True}, + 'mem_reservation_mb': {'readonly': True}, + 'mem_limit_mb': {'readonly': True}, + 'custom_resource_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'location': {'required': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'uuid': {'key': 'properties.uuid', 'type': 'str'}, + 'v_center_id': {'key': 'properties.vCenterId', 'type': 'str'}, + 'mo_ref_id': {'key': 'properties.moRefId', 'type': 'str'}, + 'inventory_item_id': {'key': 'properties.inventoryItemId', 'type': 'str'}, + 'mo_name': {'key': 'properties.moName', 'type': 'str'}, + 'cpu_shares_level': {'key': 'properties.cpuSharesLevel', 'type': 'str'}, + 'cpu_reservation_mhz': {'key': 'properties.cpuReservationMHz', 'type': 'long'}, + 'cpu_limit_mhz': {'key': 'properties.cpuLimitMHz', 'type': 'long'}, + 'mem_shares_level': {'key': 'properties.memSharesLevel', 'type': 'str'}, + 'mem_reservation_mb': {'key': 'properties.memReservationMB', 'type': 'long'}, + 'mem_limit_mb': {'key': 'properties.memLimitMB', 'type': 'long'}, + 'custom_resource_name': {'key': 'properties.customResourceName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, *, location: str, v_center_id: str=None, mo_ref_id: str=None, inventory_item_id: str=None, extended_location=None, system_data=None, tags=None, kind: str=None, **kwargs) -> None: + super(ResourcePool, self).__init__(**kwargs) + self.uuid = None + self.v_center_id = v_center_id + self.mo_ref_id = mo_ref_id + self.inventory_item_id = inventory_item_id + self.mo_name = None + self.cpu_shares_level = None + self.cpu_reservation_mhz = None + self.cpu_limit_mhz = None + self.mem_shares_level = None + self.mem_reservation_mb = None + self.mem_limit_mb = None + self.custom_resource_name = None + self.provisioning_state = None + self.location = location + self.extended_location = extended_location + self.system_data = system_data + self.tags = tags + self.name = None + self.id = None + self.type = None + self.kind = kind diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_py3.py new file mode 100644 index 00000000000..b7d3562a596 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/resource_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """Common fields that are returned in the response for all Azure Resource + Manager resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/stop_virtual_machine_options.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/stop_virtual_machine_options.py new file mode 100644 index 00000000000..08183269a57 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/stop_virtual_machine_options.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StopVirtualMachineOptions(Model): + """Defines the stop action properties. + + :param skip_shutdown: Gets or sets a value indicating whether to request + non-graceful VM shutdown. True value for this flag indicates non-graceful + shutdown whereas false indicates otherwise. Defaults to false. Default + value: False . + :type skip_shutdown: bool + """ + + _attribute_map = { + 'skip_shutdown': {'key': 'skipShutdown', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(StopVirtualMachineOptions, self).__init__(**kwargs) + self.skip_shutdown = kwargs.get('skip_shutdown', False) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/stop_virtual_machine_options_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/stop_virtual_machine_options_py3.py new file mode 100644 index 00000000000..39a60951ca2 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/stop_virtual_machine_options_py3.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StopVirtualMachineOptions(Model): + """Defines the stop action properties. + + :param skip_shutdown: Gets or sets a value indicating whether to request + non-graceful VM shutdown. True value for this flag indicates non-graceful + shutdown whereas false indicates otherwise. Defaults to false. Default + value: False . + :type skip_shutdown: bool + """ + + _attribute_map = { + 'skip_shutdown': {'key': 'skipShutdown', 'type': 'bool'}, + } + + def __init__(self, *, skip_shutdown: bool=False, **kwargs) -> None: + super(StopVirtualMachineOptions, self).__init__(**kwargs) + self.skip_shutdown = skip_shutdown diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/storage_profile.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/storage_profile.py new file mode 100644 index 00000000000..6b463756f49 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/storage_profile.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageProfile(Model): + """Defines the resource properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param disks: Gets or sets the list of virtual disks associated with the + virtual machine. + :type disks: + list[~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualDisk] + :ivar scsi_controllers: Gets or sets the list of virtual SCSI controllers + associated with the virtual machine. + :vartype scsi_controllers: + list[~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualSCSIController] + """ + + _validation = { + 'scsi_controllers': {'readonly': True}, + } + + _attribute_map = { + 'disks': {'key': 'disks', 'type': '[VirtualDisk]'}, + 'scsi_controllers': {'key': 'scsiControllers', 'type': '[VirtualSCSIController]'}, + } + + def __init__(self, **kwargs): + super(StorageProfile, self).__init__(**kwargs) + self.disks = kwargs.get('disks', None) + self.scsi_controllers = None diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/storage_profile_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/storage_profile_py3.py new file mode 100644 index 00000000000..64297fe9f92 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/storage_profile_py3.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageProfile(Model): + """Defines the resource properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param disks: Gets or sets the list of virtual disks associated with the + virtual machine. + :type disks: + list[~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualDisk] + :ivar scsi_controllers: Gets or sets the list of virtual SCSI controllers + associated with the virtual machine. + :vartype scsi_controllers: + list[~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualSCSIController] + """ + + _validation = { + 'scsi_controllers': {'readonly': True}, + } + + _attribute_map = { + 'disks': {'key': 'disks', 'type': '[VirtualDisk]'}, + 'scsi_controllers': {'key': 'scsiControllers', 'type': '[VirtualSCSIController]'}, + } + + def __init__(self, *, disks=None, **kwargs) -> None: + super(StorageProfile, self).__init__(**kwargs) + self.disks = disks + self.scsi_controllers = None diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/storage_profile_update.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/storage_profile_update.py new file mode 100644 index 00000000000..d941637949f --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/storage_profile_update.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageProfileUpdate(Model): + """Defines the resource update properties. + + :param disks: Gets or sets the list of virtual disks associated with the + virtual machine. + :type disks: + list[~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualDiskUpdate] + """ + + _attribute_map = { + 'disks': {'key': 'disks', 'type': '[VirtualDiskUpdate]'}, + } + + def __init__(self, **kwargs): + super(StorageProfileUpdate, self).__init__(**kwargs) + self.disks = kwargs.get('disks', None) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/storage_profile_update_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/storage_profile_update_py3.py new file mode 100644 index 00000000000..d398fa42619 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/storage_profile_update_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageProfileUpdate(Model): + """Defines the resource update properties. + + :param disks: Gets or sets the list of virtual disks associated with the + virtual machine. + :type disks: + list[~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualDiskUpdate] + """ + + _attribute_map = { + 'disks': {'key': 'disks', 'type': '[VirtualDiskUpdate]'}, + } + + def __init__(self, *, disks=None, **kwargs) -> None: + super(StorageProfileUpdate, self).__init__(**kwargs) + self.disks = disks diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/system_data.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/system_data.py new file mode 100644 index 00000000000..84d0435b3dc --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/system_data.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or + ~azure.mgmt.vmware.v2020_10_01_preview.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.vmware.v2020_10_01_preview.models.CreatedByType + :param last_modified_at: The type of identity that last modified the + resource. + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/system_data_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/system_data_py3.py new file mode 100644 index 00000000000..a2cacb2126c --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/system_data_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or + ~azure.mgmt.vmware.v2020_10_01_preview.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.vmware.v2020_10_01_preview.models.CreatedByType + :param last_modified_at: The type of identity that last modified the + resource. + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, *, created_by: str=None, created_by_type=None, created_at=None, last_modified_by: str=None, last_modified_by_type=None, last_modified_at=None, **kwargs) -> None: + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/tracked_resource.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/tracked_resource.py new file mode 100644 index 00000000000..eecd58e988f --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/tracked_resource.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top + level resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/tracked_resource_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/tracked_resource_py3.py new file mode 100644 index 00000000000..ff16a507808 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/tracked_resource_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top + level resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/vcenter.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/vcenter.py new file mode 100644 index 00000000000..22a400a9930 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/vcenter.py @@ -0,0 +1,120 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VCenter(Model): + """Defines the vCenter. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar uuid: Gets or sets a unique identifier for this resource. + :vartype uuid: str + :param fqdn: Required. Gets or sets the FQDN/IPAddress of the vCenter. + :type fqdn: str + :param port: Gets or sets the port of the vCenter. + :type port: int + :ivar version: Gets or sets the version of the vCenter. + :vartype version: str + :ivar instance_uuid: Gets or sets the instance UUID of the vCenter. + :vartype instance_uuid: str + :ivar connection_status: Gets or sets the connection status to the + vCenter. + :vartype connection_status: str + :ivar custom_resource_name: Gets the name of the corresponding resource in + Kubernetes. + :vartype custom_resource_name: str + :param credentials: Username / Password Credentials to connect to vcenter. + :type credentials: + ~azure.mgmt.vmware.v2020_10_01_preview.models.VICredential + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :param location: Required. Gets or sets the location. + :type location: str + :param extended_location: Gets or sets the extended location. + :type extended_location: + ~azure.mgmt.vmware.v2020_10_01_preview.models.ExtendedLocation + :param system_data: The system data. + :type system_data: + ~azure.mgmt.vmware.v2020_10_01_preview.models.SystemData + :param tags: Gets or sets the Resource tags. + :type tags: dict[str, str] + :ivar name: Gets or sets the name. + :vartype name: str + :ivar id: Gets or sets the Id. + :vartype id: str + :ivar type: Gets or sets the type of the resource. + :vartype type: str + :param kind: Metadata used by portal/tooling/etc to render different UX + experiences for resources of the same type; e.g. ApiApps are a kind of + Microsoft.Web/sites type. If supported, the resource provider must + validate and persist this value. + :type kind: str + """ + + _validation = { + 'uuid': {'readonly': True}, + 'fqdn': {'required': True}, + 'port': {'maximum': 65535, 'minimum': 1}, + 'version': {'readonly': True}, + 'instance_uuid': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'custom_resource_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'location': {'required': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'uuid': {'key': 'properties.uuid', 'type': 'str'}, + 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'instance_uuid': {'key': 'properties.instanceUuid', 'type': 'str'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'custom_resource_name': {'key': 'properties.customResourceName', 'type': 'str'}, + 'credentials': {'key': 'properties.credentials', 'type': 'VICredential'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VCenter, self).__init__(**kwargs) + self.uuid = None + self.fqdn = kwargs.get('fqdn', None) + self.port = kwargs.get('port', None) + self.version = None + self.instance_uuid = None + self.connection_status = None + self.custom_resource_name = None + self.credentials = kwargs.get('credentials', None) + self.provisioning_state = None + self.location = kwargs.get('location', None) + self.extended_location = kwargs.get('extended_location', None) + self.system_data = kwargs.get('system_data', None) + self.tags = kwargs.get('tags', None) + self.name = None + self.id = None + self.type = None + self.kind = kwargs.get('kind', None) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/vcenter_paged.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/vcenter_paged.py new file mode 100644 index 00000000000..cef555d741e --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/vcenter_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class VCenterPaged(Paged): + """ + A paging container for iterating over a list of :class:`VCenter ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[VCenter]'} + } + + def __init__(self, *args, **kwargs): + + super(VCenterPaged, self).__init__(*args, **kwargs) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/vcenter_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/vcenter_py3.py new file mode 100644 index 00000000000..ff4d5d4930b --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/vcenter_py3.py @@ -0,0 +1,120 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VCenter(Model): + """Defines the vCenter. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar uuid: Gets or sets a unique identifier for this resource. + :vartype uuid: str + :param fqdn: Required. Gets or sets the FQDN/IPAddress of the vCenter. + :type fqdn: str + :param port: Gets or sets the port of the vCenter. + :type port: int + :ivar version: Gets or sets the version of the vCenter. + :vartype version: str + :ivar instance_uuid: Gets or sets the instance UUID of the vCenter. + :vartype instance_uuid: str + :ivar connection_status: Gets or sets the connection status to the + vCenter. + :vartype connection_status: str + :ivar custom_resource_name: Gets the name of the corresponding resource in + Kubernetes. + :vartype custom_resource_name: str + :param credentials: Username / Password Credentials to connect to vcenter. + :type credentials: + ~azure.mgmt.vmware.v2020_10_01_preview.models.VICredential + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :param location: Required. Gets or sets the location. + :type location: str + :param extended_location: Gets or sets the extended location. + :type extended_location: + ~azure.mgmt.vmware.v2020_10_01_preview.models.ExtendedLocation + :param system_data: The system data. + :type system_data: + ~azure.mgmt.vmware.v2020_10_01_preview.models.SystemData + :param tags: Gets or sets the Resource tags. + :type tags: dict[str, str] + :ivar name: Gets or sets the name. + :vartype name: str + :ivar id: Gets or sets the Id. + :vartype id: str + :ivar type: Gets or sets the type of the resource. + :vartype type: str + :param kind: Metadata used by portal/tooling/etc to render different UX + experiences for resources of the same type; e.g. ApiApps are a kind of + Microsoft.Web/sites type. If supported, the resource provider must + validate and persist this value. + :type kind: str + """ + + _validation = { + 'uuid': {'readonly': True}, + 'fqdn': {'required': True}, + 'port': {'maximum': 65535, 'minimum': 1}, + 'version': {'readonly': True}, + 'instance_uuid': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'custom_resource_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'location': {'required': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'uuid': {'key': 'properties.uuid', 'type': 'str'}, + 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'instance_uuid': {'key': 'properties.instanceUuid', 'type': 'str'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'custom_resource_name': {'key': 'properties.customResourceName', 'type': 'str'}, + 'credentials': {'key': 'properties.credentials', 'type': 'VICredential'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, *, fqdn: str, location: str, port: int=None, credentials=None, extended_location=None, system_data=None, tags=None, kind: str=None, **kwargs) -> None: + super(VCenter, self).__init__(**kwargs) + self.uuid = None + self.fqdn = fqdn + self.port = port + self.version = None + self.instance_uuid = None + self.connection_status = None + self.custom_resource_name = None + self.credentials = credentials + self.provisioning_state = None + self.location = location + self.extended_location = extended_location + self.system_data = system_data + self.tags = tags + self.name = None + self.id = None + self.type = None + self.kind = kind diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/vi_credential.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/vi_credential.py new file mode 100644 index 00000000000..b30e9e3e835 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/vi_credential.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VICredential(Model): + """Username / Password Credentials to connect to vcenter. + + :param username: Gets or sets username to connect with the vCenter. + :type username: str + :param password: Gets or sets the password to connect with the vCenter. + :type password: str + """ + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VICredential, self).__init__(**kwargs) + self.username = kwargs.get('username', None) + self.password = kwargs.get('password', None) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/vi_credential_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/vi_credential_py3.py new file mode 100644 index 00000000000..610c781dc44 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/vi_credential_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VICredential(Model): + """Username / Password Credentials to connect to vcenter. + + :param username: Gets or sets username to connect with the vCenter. + :type username: str + :param password: Gets or sets the password to connect with the vCenter. + :type password: str + """ + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, *, username: str=None, password: str=None, **kwargs) -> None: + super(VICredential, self).__init__(**kwargs) + self.username = username + self.password = password diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_disk.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_disk.py new file mode 100644 index 00000000000..dae3de3f68c --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_disk.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualDisk(Model): + """Virtual disk model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: Gets or sets the name of the virtual disk. + :type name: str + :ivar label: Gets or sets the label of the virtual disk in vCenter. + :vartype label: str + :ivar disk_object_id: Gets or sets the disk object id. + :vartype disk_object_id: str + :param disk_size_gb: Gets or sets the disk total size. + :type disk_size_gb: int + :param device_key: Gets or sets the device key value. + :type device_key: int + :param disk_mode: Gets or sets the disk mode. Possible values include: + 'persistent', 'independent_persistent', 'independent_nonpersistent' + :type disk_mode: str or + ~azure.mgmt.vmware.v2020_10_01_preview.models.DiskMode + :param controller_key: Gets or sets the controller id. + :type controller_key: int + :param unit_number: Gets or sets the unit number of the disk on the + controller. + :type unit_number: int + """ + + _validation = { + 'label': {'readonly': True}, + 'disk_object_id': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + 'disk_object_id': {'key': 'diskObjectId', 'type': 'str'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'device_key': {'key': 'deviceKey', 'type': 'int'}, + 'disk_mode': {'key': 'diskMode', 'type': 'str'}, + 'controller_key': {'key': 'controllerKey', 'type': 'int'}, + 'unit_number': {'key': 'unitNumber', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(VirtualDisk, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.label = None + self.disk_object_id = None + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.device_key = kwargs.get('device_key', None) + self.disk_mode = kwargs.get('disk_mode', None) + self.controller_key = kwargs.get('controller_key', None) + self.unit_number = kwargs.get('unit_number', None) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_disk_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_disk_py3.py new file mode 100644 index 00000000000..2d5220e4714 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_disk_py3.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualDisk(Model): + """Virtual disk model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: Gets or sets the name of the virtual disk. + :type name: str + :ivar label: Gets or sets the label of the virtual disk in vCenter. + :vartype label: str + :ivar disk_object_id: Gets or sets the disk object id. + :vartype disk_object_id: str + :param disk_size_gb: Gets or sets the disk total size. + :type disk_size_gb: int + :param device_key: Gets or sets the device key value. + :type device_key: int + :param disk_mode: Gets or sets the disk mode. Possible values include: + 'persistent', 'independent_persistent', 'independent_nonpersistent' + :type disk_mode: str or + ~azure.mgmt.vmware.v2020_10_01_preview.models.DiskMode + :param controller_key: Gets or sets the controller id. + :type controller_key: int + :param unit_number: Gets or sets the unit number of the disk on the + controller. + :type unit_number: int + """ + + _validation = { + 'label': {'readonly': True}, + 'disk_object_id': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + 'disk_object_id': {'key': 'diskObjectId', 'type': 'str'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'device_key': {'key': 'deviceKey', 'type': 'int'}, + 'disk_mode': {'key': 'diskMode', 'type': 'str'}, + 'controller_key': {'key': 'controllerKey', 'type': 'int'}, + 'unit_number': {'key': 'unitNumber', 'type': 'int'}, + } + + def __init__(self, *, name: str=None, disk_size_gb: int=None, device_key: int=None, disk_mode=None, controller_key: int=None, unit_number: int=None, **kwargs) -> None: + super(VirtualDisk, self).__init__(**kwargs) + self.name = name + self.label = None + self.disk_object_id = None + self.disk_size_gb = disk_size_gb + self.device_key = device_key + self.disk_mode = disk_mode + self.controller_key = controller_key + self.unit_number = unit_number diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_disk_update.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_disk_update.py new file mode 100644 index 00000000000..2d2348d3b90 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_disk_update.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualDiskUpdate(Model): + """Defines the virtual disk update. + + :param name: Gets or sets the name of the virtual disk. + :type name: str + :param disk_size_gb: Gets or sets the disk total size. + :type disk_size_gb: int + :param device_key: Gets or sets the device key value. + :type device_key: int + :param disk_mode: Gets or sets the disk mode. Possible values include: + 'persistent', 'independent_persistent', 'independent_nonpersistent' + :type disk_mode: str or + ~azure.mgmt.vmware.v2020_10_01_preview.models.DiskMode + :param controller_key: Gets or sets the controller id. + :type controller_key: int + :param unit_number: Gets or sets the unit number of the disk on the + controller. + :type unit_number: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'device_key': {'key': 'deviceKey', 'type': 'int'}, + 'disk_mode': {'key': 'diskMode', 'type': 'str'}, + 'controller_key': {'key': 'controllerKey', 'type': 'int'}, + 'unit_number': {'key': 'unitNumber', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(VirtualDiskUpdate, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.device_key = kwargs.get('device_key', None) + self.disk_mode = kwargs.get('disk_mode', None) + self.controller_key = kwargs.get('controller_key', None) + self.unit_number = kwargs.get('unit_number', None) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_disk_update_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_disk_update_py3.py new file mode 100644 index 00000000000..d13230fbcd8 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_disk_update_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualDiskUpdate(Model): + """Defines the virtual disk update. + + :param name: Gets or sets the name of the virtual disk. + :type name: str + :param disk_size_gb: Gets or sets the disk total size. + :type disk_size_gb: int + :param device_key: Gets or sets the device key value. + :type device_key: int + :param disk_mode: Gets or sets the disk mode. Possible values include: + 'persistent', 'independent_persistent', 'independent_nonpersistent' + :type disk_mode: str or + ~azure.mgmt.vmware.v2020_10_01_preview.models.DiskMode + :param controller_key: Gets or sets the controller id. + :type controller_key: int + :param unit_number: Gets or sets the unit number of the disk on the + controller. + :type unit_number: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, + 'device_key': {'key': 'deviceKey', 'type': 'int'}, + 'disk_mode': {'key': 'diskMode', 'type': 'str'}, + 'controller_key': {'key': 'controllerKey', 'type': 'int'}, + 'unit_number': {'key': 'unitNumber', 'type': 'int'}, + } + + def __init__(self, *, name: str=None, disk_size_gb: int=None, device_key: int=None, disk_mode=None, controller_key: int=None, unit_number: int=None, **kwargs) -> None: + super(VirtualDiskUpdate, self).__init__(**kwargs) + self.name = name + self.disk_size_gb = disk_size_gb + self.device_key = device_key + self.disk_mode = disk_mode + self.controller_key = controller_key + self.unit_number = unit_number diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine.py new file mode 100644 index 00000000000..8665b0f2129 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine.py @@ -0,0 +1,155 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualMachine(Model): + """Define the virtualMachine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param resource_pool_id: Gets or sets the ARM Id of the resourcePool + resource on which this virtual machine will + deploy. + :type resource_pool_id: str + :param template_id: Gets or sets the ARM Id of the template resource to + deploy the virtual machine. + :type template_id: str + :param v_center_id: Gets or sets the ARM Id of the vCenter resource in + which this resource pool resides. + :type v_center_id: str + :param os_profile: OS properties. + :type os_profile: ~azure.mgmt.vmware.v2020_10_01_preview.models.OsProfile + :param hardware_profile: Hardware properties. + :type hardware_profile: + ~azure.mgmt.vmware.v2020_10_01_preview.models.HardwareProfile + :param network_profile: Network properties. + :type network_profile: + ~azure.mgmt.vmware.v2020_10_01_preview.models.NetworkProfile + :param storage_profile: Storage properties. + :type storage_profile: + ~azure.mgmt.vmware.v2020_10_01_preview.models.StorageProfile + :param mo_ref_id: Gets or sets the vCenter MoRef (Managed Object + Reference) ID for the virtual machine. + :type mo_ref_id: str + :param inventory_item_id: Gets or sets the inventory Item ID for the + virtual machine. + :type inventory_item_id: str + :ivar mo_name: Gets or sets the vCenter Managed Object name for the + virtual machine. + :vartype mo_name: str + :ivar folder_path: Gets or sets the folder path of the vm. + :vartype folder_path: str + :ivar instance_uuid: Gets or sets the instance uuid of the vm. + :vartype instance_uuid: str + :ivar power_state: Gets the power state of the virtual machine. + :vartype power_state: str + :ivar custom_resource_name: Gets the name of the corresponding resource in + Kubernetes. + :vartype custom_resource_name: str + :ivar uuid: Gets or sets a unique identifier for this resource. + :vartype uuid: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :param location: Required. Gets or sets the location. + :type location: str + :param extended_location: Gets or sets the extended location. + :type extended_location: + ~azure.mgmt.vmware.v2020_10_01_preview.models.ExtendedLocation + :param system_data: The system data. + :type system_data: + ~azure.mgmt.vmware.v2020_10_01_preview.models.SystemData + :param tags: Gets or sets the Resource tags. + :type tags: dict[str, str] + :ivar name: Gets or sets the name. + :vartype name: str + :ivar id: Gets or sets the Id. + :vartype id: str + :ivar type: Gets or sets the type of the resource. + :vartype type: str + :param kind: Metadata used by portal/tooling/etc to render different UX + experiences for resources of the same type; e.g. ApiApps are a kind of + Microsoft.Web/sites type. If supported, the resource provider must + validate and persist this value. + :type kind: str + """ + + _validation = { + 'mo_name': {'readonly': True}, + 'folder_path': {'readonly': True}, + 'instance_uuid': {'readonly': True}, + 'power_state': {'readonly': True}, + 'custom_resource_name': {'readonly': True}, + 'uuid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'location': {'required': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'resource_pool_id': {'key': 'properties.resourcePoolId', 'type': 'str'}, + 'template_id': {'key': 'properties.templateId', 'type': 'str'}, + 'v_center_id': {'key': 'properties.vCenterId', 'type': 'str'}, + 'os_profile': {'key': 'properties.osProfile', 'type': 'OsProfile'}, + 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + 'mo_ref_id': {'key': 'properties.moRefId', 'type': 'str'}, + 'inventory_item_id': {'key': 'properties.inventoryItemId', 'type': 'str'}, + 'mo_name': {'key': 'properties.moName', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'instance_uuid': {'key': 'properties.instanceUuid', 'type': 'str'}, + 'power_state': {'key': 'properties.powerState', 'type': 'str'}, + 'custom_resource_name': {'key': 'properties.customResourceName', 'type': 'str'}, + 'uuid': {'key': 'properties.uuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualMachine, self).__init__(**kwargs) + self.resource_pool_id = kwargs.get('resource_pool_id', None) + self.template_id = kwargs.get('template_id', None) + self.v_center_id = kwargs.get('v_center_id', None) + self.os_profile = kwargs.get('os_profile', None) + self.hardware_profile = kwargs.get('hardware_profile', None) + self.network_profile = kwargs.get('network_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.mo_ref_id = kwargs.get('mo_ref_id', None) + self.inventory_item_id = kwargs.get('inventory_item_id', None) + self.mo_name = None + self.folder_path = None + self.instance_uuid = None + self.power_state = None + self.custom_resource_name = None + self.uuid = None + self.provisioning_state = None + self.location = kwargs.get('location', None) + self.extended_location = kwargs.get('extended_location', None) + self.system_data = kwargs.get('system_data', None) + self.tags = kwargs.get('tags', None) + self.name = None + self.id = None + self.type = None + self.kind = kwargs.get('kind', None) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_inventory_item.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_inventory_item.py new file mode 100644 index 00000000000..1a339e34b16 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_inventory_item.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .inventory_item_properties import InventoryItemProperties + + +class VirtualMachineInventoryItem(InventoryItemProperties): + """The VM inventory item. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param managed_resource_id: Gets or sets the tracked resource id + corresponding to the inventory resource. + :type managed_resource_id: str + :param mo_ref_id: Gets or sets the MoRef (Managed Object Reference) ID for + the inventory item. + :type mo_ref_id: str + :param mo_name: Gets or sets the vCenter Managed Object name for the + inventory item. + :type mo_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :param inventory_type: Required. Constant filled by server. + :type inventory_type: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'inventory_type': {'required': True}, + } + + _attribute_map = { + 'managed_resource_id': {'key': 'managedResourceId', 'type': 'str'}, + 'mo_ref_id': {'key': 'moRefId', 'type': 'str'}, + 'mo_name': {'key': 'moName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'inventory_type': {'key': 'inventoryType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualMachineInventoryItem, self).__init__(**kwargs) + self.inventory_type = 'VirtualMachine' diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_inventory_item_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_inventory_item_py3.py new file mode 100644 index 00000000000..121defd8577 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_inventory_item_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .inventory_item_properties_py3 import InventoryItemProperties + + +class VirtualMachineInventoryItem(InventoryItemProperties): + """The VM inventory item. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param managed_resource_id: Gets or sets the tracked resource id + corresponding to the inventory resource. + :type managed_resource_id: str + :param mo_ref_id: Gets or sets the MoRef (Managed Object Reference) ID for + the inventory item. + :type mo_ref_id: str + :param mo_name: Gets or sets the vCenter Managed Object name for the + inventory item. + :type mo_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :param inventory_type: Required. Constant filled by server. + :type inventory_type: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'inventory_type': {'required': True}, + } + + _attribute_map = { + 'managed_resource_id': {'key': 'managedResourceId', 'type': 'str'}, + 'mo_ref_id': {'key': 'moRefId', 'type': 'str'}, + 'mo_name': {'key': 'moName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'inventory_type': {'key': 'inventoryType', 'type': 'str'}, + } + + def __init__(self, *, managed_resource_id: str=None, mo_ref_id: str=None, mo_name: str=None, **kwargs) -> None: + super(VirtualMachineInventoryItem, self).__init__(managed_resource_id=managed_resource_id, mo_ref_id=mo_ref_id, mo_name=mo_name, **kwargs) + self.inventory_type = 'VirtualMachine' diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_paged.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_paged.py new file mode 100644 index 00000000000..9d3eba3a151 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class VirtualMachinePaged(Paged): + """ + A paging container for iterating over a list of :class:`VirtualMachine ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[VirtualMachine]'} + } + + def __init__(self, *args, **kwargs): + + super(VirtualMachinePaged, self).__init__(*args, **kwargs) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_py3.py new file mode 100644 index 00000000000..6363cb2d971 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_py3.py @@ -0,0 +1,155 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualMachine(Model): + """Define the virtualMachine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param resource_pool_id: Gets or sets the ARM Id of the resourcePool + resource on which this virtual machine will + deploy. + :type resource_pool_id: str + :param template_id: Gets or sets the ARM Id of the template resource to + deploy the virtual machine. + :type template_id: str + :param v_center_id: Gets or sets the ARM Id of the vCenter resource in + which this resource pool resides. + :type v_center_id: str + :param os_profile: OS properties. + :type os_profile: ~azure.mgmt.vmware.v2020_10_01_preview.models.OsProfile + :param hardware_profile: Hardware properties. + :type hardware_profile: + ~azure.mgmt.vmware.v2020_10_01_preview.models.HardwareProfile + :param network_profile: Network properties. + :type network_profile: + ~azure.mgmt.vmware.v2020_10_01_preview.models.NetworkProfile + :param storage_profile: Storage properties. + :type storage_profile: + ~azure.mgmt.vmware.v2020_10_01_preview.models.StorageProfile + :param mo_ref_id: Gets or sets the vCenter MoRef (Managed Object + Reference) ID for the virtual machine. + :type mo_ref_id: str + :param inventory_item_id: Gets or sets the inventory Item ID for the + virtual machine. + :type inventory_item_id: str + :ivar mo_name: Gets or sets the vCenter Managed Object name for the + virtual machine. + :vartype mo_name: str + :ivar folder_path: Gets or sets the folder path of the vm. + :vartype folder_path: str + :ivar instance_uuid: Gets or sets the instance uuid of the vm. + :vartype instance_uuid: str + :ivar power_state: Gets the power state of the virtual machine. + :vartype power_state: str + :ivar custom_resource_name: Gets the name of the corresponding resource in + Kubernetes. + :vartype custom_resource_name: str + :ivar uuid: Gets or sets a unique identifier for this resource. + :vartype uuid: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :param location: Required. Gets or sets the location. + :type location: str + :param extended_location: Gets or sets the extended location. + :type extended_location: + ~azure.mgmt.vmware.v2020_10_01_preview.models.ExtendedLocation + :param system_data: The system data. + :type system_data: + ~azure.mgmt.vmware.v2020_10_01_preview.models.SystemData + :param tags: Gets or sets the Resource tags. + :type tags: dict[str, str] + :ivar name: Gets or sets the name. + :vartype name: str + :ivar id: Gets or sets the Id. + :vartype id: str + :ivar type: Gets or sets the type of the resource. + :vartype type: str + :param kind: Metadata used by portal/tooling/etc to render different UX + experiences for resources of the same type; e.g. ApiApps are a kind of + Microsoft.Web/sites type. If supported, the resource provider must + validate and persist this value. + :type kind: str + """ + + _validation = { + 'mo_name': {'readonly': True}, + 'folder_path': {'readonly': True}, + 'instance_uuid': {'readonly': True}, + 'power_state': {'readonly': True}, + 'custom_resource_name': {'readonly': True}, + 'uuid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'location': {'required': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'resource_pool_id': {'key': 'properties.resourcePoolId', 'type': 'str'}, + 'template_id': {'key': 'properties.templateId', 'type': 'str'}, + 'v_center_id': {'key': 'properties.vCenterId', 'type': 'str'}, + 'os_profile': {'key': 'properties.osProfile', 'type': 'OsProfile'}, + 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + 'mo_ref_id': {'key': 'properties.moRefId', 'type': 'str'}, + 'inventory_item_id': {'key': 'properties.inventoryItemId', 'type': 'str'}, + 'mo_name': {'key': 'properties.moName', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'instance_uuid': {'key': 'properties.instanceUuid', 'type': 'str'}, + 'power_state': {'key': 'properties.powerState', 'type': 'str'}, + 'custom_resource_name': {'key': 'properties.customResourceName', 'type': 'str'}, + 'uuid': {'key': 'properties.uuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, *, location: str, resource_pool_id: str=None, template_id: str=None, v_center_id: str=None, os_profile=None, hardware_profile=None, network_profile=None, storage_profile=None, mo_ref_id: str=None, inventory_item_id: str=None, extended_location=None, system_data=None, tags=None, kind: str=None, **kwargs) -> None: + super(VirtualMachine, self).__init__(**kwargs) + self.resource_pool_id = resource_pool_id + self.template_id = template_id + self.v_center_id = v_center_id + self.os_profile = os_profile + self.hardware_profile = hardware_profile + self.network_profile = network_profile + self.storage_profile = storage_profile + self.mo_ref_id = mo_ref_id + self.inventory_item_id = inventory_item_id + self.mo_name = None + self.folder_path = None + self.instance_uuid = None + self.power_state = None + self.custom_resource_name = None + self.uuid = None + self.provisioning_state = None + self.location = location + self.extended_location = extended_location + self.system_data = system_data + self.tags = tags + self.name = None + self.id = None + self.type = None + self.kind = kind diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_template.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_template.py new file mode 100644 index 00000000000..1c44ddb5300 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_template.py @@ -0,0 +1,158 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualMachineTemplate(Model): + """Define the virtualMachineTemplate. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar uuid: Gets or sets a unique identifier for this resource. + :vartype uuid: str + :param v_center_id: Gets or sets the ARM Id of the vCenter resource in + which this template resides. + :type v_center_id: str + :param mo_ref_id: Gets or sets the vCenter MoRef (Managed Object + Reference) ID for the virtual machine + template. + :type mo_ref_id: str + :param inventory_item_id: Gets or sets the inventory Item ID for the + virtual machine template. + :type inventory_item_id: str + :ivar mo_name: Gets or sets the vCenter Managed Object name for the + virtual machine template. + :vartype mo_name: str + :ivar memory_size_mb: Gets or sets memory size in MBs for the template. + :vartype memory_size_mb: int + :ivar num_cp_us: Gets or sets the number of vCPUs for the template. + :vartype num_cp_us: int + :ivar num_cores_per_socket: Gets or sets the number of cores per socket + for the template. + Defaults to 1 if unspecified. + :vartype num_cores_per_socket: int + :ivar os_type: Gets or sets the type of the os. Possible values include: + 'Windows', 'Linux', 'Other' + :vartype os_type: str or + ~azure.mgmt.vmware.v2020_10_01_preview.models.OsType + :ivar os_name: Gets or sets os name. + :vartype os_name: str + :ivar folder_path: Gets or sets the folder path of the template. + :vartype folder_path: str + :ivar network_interfaces: Gets or sets the network interfaces of the + template. + :vartype network_interfaces: + list[~azure.mgmt.vmware.v2020_10_01_preview.models.NetworkInterface] + :ivar disks: Gets or sets the disks the template. + :vartype disks: + list[~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualDisk] + :ivar custom_resource_name: Gets the name of the corresponding resource in + Kubernetes. + :vartype custom_resource_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :param location: Required. Gets or sets the location. + :type location: str + :param extended_location: Gets or sets the extended location. + :type extended_location: + ~azure.mgmt.vmware.v2020_10_01_preview.models.ExtendedLocation + :param system_data: The system data. + :type system_data: + ~azure.mgmt.vmware.v2020_10_01_preview.models.SystemData + :param tags: Gets or sets the Resource tags. + :type tags: dict[str, str] + :ivar name: Gets or sets the name. + :vartype name: str + :ivar id: Gets or sets the Id. + :vartype id: str + :ivar type: Gets or sets the type of the resource. + :vartype type: str + :param kind: Metadata used by portal/tooling/etc to render different UX + experiences for resources of the same type; e.g. ApiApps are a kind of + Microsoft.Web/sites type. If supported, the resource provider must + validate and persist this value. + :type kind: str + """ + + _validation = { + 'uuid': {'readonly': True}, + 'mo_name': {'readonly': True}, + 'memory_size_mb': {'readonly': True}, + 'num_cp_us': {'readonly': True}, + 'num_cores_per_socket': {'readonly': True}, + 'os_type': {'readonly': True}, + 'os_name': {'readonly': True}, + 'folder_path': {'readonly': True}, + 'network_interfaces': {'readonly': True}, + 'disks': {'readonly': True}, + 'custom_resource_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'location': {'required': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'uuid': {'key': 'properties.uuid', 'type': 'str'}, + 'v_center_id': {'key': 'properties.vCenterId', 'type': 'str'}, + 'mo_ref_id': {'key': 'properties.moRefId', 'type': 'str'}, + 'inventory_item_id': {'key': 'properties.inventoryItemId', 'type': 'str'}, + 'mo_name': {'key': 'properties.moName', 'type': 'str'}, + 'memory_size_mb': {'key': 'properties.memorySizeMB', 'type': 'int'}, + 'num_cp_us': {'key': 'properties.numCPUs', 'type': 'int'}, + 'num_cores_per_socket': {'key': 'properties.numCoresPerSocket', 'type': 'int'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'os_name': {'key': 'properties.osName', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'network_interfaces': {'key': 'properties.networkInterfaces', 'type': '[NetworkInterface]'}, + 'disks': {'key': 'properties.disks', 'type': '[VirtualDisk]'}, + 'custom_resource_name': {'key': 'properties.customResourceName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualMachineTemplate, self).__init__(**kwargs) + self.uuid = None + self.v_center_id = kwargs.get('v_center_id', None) + self.mo_ref_id = kwargs.get('mo_ref_id', None) + self.inventory_item_id = kwargs.get('inventory_item_id', None) + self.mo_name = None + self.memory_size_mb = None + self.num_cp_us = None + self.num_cores_per_socket = None + self.os_type = None + self.os_name = None + self.folder_path = None + self.network_interfaces = None + self.disks = None + self.custom_resource_name = None + self.provisioning_state = None + self.location = kwargs.get('location', None) + self.extended_location = kwargs.get('extended_location', None) + self.system_data = kwargs.get('system_data', None) + self.tags = kwargs.get('tags', None) + self.name = None + self.id = None + self.type = None + self.kind = kwargs.get('kind', None) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_template_inventory_item.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_template_inventory_item.py new file mode 100644 index 00000000000..8ea04b80604 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_template_inventory_item.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .inventory_item_properties import InventoryItemProperties + + +class VirtualMachineTemplateInventoryItem(InventoryItemProperties): + """The VM Template inventory item. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param managed_resource_id: Gets or sets the tracked resource id + corresponding to the inventory resource. + :type managed_resource_id: str + :param mo_ref_id: Gets or sets the MoRef (Managed Object Reference) ID for + the inventory item. + :type mo_ref_id: str + :param mo_name: Gets or sets the vCenter Managed Object name for the + inventory item. + :type mo_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :param inventory_type: Required. Constant filled by server. + :type inventory_type: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'inventory_type': {'required': True}, + } + + _attribute_map = { + 'managed_resource_id': {'key': 'managedResourceId', 'type': 'str'}, + 'mo_ref_id': {'key': 'moRefId', 'type': 'str'}, + 'mo_name': {'key': 'moName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'inventory_type': {'key': 'inventoryType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualMachineTemplateInventoryItem, self).__init__(**kwargs) + self.inventory_type = 'VirtualMachineTemplate' diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_template_inventory_item_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_template_inventory_item_py3.py new file mode 100644 index 00000000000..560d071c52d --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_template_inventory_item_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .inventory_item_properties_py3 import InventoryItemProperties + + +class VirtualMachineTemplateInventoryItem(InventoryItemProperties): + """The VM Template inventory item. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param managed_resource_id: Gets or sets the tracked resource id + corresponding to the inventory resource. + :type managed_resource_id: str + :param mo_ref_id: Gets or sets the MoRef (Managed Object Reference) ID for + the inventory item. + :type mo_ref_id: str + :param mo_name: Gets or sets the vCenter Managed Object name for the + inventory item. + :type mo_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :param inventory_type: Required. Constant filled by server. + :type inventory_type: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'inventory_type': {'required': True}, + } + + _attribute_map = { + 'managed_resource_id': {'key': 'managedResourceId', 'type': 'str'}, + 'mo_ref_id': {'key': 'moRefId', 'type': 'str'}, + 'mo_name': {'key': 'moName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'inventory_type': {'key': 'inventoryType', 'type': 'str'}, + } + + def __init__(self, *, managed_resource_id: str=None, mo_ref_id: str=None, mo_name: str=None, **kwargs) -> None: + super(VirtualMachineTemplateInventoryItem, self).__init__(managed_resource_id=managed_resource_id, mo_ref_id=mo_ref_id, mo_name=mo_name, **kwargs) + self.inventory_type = 'VirtualMachineTemplate' diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_template_paged.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_template_paged.py new file mode 100644 index 00000000000..08665faf2fd --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_template_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class VirtualMachineTemplatePaged(Paged): + """ + A paging container for iterating over a list of :class:`VirtualMachineTemplate ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[VirtualMachineTemplate]'} + } + + def __init__(self, *args, **kwargs): + + super(VirtualMachineTemplatePaged, self).__init__(*args, **kwargs) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_template_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_template_py3.py new file mode 100644 index 00000000000..d56d529952f --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_template_py3.py @@ -0,0 +1,158 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualMachineTemplate(Model): + """Define the virtualMachineTemplate. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar uuid: Gets or sets a unique identifier for this resource. + :vartype uuid: str + :param v_center_id: Gets or sets the ARM Id of the vCenter resource in + which this template resides. + :type v_center_id: str + :param mo_ref_id: Gets or sets the vCenter MoRef (Managed Object + Reference) ID for the virtual machine + template. + :type mo_ref_id: str + :param inventory_item_id: Gets or sets the inventory Item ID for the + virtual machine template. + :type inventory_item_id: str + :ivar mo_name: Gets or sets the vCenter Managed Object name for the + virtual machine template. + :vartype mo_name: str + :ivar memory_size_mb: Gets or sets memory size in MBs for the template. + :vartype memory_size_mb: int + :ivar num_cp_us: Gets or sets the number of vCPUs for the template. + :vartype num_cp_us: int + :ivar num_cores_per_socket: Gets or sets the number of cores per socket + for the template. + Defaults to 1 if unspecified. + :vartype num_cores_per_socket: int + :ivar os_type: Gets or sets the type of the os. Possible values include: + 'Windows', 'Linux', 'Other' + :vartype os_type: str or + ~azure.mgmt.vmware.v2020_10_01_preview.models.OsType + :ivar os_name: Gets or sets os name. + :vartype os_name: str + :ivar folder_path: Gets or sets the folder path of the template. + :vartype folder_path: str + :ivar network_interfaces: Gets or sets the network interfaces of the + template. + :vartype network_interfaces: + list[~azure.mgmt.vmware.v2020_10_01_preview.models.NetworkInterface] + :ivar disks: Gets or sets the disks the template. + :vartype disks: + list[~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualDisk] + :ivar custom_resource_name: Gets the name of the corresponding resource in + Kubernetes. + :vartype custom_resource_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :param location: Required. Gets or sets the location. + :type location: str + :param extended_location: Gets or sets the extended location. + :type extended_location: + ~azure.mgmt.vmware.v2020_10_01_preview.models.ExtendedLocation + :param system_data: The system data. + :type system_data: + ~azure.mgmt.vmware.v2020_10_01_preview.models.SystemData + :param tags: Gets or sets the Resource tags. + :type tags: dict[str, str] + :ivar name: Gets or sets the name. + :vartype name: str + :ivar id: Gets or sets the Id. + :vartype id: str + :ivar type: Gets or sets the type of the resource. + :vartype type: str + :param kind: Metadata used by portal/tooling/etc to render different UX + experiences for resources of the same type; e.g. ApiApps are a kind of + Microsoft.Web/sites type. If supported, the resource provider must + validate and persist this value. + :type kind: str + """ + + _validation = { + 'uuid': {'readonly': True}, + 'mo_name': {'readonly': True}, + 'memory_size_mb': {'readonly': True}, + 'num_cp_us': {'readonly': True}, + 'num_cores_per_socket': {'readonly': True}, + 'os_type': {'readonly': True}, + 'os_name': {'readonly': True}, + 'folder_path': {'readonly': True}, + 'network_interfaces': {'readonly': True}, + 'disks': {'readonly': True}, + 'custom_resource_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'location': {'required': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'uuid': {'key': 'properties.uuid', 'type': 'str'}, + 'v_center_id': {'key': 'properties.vCenterId', 'type': 'str'}, + 'mo_ref_id': {'key': 'properties.moRefId', 'type': 'str'}, + 'inventory_item_id': {'key': 'properties.inventoryItemId', 'type': 'str'}, + 'mo_name': {'key': 'properties.moName', 'type': 'str'}, + 'memory_size_mb': {'key': 'properties.memorySizeMB', 'type': 'int'}, + 'num_cp_us': {'key': 'properties.numCPUs', 'type': 'int'}, + 'num_cores_per_socket': {'key': 'properties.numCoresPerSocket', 'type': 'int'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'os_name': {'key': 'properties.osName', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'network_interfaces': {'key': 'properties.networkInterfaces', 'type': '[NetworkInterface]'}, + 'disks': {'key': 'properties.disks', 'type': '[VirtualDisk]'}, + 'custom_resource_name': {'key': 'properties.customResourceName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, *, location: str, v_center_id: str=None, mo_ref_id: str=None, inventory_item_id: str=None, extended_location=None, system_data=None, tags=None, kind: str=None, **kwargs) -> None: + super(VirtualMachineTemplate, self).__init__(**kwargs) + self.uuid = None + self.v_center_id = v_center_id + self.mo_ref_id = mo_ref_id + self.inventory_item_id = inventory_item_id + self.mo_name = None + self.memory_size_mb = None + self.num_cp_us = None + self.num_cores_per_socket = None + self.os_type = None + self.os_name = None + self.folder_path = None + self.network_interfaces = None + self.disks = None + self.custom_resource_name = None + self.provisioning_state = None + self.location = location + self.extended_location = extended_location + self.system_data = system_data + self.tags = tags + self.name = None + self.id = None + self.type = None + self.kind = kind diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_update.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_update.py new file mode 100644 index 00000000000..557160c0127 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_update.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualMachineUpdate(Model): + """Defines the virtualMachineUpdate. + + :param hardware_profile: + :type hardware_profile: + ~azure.mgmt.vmware.v2020_10_01_preview.models.HardwareProfile + :param storage_profile: + :type storage_profile: + ~azure.mgmt.vmware.v2020_10_01_preview.models.StorageProfileUpdate + :param network_profile: + :type network_profile: + ~azure.mgmt.vmware.v2020_10_01_preview.models.NetworkProfileUpdate + :param tags: Gets or sets the Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'hardware_profile': { + 'key': 'properties.hardwareProfile', + 'type': 'HardwareProfile', + }, + 'storage_profile': { + 'key': 'properties.storageProfile', + 'type': 'StorageProfileUpdate', + }, + 'network_profile': { + 'key': 'properties.networkProfile', + 'type': 'NetworkProfileUpdate', + }, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(VirtualMachineUpdate, self).__init__(**kwargs) + self.hardware_profile = kwargs.get('hardware_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.network_profile = kwargs.get('network_profile', None) + self.tags = kwargs.get('tags', None) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_update_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_update_py3.py new file mode 100644 index 00000000000..27dd9c3547f --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_machine_update_py3.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualMachineUpdate(Model): + """Defines the virtualMachineUpdate. + + :param hardware_profile: + :type hardware_profile: + ~azure.mgmt.vmware.v2020_10_01_preview.models.HardwareProfile + :param storage_profile: + :type storage_profile: + ~azure.mgmt.vmware.v2020_10_01_preview.models.StorageProfileUpdate + :param network_profile: + :type network_profile: + ~azure.mgmt.vmware.v2020_10_01_preview.models.NetworkProfileUpdate + :param tags: Gets or sets the Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfileUpdate'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfileUpdate'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, hardware_profile=None, storage_profile=None, network_profile=None, tags=None, **kwargs) -> None: + super(VirtualMachineUpdate, self).__init__(**kwargs) + self.hardware_profile = hardware_profile + self.storage_profile = storage_profile + self.network_profile = network_profile + self.tags = tags diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_network.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_network.py new file mode 100644 index 00000000000..3011728b608 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_network.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetwork(Model): + """Define the virtualNetwork. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar uuid: Gets or sets a unique identifier for this resource. + :vartype uuid: str + :param v_center_id: Gets or sets the ARM Id of the vCenter resource in + which this template resides. + :type v_center_id: str + :param mo_ref_id: Gets or sets the vCenter MoRef (Managed Object + Reference) ID for the virtual network. + :type mo_ref_id: str + :param inventory_item_id: Gets or sets the inventory Item ID for the + virtual network. + :type inventory_item_id: str + :ivar mo_name: Gets or sets the vCenter Managed Object name for the + virtual network. + :vartype mo_name: str + :ivar custom_resource_name: Gets the name of the corresponding resource in + Kubernetes. + :vartype custom_resource_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :param location: Required. Gets or sets the location. + :type location: str + :param extended_location: Gets or sets the extended location. + :type extended_location: + ~azure.mgmt.vmware.v2020_10_01_preview.models.ExtendedLocation + :param system_data: The system data. + :type system_data: + ~azure.mgmt.vmware.v2020_10_01_preview.models.SystemData + :param tags: Gets or sets the Resource tags. + :type tags: dict[str, str] + :ivar name: Gets or sets the name. + :vartype name: str + :ivar id: Gets or sets the Id. + :vartype id: str + :ivar type: Gets or sets the type of the resource. + :vartype type: str + :param kind: Metadata used by portal/tooling/etc to render different UX + experiences for resources of the same type; e.g. ApiApps are a kind of + Microsoft.Web/sites type. If supported, the resource provider must + validate and persist this value. + :type kind: str + """ + + _validation = { + 'uuid': {'readonly': True}, + 'mo_name': {'readonly': True}, + 'custom_resource_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'location': {'required': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'uuid': {'key': 'properties.uuid', 'type': 'str'}, + 'v_center_id': {'key': 'properties.vCenterId', 'type': 'str'}, + 'mo_ref_id': {'key': 'properties.moRefId', 'type': 'str'}, + 'inventory_item_id': {'key': 'properties.inventoryItemId', 'type': 'str'}, + 'mo_name': {'key': 'properties.moName', 'type': 'str'}, + 'custom_resource_name': {'key': 'properties.customResourceName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualNetwork, self).__init__(**kwargs) + self.uuid = None + self.v_center_id = kwargs.get('v_center_id', None) + self.mo_ref_id = kwargs.get('mo_ref_id', None) + self.inventory_item_id = kwargs.get('inventory_item_id', None) + self.mo_name = None + self.custom_resource_name = None + self.provisioning_state = None + self.location = kwargs.get('location', None) + self.extended_location = kwargs.get('extended_location', None) + self.system_data = kwargs.get('system_data', None) + self.tags = kwargs.get('tags', None) + self.name = None + self.id = None + self.type = None + self.kind = kwargs.get('kind', None) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_network_inventory_item.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_network_inventory_item.py new file mode 100644 index 00000000000..ff3c1103a9a --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_network_inventory_item.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .inventory_item_properties import InventoryItemProperties + + +class VirtualNetworkInventoryItem(InventoryItemProperties): + """The Virtual network inventory item. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param managed_resource_id: Gets or sets the tracked resource id + corresponding to the inventory resource. + :type managed_resource_id: str + :param mo_ref_id: Gets or sets the MoRef (Managed Object Reference) ID for + the inventory item. + :type mo_ref_id: str + :param mo_name: Gets or sets the vCenter Managed Object name for the + inventory item. + :type mo_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :param inventory_type: Required. Constant filled by server. + :type inventory_type: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'inventory_type': {'required': True}, + } + + _attribute_map = { + 'managed_resource_id': {'key': 'managedResourceId', 'type': 'str'}, + 'mo_ref_id': {'key': 'moRefId', 'type': 'str'}, + 'mo_name': {'key': 'moName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'inventory_type': {'key': 'inventoryType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkInventoryItem, self).__init__(**kwargs) + self.inventory_type = 'VirtualNetwork' diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_network_inventory_item_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_network_inventory_item_py3.py new file mode 100644 index 00000000000..6a13935f6c6 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_network_inventory_item_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .inventory_item_properties_py3 import InventoryItemProperties + + +class VirtualNetworkInventoryItem(InventoryItemProperties): + """The Virtual network inventory item. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param managed_resource_id: Gets or sets the tracked resource id + corresponding to the inventory resource. + :type managed_resource_id: str + :param mo_ref_id: Gets or sets the MoRef (Managed Object Reference) ID for + the inventory item. + :type mo_ref_id: str + :param mo_name: Gets or sets the vCenter Managed Object name for the + inventory item. + :type mo_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :param inventory_type: Required. Constant filled by server. + :type inventory_type: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'inventory_type': {'required': True}, + } + + _attribute_map = { + 'managed_resource_id': {'key': 'managedResourceId', 'type': 'str'}, + 'mo_ref_id': {'key': 'moRefId', 'type': 'str'}, + 'mo_name': {'key': 'moName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'inventory_type': {'key': 'inventoryType', 'type': 'str'}, + } + + def __init__(self, *, managed_resource_id: str=None, mo_ref_id: str=None, mo_name: str=None, **kwargs) -> None: + super(VirtualNetworkInventoryItem, self).__init__(managed_resource_id=managed_resource_id, mo_ref_id=mo_ref_id, mo_name=mo_name, **kwargs) + self.inventory_type = 'VirtualNetwork' diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_network_paged.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_network_paged.py new file mode 100644 index 00000000000..f32a65ad6f1 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_network_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class VirtualNetworkPaged(Paged): + """ + A paging container for iterating over a list of :class:`VirtualNetwork ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[VirtualNetwork]'} + } + + def __init__(self, *args, **kwargs): + + super(VirtualNetworkPaged, self).__init__(*args, **kwargs) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_network_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_network_py3.py new file mode 100644 index 00000000000..b6b7066bbc0 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_network_py3.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetwork(Model): + """Define the virtualNetwork. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar uuid: Gets or sets a unique identifier for this resource. + :vartype uuid: str + :param v_center_id: Gets or sets the ARM Id of the vCenter resource in + which this template resides. + :type v_center_id: str + :param mo_ref_id: Gets or sets the vCenter MoRef (Managed Object + Reference) ID for the virtual network. + :type mo_ref_id: str + :param inventory_item_id: Gets or sets the inventory Item ID for the + virtual network. + :type inventory_item_id: str + :ivar mo_name: Gets or sets the vCenter Managed Object name for the + virtual network. + :vartype mo_name: str + :ivar custom_resource_name: Gets the name of the corresponding resource in + Kubernetes. + :vartype custom_resource_name: str + :ivar provisioning_state: Gets or sets the provisioning state. + :vartype provisioning_state: str + :param location: Required. Gets or sets the location. + :type location: str + :param extended_location: Gets or sets the extended location. + :type extended_location: + ~azure.mgmt.vmware.v2020_10_01_preview.models.ExtendedLocation + :param system_data: The system data. + :type system_data: + ~azure.mgmt.vmware.v2020_10_01_preview.models.SystemData + :param tags: Gets or sets the Resource tags. + :type tags: dict[str, str] + :ivar name: Gets or sets the name. + :vartype name: str + :ivar id: Gets or sets the Id. + :vartype id: str + :ivar type: Gets or sets the type of the resource. + :vartype type: str + :param kind: Metadata used by portal/tooling/etc to render different UX + experiences for resources of the same type; e.g. ApiApps are a kind of + Microsoft.Web/sites type. If supported, the resource provider must + validate and persist this value. + :type kind: str + """ + + _validation = { + 'uuid': {'readonly': True}, + 'mo_name': {'readonly': True}, + 'custom_resource_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'location': {'required': True}, + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'uuid': {'key': 'properties.uuid', 'type': 'str'}, + 'v_center_id': {'key': 'properties.vCenterId', 'type': 'str'}, + 'mo_ref_id': {'key': 'properties.moRefId', 'type': 'str'}, + 'inventory_item_id': {'key': 'properties.inventoryItemId', 'type': 'str'}, + 'mo_name': {'key': 'properties.moName', 'type': 'str'}, + 'custom_resource_name': {'key': 'properties.customResourceName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, *, location: str, v_center_id: str=None, mo_ref_id: str=None, inventory_item_id: str=None, extended_location=None, system_data=None, tags=None, kind: str=None, **kwargs) -> None: + super(VirtualNetwork, self).__init__(**kwargs) + self.uuid = None + self.v_center_id = v_center_id + self.mo_ref_id = mo_ref_id + self.inventory_item_id = inventory_item_id + self.mo_name = None + self.custom_resource_name = None + self.provisioning_state = None + self.location = location + self.extended_location = extended_location + self.system_data = system_data + self.tags = tags + self.name = None + self.id = None + self.type = None + self.kind = kind diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_scsi_controller.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_scsi_controller.py new file mode 100644 index 00000000000..02eb05acda7 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_scsi_controller.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualSCSIController(Model): + """This data object type contains the properties of a SCSI controller device + attached to a virtual machine that is reported by the controller. + + :param type: Gets or sets the controller type. Possible values include: + 'lsilogic', 'buslogic', 'pvscsi', 'lsilogicsas' + :type type: str or + ~azure.mgmt.vmware.v2020_10_01_preview.models.SCSIControllerType + :param controller_key: Gets or sets the key of the controller. + :type controller_key: int + :param bus_number: Gets or sets the bus number of the controller. + :type bus_number: int + :param scsi_ctlr_unit_number: Gets or sets the SCSI controller unit + number. + :type scsi_ctlr_unit_number: int + :param sharing: Gets or sets the sharing mode. Possible values include: + 'noSharing', 'physicalSharing', 'virtualSharing' + :type sharing: str or + ~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualSCSISharing + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'controller_key': {'key': 'controllerKey', 'type': 'int'}, + 'bus_number': {'key': 'busNumber', 'type': 'int'}, + 'scsi_ctlr_unit_number': {'key': 'scsiCtlrUnitNumber', 'type': 'int'}, + 'sharing': {'key': 'sharing', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualSCSIController, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.controller_key = kwargs.get('controller_key', None) + self.bus_number = kwargs.get('bus_number', None) + self.scsi_ctlr_unit_number = kwargs.get('scsi_ctlr_unit_number', None) + self.sharing = kwargs.get('sharing', None) diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_scsi_controller_py3.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_scsi_controller_py3.py new file mode 100644 index 00000000000..71ca803c7f0 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/models/virtual_scsi_controller_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualSCSIController(Model): + """This data object type contains the properties of a SCSI controller device + attached to a virtual machine that is reported by the controller. + + :param type: Gets or sets the controller type. Possible values include: + 'lsilogic', 'buslogic', 'pvscsi', 'lsilogicsas' + :type type: str or + ~azure.mgmt.vmware.v2020_10_01_preview.models.SCSIControllerType + :param controller_key: Gets or sets the key of the controller. + :type controller_key: int + :param bus_number: Gets or sets the bus number of the controller. + :type bus_number: int + :param scsi_ctlr_unit_number: Gets or sets the SCSI controller unit + number. + :type scsi_ctlr_unit_number: int + :param sharing: Gets or sets the sharing mode. Possible values include: + 'noSharing', 'physicalSharing', 'virtualSharing' + :type sharing: str or + ~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualSCSISharing + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'controller_key': {'key': 'controllerKey', 'type': 'int'}, + 'bus_number': {'key': 'busNumber', 'type': 'int'}, + 'scsi_ctlr_unit_number': {'key': 'scsiCtlrUnitNumber', 'type': 'int'}, + 'sharing': {'key': 'sharing', 'type': 'str'}, + } + + def __init__(self, *, type=None, controller_key: int=None, bus_number: int=None, scsi_ctlr_unit_number: int=None, sharing=None, **kwargs) -> None: + super(VirtualSCSIController, self).__init__(**kwargs) + self.type = type + self.controller_key = controller_key + self.bus_number = bus_number + self.scsi_ctlr_unit_number = scsi_ctlr_unit_number + self.sharing = sharing diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/__init__.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/__init__.py new file mode 100644 index 00000000000..dbe61394bc3 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/__init__.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._resource_pools_operations import ResourcePoolsOperations +from ._vcenters_operations import VCentersOperations +from ._virtual_machines_operations import VirtualMachinesOperations +from ._virtual_machine_templates_operations import VirtualMachineTemplatesOperations +from ._virtual_networks_operations import VirtualNetworksOperations +from ._inventory_items_operations import InventoryItemsOperations +from ._hybrid_identity_metadata_operations import HybridIdentityMetadataOperations +from ._machine_extensions_operations import MachineExtensionsOperations +from ._guest_agent_operations import GuestAgentOperations + +__all__ = [ + 'Operations', + 'ResourcePoolsOperations', + 'VCentersOperations', + 'VirtualMachinesOperations', + 'VirtualMachineTemplatesOperations', + 'VirtualNetworksOperations', + 'InventoryItemsOperations', + 'HybridIdentityMetadataOperations', + 'MachineExtensionsOperations', + 'GuestAgentOperations', +] diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_guest_agent_operations.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_guest_agent_operations.py new file mode 100644 index 00000000000..fd8d819c93c --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_guest_agent_operations.py @@ -0,0 +1,455 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class GuestAgentOperations(object): + """GuestAgentOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_arc_vmware_management_service_api.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_initial( + self, + resource_group_name, # type: str + virtual_machine_name, # type: str + name, # type: str + body=None, # type: Optional["_models.GuestAgent"] + **kwargs # type: Any + ): + # type: (...) -> "_models.GuestAgent" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestAgent"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'GuestAgent') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('GuestAgent', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('GuestAgent', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/guestAgents/{name}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + virtual_machine_name, # type: str + name, # type: str + body=None, # type: Optional["_models.GuestAgent"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.GuestAgent"] + """Implements GuestAgent PUT method. + + Create Or Update GuestAgent. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the vm. + :type virtual_machine_name: str + :param name: Name of the guestAgents. + :type name: str + :param body: Request payload. + :type body: ~azure_arc_vmware_management_service_api.models.GuestAgent + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either GuestAgent or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure_arc_vmware_management_service_api.models.GuestAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestAgent"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + virtual_machine_name=virtual_machine_name, + name=name, + body=body, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('GuestAgent', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/guestAgents/{name}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + virtual_machine_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.GuestAgent" + """Gets GuestAgent. + + Implements GuestAgent GET method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the vm. + :type virtual_machine_name: str + :param name: Name of the GuestAgent. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GuestAgent, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.GuestAgent + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestAgent"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GuestAgent', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/guestAgents/{name}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + virtual_machine_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/guestAgents/{name}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + virtual_machine_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an GuestAgent. + + Implements GuestAgent DELETE method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the vm. + :type virtual_machine_name: str + :param name: Name of the GuestAgent. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + virtual_machine_name=virtual_machine_name, + name=name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/guestAgents/{name}'} # type: ignore + + def list_by_vm( + self, + resource_group_name, # type: str + virtual_machine_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.GuestAgentList"] + """Implements GET GuestAgent in a vm. + + Returns the list of GuestAgent of the given vm. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the vm. + :type virtual_machine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GuestAgentList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure_arc_vmware_management_service_api.models.GuestAgentList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GuestAgentList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_vm.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('GuestAgentList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_vm.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/guestAgents'} # type: ignore diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_hybrid_identity_metadata_operations.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_hybrid_identity_metadata_operations.py new file mode 100644 index 00000000000..11f23b92088 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_hybrid_identity_metadata_operations.py @@ -0,0 +1,330 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class HybridIdentityMetadataOperations(object): + """HybridIdentityMetadataOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_arc_vmware_management_service_api.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def create( + self, + resource_group_name, # type: str + virtual_machine_name, # type: str + metadata_name, # type: str + body=None, # type: Optional["_models.HybridIdentityMetadata"] + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridIdentityMetadata" + """Implements HybridIdentityMetadata PUT method. + + Create Or Update HybridIdentityMetadata. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the vm. + :type virtual_machine_name: str + :param metadata_name: Name of the hybridIdentityMetadata. + :type metadata_name: str + :param body: Request payload. + :type body: ~azure_arc_vmware_management_service_api.models.HybridIdentityMetadata + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridIdentityMetadata, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.HybridIdentityMetadata + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridIdentityMetadata"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + 'metadataName': self._serialize.url("metadata_name", metadata_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'HybridIdentityMetadata') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridIdentityMetadata', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/hybridIdentityMetadata/{metadataName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + virtual_machine_name, # type: str + metadata_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridIdentityMetadata" + """Gets HybridIdentityMetadata. + + Implements HybridIdentityMetadata GET method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the vm. + :type virtual_machine_name: str + :param metadata_name: Name of the HybridIdentityMetadata. + :type metadata_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridIdentityMetadata, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.HybridIdentityMetadata + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridIdentityMetadata"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + 'metadataName': self._serialize.url("metadata_name", metadata_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridIdentityMetadata', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/hybridIdentityMetadata/{metadataName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + virtual_machine_name, # type: str + metadata_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes an HybridIdentityMetadata. + + Implements HybridIdentityMetadata DELETE method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the vm. + :type virtual_machine_name: str + :param metadata_name: Name of the HybridIdentityMetadata. + :type metadata_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + 'metadataName': self._serialize.url("metadata_name", metadata_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/hybridIdentityMetadata/{metadataName}'} # type: ignore + + def list_by_vm( + self, + resource_group_name, # type: str + virtual_machine_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.HybridIdentityMetadataList"] + """Implements GET HybridIdentityMetadata in a vm. + + Returns the list of HybridIdentityMetadata of the given vm. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the vm. + :type virtual_machine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either HybridIdentityMetadataList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure_arc_vmware_management_service_api.models.HybridIdentityMetadataList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridIdentityMetadataList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_vm.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('HybridIdentityMetadataList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_vm.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/hybridIdentityMetadata'} # type: ignore diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_inventory_items_operations.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_inventory_items_operations.py new file mode 100644 index 00000000000..47a559503ba --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_inventory_items_operations.py @@ -0,0 +1,330 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class InventoryItemsOperations(object): + """InventoryItemsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_arc_vmware_management_service_api.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def create( + self, + resource_group_name, # type: str + vcenter_name, # type: str + inventory_item_name, # type: str + body=None, # type: Optional["_models.InventoryItem"] + **kwargs # type: Any + ): + # type: (...) -> "_models.InventoryItem" + """Implements InventoryItem PUT method. + + Create Or Update InventoryItem. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param vcenter_name: Name of the vCenter. + :type vcenter_name: str + :param inventory_item_name: Name of the inventoryItem. + :type inventory_item_name: str + :param body: Request payload. + :type body: ~azure_arc_vmware_management_service_api.models.InventoryItem + :keyword callable cls: A custom type or function that will be passed the direct response + :return: InventoryItem, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.InventoryItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.InventoryItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), + 'inventoryItemName': self._serialize.url("inventory_item_name", inventory_item_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'InventoryItem') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('InventoryItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}/inventoryItems/{inventoryItemName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + vcenter_name, # type: str + inventory_item_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.InventoryItem" + """Gets InventoryItem. + + Implements InventoryItem GET method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param vcenter_name: Name of the vCenter. + :type vcenter_name: str + :param inventory_item_name: Name of the inventoryItem. + :type inventory_item_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: InventoryItem, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.InventoryItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.InventoryItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), + 'inventoryItemName': self._serialize.url("inventory_item_name", inventory_item_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('InventoryItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}/inventoryItems/{inventoryItemName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + vcenter_name, # type: str + inventory_item_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes an inventoryItem. + + Implements inventoryItem DELETE method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param vcenter_name: Name of the vCenter. + :type vcenter_name: str + :param inventory_item_name: Name of the inventoryItem. + :type inventory_item_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), + 'inventoryItemName': self._serialize.url("inventory_item_name", inventory_item_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}/inventoryItems/{inventoryItemName}'} # type: ignore + + def list_by_v_center( + self, + resource_group_name, # type: str + vcenter_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.InventoryItemsList"] + """Implements GET inventoryItems in a vCenter. + + Returns the list of inventoryItems of the given vCenter. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param vcenter_name: Name of the vCenter. + :type vcenter_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either InventoryItemsList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure_arc_vmware_management_service_api.models.InventoryItemsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.InventoryItemsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_v_center.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('InventoryItemsList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_v_center.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}/inventoryItems'} # type: ignore diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_machine_extensions_operations.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_machine_extensions_operations.py new file mode 100644 index 00000000000..6810f01e93c --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_machine_extensions_operations.py @@ -0,0 +1,583 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class MachineExtensionsOperations(object): + """MachineExtensionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_arc_vmware_management_service_api.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_or_update_initial( + self, + resource_group_name, # type: str + name, # type: str + extension_name, # type: str + extension_parameters, # type: "_models.MachineExtension" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.MachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MachineExtension"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(extension_parameters, 'MachineExtension') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/extensions/{extensionName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + name, # type: str + extension_name, # type: str + extension_parameters, # type: "_models.MachineExtension" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.MachineExtension"] + """The operation to create or update the extension. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param name: The name of the machine where the extension should be created or updated. + :type name: str + :param extension_name: The name of the machine extension. + :type extension_name: str + :param extension_parameters: Parameters supplied to the Create Machine Extension operation. + :type extension_parameters: ~azure_arc_vmware_management_service_api.models.MachineExtension + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either MachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure_arc_vmware_management_service_api.models.MachineExtension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MachineExtension"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + name=name, + extension_name=extension_name, + extension_parameters=extension_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/extensions/{extensionName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + name, # type: str + extension_name, # type: str + extension_parameters, # type: "_models.MachineExtensionUpdate" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.MachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MachineExtension"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(extension_parameters, 'MachineExtensionUpdate') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/extensions/{extensionName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + name, # type: str + extension_name, # type: str + extension_parameters, # type: "_models.MachineExtensionUpdate" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.MachineExtension"] + """The operation to update the extension. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param name: The name of the machine where the extension should be created or updated. + :type name: str + :param extension_name: The name of the machine extension. + :type extension_name: str + :param extension_parameters: Parameters supplied to the Create Machine Extension operation. + :type extension_parameters: ~azure_arc_vmware_management_service_api.models.MachineExtensionUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either MachineExtension or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure_arc_vmware_management_service_api.models.MachineExtension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MachineExtension"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + name=name, + extension_name=extension_name, + extension_parameters=extension_parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/extensions/{extensionName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + name, # type: str + extension_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/extensions/{extensionName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + name, # type: str + extension_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """The operation to delete the extension. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param name: The name of the machine where the extension should be deleted. + :type name: str + :param extension_name: The name of the machine extension. + :type extension_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + name=name, + extension_name=extension_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/extensions/{extensionName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + name, # type: str + extension_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MachineExtension" + """The operation to get the extension. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param name: The name of the machine containing the extension. + :type name: str + :param extension_name: The name of the machine extension. + :type extension_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MachineExtension, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.MachineExtension + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MachineExtension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MachineExtension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/extensions/{extensionName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.MachineExtensionsListResult"] + """The operation to get all extensions of a non-Azure machine. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param name: The name of the machine containing the extension. + :type name: str + :param expand: The expand expression to apply on the operation. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MachineExtensionsListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure_arc_vmware_management_service_api.models.MachineExtensionsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MachineExtensionsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('MachineExtensionsListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{name}/extensions'} # type: ignore diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_operations.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_operations.py new file mode 100644 index 00000000000..05c41412ca7 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_arc_vmware_management_service_api.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.OperationsList"] + """Returns list of all operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationsList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure_arc_vmware_management_service_api.models.OperationsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationsList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.ConnectedVMwarevSphere/operations'} # type: ignore diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_resource_pools_operations.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_resource_pools_operations.py new file mode 100644 index 00000000000..c3b1e0a4bac --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_resource_pools_operations.py @@ -0,0 +1,583 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ResourcePoolsOperations(object): + """ResourcePoolsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_arc_vmware_management_service_api.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_initial( + self, + resource_group_name, # type: str + resource_pool_name, # type: str + body=None, # type: Optional["_models.ResourcePool"] + **kwargs # type: Any + ): + # type: (...) -> "_models.ResourcePool" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourcePool"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourcePoolName': self._serialize.url("resource_pool_name", resource_pool_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'ResourcePool') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ResourcePool', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ResourcePool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + resource_pool_name, # type: str + body=None, # type: Optional["_models.ResourcePool"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ResourcePool"] + """Implements resourcePool PUT method. + + Create Or Update resourcePool. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param resource_pool_name: Name of the resourcePool. + :type resource_pool_name: str + :param body: Request payload. + :type body: ~azure_arc_vmware_management_service_api.models.ResourcePool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ResourcePool or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure_arc_vmware_management_service_api.models.ResourcePool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourcePool"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + resource_pool_name=resource_pool_name, + body=body, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ResourcePool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourcePoolName': self._serialize.url("resource_pool_name", resource_pool_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + resource_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ResourcePool" + """Gets a resourcePool. + + Implements resourcePool GET method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param resource_pool_name: Name of the resourcePool. + :type resource_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourcePool, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.ResourcePool + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourcePool"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourcePoolName': self._serialize.url("resource_pool_name", resource_pool_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourcePool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + resource_pool_name, # type: str + body=None, # type: Optional["_models.ResourcePatch"] + **kwargs # type: Any + ): + # type: (...) -> "_models.ResourcePool" + """Updates a resourcePool. + + API to update certain properties of the resourcePool resource. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param resource_pool_name: Name of the resourcePool. + :type resource_pool_name: str + :param body: Resource properties to update. + :type body: ~azure_arc_vmware_management_service_api.models.ResourcePatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourcePool, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.ResourcePool + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourcePool"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourcePoolName': self._serialize.url("resource_pool_name", resource_pool_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'ResourcePatch') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourcePool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + resource_pool_name, # type: str + force=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourcePoolName': self._serialize.url("resource_pool_name", resource_pool_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if force is not None: + query_parameters['force'] = self._serialize.query("force", force, 'bool') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + resource_pool_name, # type: str + force=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an resourcePool. + + Implements resourcePool DELETE method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param resource_pool_name: Name of the resourcePool. + :type resource_pool_name: str + :param force: Whether force delete was specified. + :type force: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_pool_name=resource_pool_name, + force=force, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourcePoolName': self._serialize.url("resource_pool_name", resource_pool_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName}'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourcePoolsList"] + """Implements GET resourcePools in a subscription. + + List of resourcePools in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourcePoolsList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure_arc_vmware_management_service_api.models.ResourcePoolsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourcePoolsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourcePoolsList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourcePoolsList"] + """Implements GET resourcePools in a resource group. + + List of resourcePools in a resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourcePoolsList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure_arc_vmware_management_service_api.models.ResourcePoolsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourcePoolsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourcePoolsList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools'} # type: ignore diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_vcenters_operations.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_vcenters_operations.py new file mode 100644 index 00000000000..3f859d4149b --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_vcenters_operations.py @@ -0,0 +1,583 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VCentersOperations(object): + """VCentersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_arc_vmware_management_service_api.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_initial( + self, + resource_group_name, # type: str + vcenter_name, # type: str + body=None, # type: Optional["_models.VCenter"] + **kwargs # type: Any + ): + # type: (...) -> "_models.VCenter" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VCenter"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'VCenter') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VCenter', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VCenter', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + vcenter_name, # type: str + body=None, # type: Optional["_models.VCenter"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VCenter"] + """Implements vCenter PUT method. + + Create Or Update vCenter. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param vcenter_name: Name of the vCenter. + :type vcenter_name: str + :param body: Request payload. + :type body: ~azure_arc_vmware_management_service_api.models.VCenter + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VCenter or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure_arc_vmware_management_service_api.models.VCenter] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VCenter"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + vcenter_name=vcenter_name, + body=body, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VCenter', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + vcenter_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VCenter" + """Gets a vCenter. + + Implements vCenter GET method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param vcenter_name: Name of the vCenter. + :type vcenter_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VCenter, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.VCenter + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VCenter"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VCenter', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + vcenter_name, # type: str + body=None, # type: Optional["_models.ResourcePatch"] + **kwargs # type: Any + ): + # type: (...) -> "_models.VCenter" + """Updates a vCenter. + + API to update certain properties of the vCenter resource. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param vcenter_name: Name of the vCenter. + :type vcenter_name: str + :param body: Resource properties to update. + :type body: ~azure_arc_vmware_management_service_api.models.ResourcePatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VCenter, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.VCenter + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VCenter"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'ResourcePatch') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VCenter', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + vcenter_name, # type: str + force=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if force is not None: + query_parameters['force'] = self._serialize.query("force", force, 'bool') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + vcenter_name, # type: str + force=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an vCenter. + + Implements vCenter DELETE method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param vcenter_name: Name of the vCenter. + :type vcenter_name: str + :param force: Whether force delete was specified. + :type force: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + vcenter_name=vcenter_name, + force=force, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.VCentersList"] + """Implements GET vCenters in a subscription. + + List of vCenters in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VCentersList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure_arc_vmware_management_service_api.models.VCentersList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VCentersList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('VCentersList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedVMwarevSphere/vcenters'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.VCentersList"] + """Implements GET vCenters in a resource group. + + List of vCenters in a resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VCentersList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure_arc_vmware_management_service_api.models.VCentersList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VCentersList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('VCentersList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters'} # type: ignore diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_virtual_machine_templates_operations.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_virtual_machine_templates_operations.py new file mode 100644 index 00000000000..a5fcfb44aa5 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_virtual_machine_templates_operations.py @@ -0,0 +1,583 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VirtualMachineTemplatesOperations(object): + """VirtualMachineTemplatesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_arc_vmware_management_service_api.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_initial( + self, + resource_group_name, # type: str + virtual_machine_template_name, # type: str + body=None, # type: Optional["_models.VirtualMachineTemplate"] + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualMachineTemplate" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineTemplate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineTemplateName': self._serialize.url("virtual_machine_template_name", virtual_machine_template_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'VirtualMachineTemplate') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualMachineTemplate', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachineTemplate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + virtual_machine_template_name, # type: str + body=None, # type: Optional["_models.VirtualMachineTemplate"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualMachineTemplate"] + """Implements virtual machine template PUT method. + + Create Or Update virtual machine template. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_template_name: Name of the virtual machine template resource. + :type virtual_machine_template_name: str + :param body: Request payload. + :type body: ~azure_arc_vmware_management_service_api.models.VirtualMachineTemplate + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VirtualMachineTemplate or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure_arc_vmware_management_service_api.models.VirtualMachineTemplate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineTemplate"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + virtual_machine_template_name=virtual_machine_template_name, + body=body, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualMachineTemplate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineTemplateName': self._serialize.url("virtual_machine_template_name", virtual_machine_template_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + virtual_machine_template_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualMachineTemplate" + """Gets a virtual machine template. + + Implements virtual machine template GET method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_template_name: Name of the virtual machine template resource. + :type virtual_machine_template_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachineTemplate, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.VirtualMachineTemplate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineTemplate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineTemplateName': self._serialize.url("virtual_machine_template_name", virtual_machine_template_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualMachineTemplate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + virtual_machine_template_name, # type: str + body=None, # type: Optional["_models.ResourcePatch"] + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualMachineTemplate" + """Updates a virtual machine template. + + API to update certain properties of the virtual machine template resource. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_template_name: Name of the virtual machine template resource. + :type virtual_machine_template_name: str + :param body: Resource properties to update. + :type body: ~azure_arc_vmware_management_service_api.models.ResourcePatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachineTemplate, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.VirtualMachineTemplate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineTemplate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineTemplateName': self._serialize.url("virtual_machine_template_name", virtual_machine_template_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'ResourcePatch') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualMachineTemplate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + virtual_machine_template_name, # type: str + force=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineTemplateName': self._serialize.url("virtual_machine_template_name", virtual_machine_template_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if force is not None: + query_parameters['force'] = self._serialize.query("force", force, 'bool') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + virtual_machine_template_name, # type: str + force=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an virtual machine template. + + Implements virtual machine template DELETE method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_template_name: Name of the virtual machine template resource. + :type virtual_machine_template_name: str + :param force: Whether force delete was specified. + :type force: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + virtual_machine_template_name=virtual_machine_template_name, + force=force, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineTemplateName': self._serialize.url("virtual_machine_template_name", virtual_machine_template_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName}'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.VirtualMachineTemplatesList"] + """Implements GET virtualMachineTemplates in a subscription. + + List of virtualMachineTemplates in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualMachineTemplatesList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure_arc_vmware_management_service_api.models.VirtualMachineTemplatesList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineTemplatesList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualMachineTemplatesList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.VirtualMachineTemplatesList"] + """Implements GET virtualMachineTemplates in a resource group. + + List of virtualMachineTemplates in a resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualMachineTemplatesList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure_arc_vmware_management_service_api.models.VirtualMachineTemplatesList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineTemplatesList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualMachineTemplatesList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates'} # type: ignore diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_virtual_machines_operations.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_virtual_machines_operations.py new file mode 100644 index 00000000000..8099a83bf0e --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_virtual_machines_operations.py @@ -0,0 +1,998 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VirtualMachinesOperations(object): + """VirtualMachinesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_arc_vmware_management_service_api.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_initial( + self, + resource_group_name, # type: str + virtual_machine_name, # type: str + body=None, # type: Optional["_models.VirtualMachine"] + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualMachine" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'VirtualMachine') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualMachine', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachine', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + virtual_machine_name, # type: str + body=None, # type: Optional["_models.VirtualMachine"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualMachine"] + """Implements virtual machine PUT method. + + Create Or Update virtual machine. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the virtual machine resource. + :type virtual_machine_name: str + :param body: Request payload. + :type body: ~azure_arc_vmware_management_service_api.models.VirtualMachine + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VirtualMachine or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure_arc_vmware_management_service_api.models.VirtualMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + virtual_machine_name=virtual_machine_name, + body=body, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualMachine', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + virtual_machine_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualMachine" + """Gets a virtual machine. + + Implements virtual machine GET method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the virtual machine resource. + :type virtual_machine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualMachine, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.VirtualMachine + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualMachine', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + virtual_machine_name, # type: str + body=None, # type: Optional["_models.VirtualMachineUpdate"] + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualMachine" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'VirtualMachineUpdate') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualMachine', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachine', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + virtual_machine_name, # type: str + body=None, # type: Optional["_models.VirtualMachineUpdate"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualMachine"] + """Updates a virtual machine. + + API to update certain properties of the virtual machine resource. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the virtual machine resource. + :type virtual_machine_name: str + :param body: Resource properties to update. + :type body: ~azure_arc_vmware_management_service_api.models.VirtualMachineUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VirtualMachine or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure_arc_vmware_management_service_api.models.VirtualMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + virtual_machine_name=virtual_machine_name, + body=body, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualMachine', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + virtual_machine_name, # type: str + force=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if force is not None: + query_parameters['force'] = self._serialize.query("force", force, 'bool') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + virtual_machine_name, # type: str + force=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an virtual machine. + + Implements virtual machine DELETE method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the virtual machine resource. + :type virtual_machine_name: str + :param force: Whether force delete was specified. + :type force: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + virtual_machine_name=virtual_machine_name, + force=force, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}'} # type: ignore + + def _stop_initial( + self, + resource_group_name, # type: str + virtual_machine_name, # type: str + body=None, # type: Optional["_models.StopVirtualMachineOptions"] + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._stop_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'StopVirtualMachineOptions') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/stop'} # type: ignore + + def begin_stop( + self, + resource_group_name, # type: str + virtual_machine_name, # type: str + body=None, # type: Optional["_models.StopVirtualMachineOptions"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Implements the operation to stop a virtual machine. + + Stop virtual machine. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the virtual machine resource. + :type virtual_machine_name: str + :param body: Virtualmachine stop action payload. + :type body: ~azure_arc_vmware_management_service_api.models.StopVirtualMachineOptions + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._stop_initial( + resource_group_name=resource_group_name, + virtual_machine_name=virtual_machine_name, + body=body, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/stop'} # type: ignore + + def _start_initial( + self, + resource_group_name, # type: str + virtual_machine_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self._start_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/start'} # type: ignore + + def begin_start( + self, + resource_group_name, # type: str + virtual_machine_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Implements the operation to start a virtual machine. + + Start virtual machine. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the virtual machine resource. + :type virtual_machine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._start_initial( + resource_group_name=resource_group_name, + virtual_machine_name=virtual_machine_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/start'} # type: ignore + + def _restart_initial( + self, + resource_group_name, # type: str + virtual_machine_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self._restart_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restart_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/restart'} # type: ignore + + def begin_restart( + self, + resource_group_name, # type: str + virtual_machine_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Implements the operation to restart a virtual machine. + + Restart virtual machine. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the virtual machine resource. + :type virtual_machine_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._restart_initial( + resource_group_name=resource_group_name, + virtual_machine_name=virtual_machine_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/restart'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.VirtualMachinesList"] + """Implements GET virtualMachines in a subscription. + + List of virtualMachines in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualMachinesList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure_arc_vmware_management_service_api.models.VirtualMachinesList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachinesList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualMachinesList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.VirtualMachinesList"] + """Implements GET virtualMachines in a resource group. + + List of virtualMachines in a resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualMachinesList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure_arc_vmware_management_service_api.models.VirtualMachinesList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachinesList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualMachinesList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines'} # type: ignore diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_virtual_networks_operations.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_virtual_networks_operations.py new file mode 100644 index 00000000000..d72e1811a74 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/_virtual_networks_operations.py @@ -0,0 +1,583 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VirtualNetworksOperations(object): + """VirtualNetworksOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_arc_vmware_management_service_api.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_initial( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + body=None, # type: Optional["_models.VirtualNetwork"] + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualNetwork" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'VirtualNetwork') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetwork', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + body=None, # type: Optional["_models.VirtualNetwork"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualNetwork"] + """Implements virtual network PUT method. + + Create Or Update virtual network. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_network_name: Name of the virtual network resource. + :type virtual_network_name: str + :param body: Request payload. + :type body: ~azure_arc_vmware_management_service_api.models.VirtualNetwork + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either VirtualNetwork or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure_arc_vmware_management_service_api.models.VirtualNetwork] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + body=body, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualNetwork" + """Gets a virtual network. + + Implements virtual network GET method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_network_name: Name of the virtual network resource. + :type virtual_network_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualNetwork, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.VirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + body=None, # type: Optional["_models.ResourcePatch"] + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualNetwork" + """Updates a virtual network. + + API to update certain properties of the virtual network resource. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_network_name: Name of the virtual network resource. + :type virtual_network_name: str + :param body: Resource properties to update. + :type body: ~azure_arc_vmware_management_service_api.models.ResourcePatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VirtualNetwork, or the result of cls(response) + :rtype: ~azure_arc_vmware_management_service_api.models.VirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if body is not None: + body_content = self._serialize.body(body, 'ResourcePatch') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + force=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if force is not None: + query_parameters['force'] = self._serialize.query("force", force, 'bool') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + virtual_network_name, # type: str + force=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an virtual network. + + Implements virtual network DELETE method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_network_name: Name of the virtual network resource. + :type virtual_network_name: str + :param force: Whether force delete was specified. + :type force: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + force=force, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName}'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.VirtualNetworksList"] + """Implements GET virtualNetworks in a subscription. + + List of virtualNetworks in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualNetworksList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure_arc_vmware_management_service_api.models.VirtualNetworksList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworksList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualNetworksList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.VirtualNetworksList"] + """Implements GET virtualNetworks in a resource group. + + List of virtualNetworks in a resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either VirtualNetworksList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure_arc_vmware_management_service_api.models.VirtualNetworksList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworksList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('VirtualNetworksList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks'} # type: ignore diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/inventory_items_operations.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/inventory_items_operations.py new file mode 100644 index 00000000000..842d0385784 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/inventory_items_operations.py @@ -0,0 +1,307 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class InventoryItemsOperations(object): + """InventoryItemsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2020-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-10-01-preview" + + self.config = config + + def create( + self, resource_group_name, vcenter_name, inventory_item_name, body=None, custom_headers=None, raw=False, **operation_config): + """Implements InventoryItem PUT method. + + Create Or Update InventoryItem. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param vcenter_name: Name of the vCenter. + :type vcenter_name: str + :param inventory_item_name: Name of the inventoryItem. + :type inventory_item_name: str + :param body: Request payload. + :type body: + ~azure.mgmt.vmware.v2020_10_01_preview.models.InventoryItem + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: InventoryItem or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.vmware.v2020_10_01_preview.models.InventoryItem or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), + 'inventoryItemName': self._serialize.url("inventory_item_name", inventory_item_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'InventoryItem') + else: + body_content = None + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('InventoryItem', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}/inventoryItems/{inventoryItemName}'} + + def get( + self, resource_group_name, vcenter_name, inventory_item_name, custom_headers=None, raw=False, **operation_config): + """Gets InventoryItem. + + Implements InventoryItem GET method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param vcenter_name: Name of the vCenter. + :type vcenter_name: str + :param inventory_item_name: Name of the inventoryItem. + :type inventory_item_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: InventoryItem or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.vmware.v2020_10_01_preview.models.InventoryItem or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), + 'inventoryItemName': self._serialize.url("inventory_item_name", inventory_item_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('InventoryItem', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}/inventoryItems/{inventoryItemName}'} + + def delete( + self, resource_group_name, vcenter_name, inventory_item_name, custom_headers=None, raw=False, **operation_config): + """Deletes an inventoryItem. + + Implements inventoryItem DELETE method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param vcenter_name: Name of the vCenter. + :type vcenter_name: str + :param inventory_item_name: Name of the inventoryItem. + :type inventory_item_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), + 'inventoryItemName': self._serialize.url("inventory_item_name", inventory_item_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}/inventoryItems/{inventoryItemName}'} + + def list_by_vcenter( + self, resource_group_name, vcenter_name, custom_headers=None, raw=False, **operation_config): + """Implements GET inventoryItems in a vCenter. + + Returns the list of inventoryItems of the given vCenter. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param vcenter_name: Name of the vCenter. + :type vcenter_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of InventoryItem + :rtype: + ~azure.mgmt.vmware.v2020_10_01_preview.models.InventoryItemPaged[~azure.mgmt.vmware.v2020_10_01_preview.models.InventoryItem] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_vcenter.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.InventoryItemPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.InventoryItemPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_vcenter.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}/inventoryItems'} diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/operations.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/operations.py new file mode 100644 index 00000000000..ed72f2560d7 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/operations.py @@ -0,0 +1,96 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2020-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-10-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Returns list of all operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.vmware.v2020_10_01_preview.models.OperationPaged[~azure.mgmt.vmware.v2020_10_01_preview.models.Operation] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.ConnectedVMwarevSphere/operations'} diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/resource_pools_operations.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/resource_pools_operations.py new file mode 100644 index 00000000000..6235e24ce1c --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/resource_pools_operations.py @@ -0,0 +1,518 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ResourcePoolsOperations(object): + """ResourcePoolsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2020-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-10-01-preview" + + self.config = config + + + def _create_initial( + self, resource_group_name, resource_pool_name, body=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourcePoolName': self._serialize.url("resource_pool_name", resource_pool_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'ResourcePool') + else: + body_content = None + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('ResourcePool', response) + header_dict = { + 'Azure-AsyncOperation': 'str', + } + if response.status_code == 201: + deserialized = self._deserialize('ResourcePool', response) + header_dict = { + 'Azure-AsyncOperation': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, resource_pool_name, body=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Implements resourcePool PUT method. + + Create Or Update resourcePool. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param resource_pool_name: Name of the resourcePool. + :type resource_pool_name: str + :param body: Request payload. + :type body: ~azure.mgmt.vmware.v2020_10_01_preview.models.ResourcePool + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ResourcePool or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.vmware.v2020_10_01_preview.models.ResourcePool] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.vmware.v2020_10_01_preview.models.ResourcePool]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + resource_pool_name=resource_pool_name, + body=body, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Azure-AsyncOperation': 'str', + } + deserialized = self._deserialize('ResourcePool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName}'} + + def get( + self, resource_group_name, resource_pool_name, custom_headers=None, raw=False, **operation_config): + """Gets a resourcePool. + + Implements resourcePool GET method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param resource_pool_name: Name of the resourcePool. + :type resource_pool_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ResourcePool or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.vmware.v2020_10_01_preview.models.ResourcePool or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourcePoolName': self._serialize.url("resource_pool_name", resource_pool_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ResourcePool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName}'} + + def update( + self, resource_group_name, resource_pool_name, body=None, custom_headers=None, raw=False, **operation_config): + """Updates a resourcePool. + + API to update certain properties of the resourcePool resource. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param resource_pool_name: Name of the resourcePool. + :type resource_pool_name: str + :param body: Resource properties to update. + :type body: + ~azure.mgmt.vmware.v2020_10_01_preview.models.ResourcePatch + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ResourcePool or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.vmware.v2020_10_01_preview.models.ResourcePool or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourcePoolName': self._serialize.url("resource_pool_name", resource_pool_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'ResourcePatch') + else: + body_content = None + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ResourcePool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName}'} + + + def _delete_initial( + self, resource_group_name, resource_pool_name, force=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourcePoolName': self._serialize.url("resource_pool_name", resource_pool_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if force is not None: + query_parameters['force'] = self._serialize.query("force", force, 'bool') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + header_dict = { + 'Azure-AsyncOperation': 'str', + } + client_raw_response.add_headers(header_dict) + return client_raw_response + + def delete( + self, resource_group_name, resource_pool_name, force=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an resourcePool. + + Implements resourcePool DELETE method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param resource_pool_name: Name of the resourcePool. + :type resource_pool_name: str + :param force: Whether force delete was specified. + :type force: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_pool_name=resource_pool_name, + force=force, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'Azure-AsyncOperation': 'str', + }) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/{resourcePoolName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Implements GET resourcePools in a subscription. + + List of resourcePools in a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ResourcePool + :rtype: + ~azure.mgmt.vmware.v2020_10_01_preview.models.ResourcePoolPaged[~azure.mgmt.vmware.v2020_10_01_preview.models.ResourcePool] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ResourcePoolPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ResourcePoolPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Implements GET resourcePools in a resource group. + + List of resourcePools in a resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ResourcePool + :rtype: + ~azure.mgmt.vmware.v2020_10_01_preview.models.ResourcePoolPaged[~azure.mgmt.vmware.v2020_10_01_preview.models.ResourcePool] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ResourcePoolPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ResourcePoolPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/resourcePools'} diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/vcenters_operations.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/vcenters_operations.py new file mode 100644 index 00000000000..13cea61aa9e --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/vcenters_operations.py @@ -0,0 +1,518 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class VCentersOperations(object): + """VCentersOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2020-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-10-01-preview" + + self.config = config + + + def _create_initial( + self, resource_group_name, vcenter_name, body=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'VCenter') + else: + body_content = None + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('VCenter', response) + header_dict = { + 'Azure-AsyncOperation': 'str', + } + if response.status_code == 201: + deserialized = self._deserialize('VCenter', response) + header_dict = { + 'Azure-AsyncOperation': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, vcenter_name, body=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Implements vCenter PUT method. + + Create Or Update vCenter. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param vcenter_name: Name of the vCenter. + :type vcenter_name: str + :param body: Request payload. + :type body: ~azure.mgmt.vmware.v2020_10_01_preview.models.VCenter + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VCenter or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.vmware.v2020_10_01_preview.models.VCenter] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.vmware.v2020_10_01_preview.models.VCenter]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + vcenter_name=vcenter_name, + body=body, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Azure-AsyncOperation': 'str', + } + deserialized = self._deserialize('VCenter', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}'} + + def get( + self, resource_group_name, vcenter_name, custom_headers=None, raw=False, **operation_config): + """Gets a vCenter. + + Implements vCenter GET method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param vcenter_name: Name of the vCenter. + :type vcenter_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: VCenter or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.vmware.v2020_10_01_preview.models.VCenter or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('VCenter', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}'} + + def update( + self, resource_group_name, vcenter_name, body=None, custom_headers=None, raw=False, **operation_config): + """Updates a vCenter. + + API to update certain properties of the vCenter resource. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param vcenter_name: Name of the vCenter. + :type vcenter_name: str + :param body: Resource properties to update. + :type body: + ~azure.mgmt.vmware.v2020_10_01_preview.models.ResourcePatch + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: VCenter or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.vmware.v2020_10_01_preview.models.VCenter or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'ResourcePatch') + else: + body_content = None + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('VCenter', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}'} + + + def _delete_initial( + self, resource_group_name, vcenter_name, force=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if force is not None: + query_parameters['force'] = self._serialize.query("force", force, 'bool') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + header_dict = { + 'Azure-AsyncOperation': 'str', + } + client_raw_response.add_headers(header_dict) + return client_raw_response + + def delete( + self, resource_group_name, vcenter_name, force=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an vCenter. + + Implements vCenter DELETE method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param vcenter_name: Name of the vCenter. + :type vcenter_name: str + :param force: Whether force delete was specified. + :type force: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + vcenter_name=vcenter_name, + force=force, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'Azure-AsyncOperation': 'str', + }) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters/{vcenterName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Implements GET vCenters in a subscription. + + List of vCenters in a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of VCenter + :rtype: + ~azure.mgmt.vmware.v2020_10_01_preview.models.VCenterPaged[~azure.mgmt.vmware.v2020_10_01_preview.models.VCenter] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.VCenterPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.VCenterPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedVMwarevSphere/vcenters'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Implements GET vCenters in a resource group. + + List of vCenters in a resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of VCenter + :rtype: + ~azure.mgmt.vmware.v2020_10_01_preview.models.VCenterPaged[~azure.mgmt.vmware.v2020_10_01_preview.models.VCenter] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.VCenterPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.VCenterPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/vcenters'} diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/virtual_machine_templates_operations.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/virtual_machine_templates_operations.py new file mode 100644 index 00000000000..7d651a14cd6 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/virtual_machine_templates_operations.py @@ -0,0 +1,526 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class VirtualMachineTemplatesOperations(object): + """VirtualMachineTemplatesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2020-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-10-01-preview" + + self.config = config + + + def _create_initial( + self, resource_group_name, virtual_machine_template_name, body=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineTemplateName': self._serialize.url("virtual_machine_template_name", virtual_machine_template_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'VirtualMachineTemplate') + else: + body_content = None + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('VirtualMachineTemplate', response) + header_dict = { + 'Azure-AsyncOperation': 'str', + } + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachineTemplate', response) + header_dict = { + 'Azure-AsyncOperation': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, virtual_machine_template_name, body=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Implements virtual machine template PUT method. + + Create Or Update virtual machine template. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_template_name: Name of the virtual machine + template resource. + :type virtual_machine_template_name: str + :param body: Request payload. + :type body: + ~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualMachineTemplate + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualMachineTemplate + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualMachineTemplate] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualMachineTemplate]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + virtual_machine_template_name=virtual_machine_template_name, + body=body, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Azure-AsyncOperation': 'str', + } + deserialized = self._deserialize('VirtualMachineTemplate', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName}'} + + def get( + self, resource_group_name, virtual_machine_template_name, custom_headers=None, raw=False, **operation_config): + """Gets a virtual machine template. + + Implements virtual machine template GET method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_template_name: Name of the virtual machine + template resource. + :type virtual_machine_template_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: VirtualMachineTemplate or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualMachineTemplate + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineTemplateName': self._serialize.url("virtual_machine_template_name", virtual_machine_template_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('VirtualMachineTemplate', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName}'} + + def update( + self, resource_group_name, virtual_machine_template_name, body=None, custom_headers=None, raw=False, **operation_config): + """Updates a virtual machine template. + + API to update certain properties of the virtual machine template + resource. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_template_name: Name of the virtual machine + template resource. + :type virtual_machine_template_name: str + :param body: Resource properties to update. + :type body: + ~azure.mgmt.vmware.v2020_10_01_preview.models.ResourcePatch + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: VirtualMachineTemplate or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualMachineTemplate + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineTemplateName': self._serialize.url("virtual_machine_template_name", virtual_machine_template_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'ResourcePatch') + else: + body_content = None + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('VirtualMachineTemplate', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName}'} + + + def _delete_initial( + self, resource_group_name, virtual_machine_template_name, force=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineTemplateName': self._serialize.url("virtual_machine_template_name", virtual_machine_template_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if force is not None: + query_parameters['force'] = self._serialize.query("force", force, 'bool') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + header_dict = { + 'Azure-AsyncOperation': 'str', + } + client_raw_response.add_headers(header_dict) + return client_raw_response + + def delete( + self, resource_group_name, virtual_machine_template_name, force=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an virtual machine template. + + Implements virtual machine template DELETE method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_template_name: Name of the virtual machine + template resource. + :type virtual_machine_template_name: str + :param force: Whether force delete was specified. + :type force: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + virtual_machine_template_name=virtual_machine_template_name, + force=force, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'Azure-AsyncOperation': 'str', + }) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/{virtualMachineTemplateName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Implements GET virtualMachineTemplates in a subscription. + + List of virtualMachineTemplates in a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of VirtualMachineTemplate + :rtype: + ~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualMachineTemplatePaged[~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualMachineTemplate] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.VirtualMachineTemplatePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.VirtualMachineTemplatePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Implements GET virtualMachineTemplates in a resource group. + + List of virtualMachineTemplates in a resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of VirtualMachineTemplate + :rtype: + ~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualMachineTemplatePaged[~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualMachineTemplate] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.VirtualMachineTemplatePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.VirtualMachineTemplatePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates'} diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/virtual_machines_operations.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/virtual_machines_operations.py new file mode 100644 index 00000000000..e6b55a7fc44 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/virtual_machines_operations.py @@ -0,0 +1,837 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class VirtualMachinesOperations(object): + """VirtualMachinesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2020-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-10-01-preview" + + self.config = config + + + def _create_initial( + self, resource_group_name, virtual_machine_name, body=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'VirtualMachine') + else: + body_content = None + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('VirtualMachine', response) + header_dict = { + 'Azure-AsyncOperation': 'str', + } + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachine', response) + header_dict = { + 'Azure-AsyncOperation': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, virtual_machine_name, body=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Implements virtual machine PUT method. + + Create Or Update virtual machine. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the virtual machine resource. + :type virtual_machine_name: str + :param body: Request payload. + :type body: + ~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualMachine + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualMachine or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualMachine] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualMachine]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + virtual_machine_name=virtual_machine_name, + body=body, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Azure-AsyncOperation': 'str', + } + deserialized = self._deserialize('VirtualMachine', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}'} + + def get( + self, resource_group_name, virtual_machine_name, custom_headers=None, raw=False, **operation_config): + """Gets a virtual machine. + + Implements virtual machine GET method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the virtual machine resource. + :type virtual_machine_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: VirtualMachine or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualMachine + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('VirtualMachine', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}'} + + + def _update_initial( + self, resource_group_name, virtual_machine_name, body=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'VirtualMachineUpdate') + else: + body_content = None + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('VirtualMachine', response) + header_dict = { + 'Azure-AsyncOperation': 'str', + } + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachine', response) + header_dict = { + 'Azure-AsyncOperation': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, virtual_machine_name, body=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a virtual machine. + + API to update certain properties of the virtual machine resource. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the virtual machine resource. + :type virtual_machine_name: str + :param body: Resource properties to update. + :type body: + ~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualMachineUpdate + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualMachine or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualMachine] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualMachine]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + virtual_machine_name=virtual_machine_name, + body=body, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Azure-AsyncOperation': 'str', + } + deserialized = self._deserialize('VirtualMachine', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}'} + + + def _delete_initial( + self, resource_group_name, virtual_machine_name, force=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if force is not None: + query_parameters['force'] = self._serialize.query("force", force, 'bool') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + header_dict = { + 'Azure-AsyncOperation': 'str', + } + client_raw_response.add_headers(header_dict) + return client_raw_response + + def delete( + self, resource_group_name, virtual_machine_name, force=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an virtual machine. + + Implements virtual machine DELETE method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the virtual machine resource. + :type virtual_machine_name: str + :param force: Whether force delete was specified. + :type force: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + virtual_machine_name=virtual_machine_name, + force=force, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'Azure-AsyncOperation': 'str', + }) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}'} + + + def _stop_initial( + self, resource_group_name, virtual_machine_name, body=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.stop.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'StopVirtualMachineOptions') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + header_dict = { + 'Azure-AsyncOperation': 'str', + } + client_raw_response.add_headers(header_dict) + return client_raw_response + + def stop( + self, resource_group_name, virtual_machine_name, body=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Implements the operation to stop a virtual machine. + + Stop virtual machine. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the virtual machine resource. + :type virtual_machine_name: str + :param body: Virtualmachine stop action payload. + :type body: + ~azure.mgmt.vmware.v2020_10_01_preview.models.StopVirtualMachineOptions + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._stop_initial( + resource_group_name=resource_group_name, + virtual_machine_name=virtual_machine_name, + body=body, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'Azure-AsyncOperation': 'str', + }) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/stop'} + + + def _start_initial( + self, resource_group_name, virtual_machine_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.start.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + header_dict = { + 'Azure-AsyncOperation': 'str', + } + client_raw_response.add_headers(header_dict) + return client_raw_response + + def start( + self, resource_group_name, virtual_machine_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Implements the operation to start a virtual machine. + + Start virtual machine. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the virtual machine resource. + :type virtual_machine_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._start_initial( + resource_group_name=resource_group_name, + virtual_machine_name=virtual_machine_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'Azure-AsyncOperation': 'str', + }) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/start'} + + + def _restart_initial( + self, resource_group_name, virtual_machine_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.restart.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + header_dict = { + 'Azure-AsyncOperation': 'str', + } + client_raw_response.add_headers(header_dict) + return client_raw_response + + def restart( + self, resource_group_name, virtual_machine_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Implements the operation to restart a virtual machine. + + Restart virtual machine. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_machine_name: Name of the virtual machine resource. + :type virtual_machine_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._restart_initial( + resource_group_name=resource_group_name, + virtual_machine_name=virtual_machine_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'Azure-AsyncOperation': 'str', + }) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/{virtualMachineName}/restart'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Implements GET virtualMachines in a subscription. + + List of virtualMachines in a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of VirtualMachine + :rtype: + ~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualMachinePaged[~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualMachine] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.VirtualMachinePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.VirtualMachinePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Implements GET virtualMachines in a resource group. + + List of virtualMachines in a resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of VirtualMachine + :rtype: + ~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualMachinePaged[~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualMachine] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.VirtualMachinePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.VirtualMachinePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines'} diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/virtual_networks_operations.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/virtual_networks_operations.py new file mode 100644 index 00000000000..d4dee904ed7 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/operations/virtual_networks_operations.py @@ -0,0 +1,519 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class VirtualNetworksOperations(object): + """VirtualNetworksOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2020-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-10-01-preview" + + self.config = config + + + def _create_initial( + self, resource_group_name, virtual_network_name, body=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'VirtualNetwork') + else: + body_content = None + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetwork', response) + header_dict = { + 'Azure-AsyncOperation': 'str', + } + if response.status_code == 201: + deserialized = self._deserialize('VirtualNetwork', response) + header_dict = { + 'Azure-AsyncOperation': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, virtual_network_name, body=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Implements virtual network PUT method. + + Create Or Update virtual network. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_network_name: Name of the virtual network resource. + :type virtual_network_name: str + :param body: Request payload. + :type body: + ~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualNetwork + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetwork or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualNetwork] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualNetwork]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + body=body, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Azure-AsyncOperation': 'str', + } + deserialized = self._deserialize('VirtualNetwork', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName}'} + + def get( + self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): + """Gets a virtual network. + + Implements virtual network GET method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_network_name: Name of the virtual network resource. + :type virtual_network_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: VirtualNetwork or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualNetwork + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetwork', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName}'} + + def update( + self, resource_group_name, virtual_network_name, body=None, custom_headers=None, raw=False, **operation_config): + """Updates a virtual network. + + API to update certain properties of the virtual network resource. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_network_name: Name of the virtual network resource. + :type virtual_network_name: str + :param body: Resource properties to update. + :type body: + ~azure.mgmt.vmware.v2020_10_01_preview.models.ResourcePatch + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: VirtualNetwork or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualNetwork + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'ResourcePatch') + else: + body_content = None + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetwork', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName}'} + + + def _delete_initial( + self, resource_group_name, virtual_network_name, force=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if force is not None: + query_parameters['force'] = self._serialize.query("force", force, 'bool') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + header_dict = { + 'Azure-AsyncOperation': 'str', + } + client_raw_response.add_headers(header_dict) + return client_raw_response + + def delete( + self, resource_group_name, virtual_network_name, force=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an virtual network. + + Implements virtual network DELETE method. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param virtual_network_name: Name of the virtual network resource. + :type virtual_network_name: str + :param force: Whether force delete was specified. + :type force: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + force=force, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'Azure-AsyncOperation': 'str', + }) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/{virtualNetworkName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Implements GET virtualNetworks in a subscription. + + List of virtualNetworks in a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of VirtualNetwork + :rtype: + ~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualNetworkPaged[~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualNetwork] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.VirtualNetworkPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.VirtualNetworkPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Implements GET virtualNetworks in a resource group. + + List of virtualNetworks in a resource group. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of VirtualNetwork + :rtype: + ~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualNetworkPaged[~azure.mgmt.vmware.v2020_10_01_preview.models.VirtualNetwork] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.VirtualNetworkPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.VirtualNetworkPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks'} diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/py.typed b/src/connectedvmware/azext_connectedvmware/vendored_sdks/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/src/connectedvmware/azext_connectedvmware/vendored_sdks/version.py b/src/connectedvmware/azext_connectedvmware/vendored_sdks/version.py new file mode 100644 index 00000000000..affaef0c987 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vendored_sdks/version.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" + diff --git a/src/connectedvmware/azext_connectedvmware/vmware_constants.py b/src/connectedvmware/azext_connectedvmware/vmware_constants.py new file mode 100644 index 00000000000..72318ba8864 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vmware_constants.py @@ -0,0 +1,41 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +VMWARE_NAMESPACE = "Microsoft.ConnectedVmwarevSphere" +VCENTER_RESOURCE_TYPE = "VCenters" +ARCZONE_RESOURCE_TYPE = "arczones" +RESOURCEPOOL_RESOURCE_TYPE = "resourcepools" +VMTEMPLATE_RESOURCE_TYPE = "virtualmachinetemplates" +VIRTUALNETWORK_RESOURCE_TYPE = "virtualnetworks" + +DEFAULT_VCENTER_PORT = 443 + +EXTENDED_LOCATION_NAMESPACE = "Microsoft.ExtendedLocation" +CUSTOM_LOCATION_RESOURCE_TYPE = "CustomLocations" +EXTENDED_LOCATION_TYPE = "CustomLocation" +INVENTORY_ITEM_TYPE = "InventoryItems" + +# TODO (subbart): check how to get these constants from container service sdk itself. +CONTAINER_SERVICE_NAMESPACE = "Microsoft.ContainerService" +MANAGED_CLUSTERS_RESOURCE_TYPE = "managedClusters" + +NAME_PARAMETER = "name" +DEVICE_KEY = "device-key" + +# Nic parameters. +NETWORK = "network" +NIC_TYPE = "nic-type" +POWER_ON_BOOT = "power-on-boot" +ALLOCATION_METHOD = "allocation-method" +IP_ADDRESS = "ip-address" +SUBNET_MASK = "subnet-mask" +GATEWAY = "gateway" +GATEWAY_SEPERATOR = "," + +# Disk parameters. +DISK_SIZE = "disk-size" +DISK_MODE = "disk-mode" +CONTROLLER_KEY = "controller-key" +UNIT_NUMBER = "unit-number" diff --git a/src/connectedvmware/azext_connectedvmware/vmware_utils.py b/src/connectedvmware/azext_connectedvmware/vmware_utils.py new file mode 100644 index 00000000000..acd3e76a695 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/vmware_utils.py @@ -0,0 +1,60 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from knack.util import CLIError + + +def get_resource_id( + cmd, + resource_group_name, + provider_name_space, + resource_type, + resource, + child_type_1=None, + child_name_1=None, +): + """ + Gets the resource id for the resource if name is given. + """ + from azure.cli.core.commands.client_factory import get_subscription_id + from msrestazure.tools import is_valid_resource_id, resource_id + + if not is_valid_resource_id(resource): + if child_type_1 and child_name_1: + return resource_id( + subscription=get_subscription_id(cmd.cli_ctx), + resource_group=resource_group_name, + namespace=provider_name_space, + type=resource_type, + name=resource, + child_type_1=child_type_1, + child_name_1=child_name_1, + ) + else: + return resource_id( + subscription=get_subscription_id(cmd.cli_ctx), + resource_group=resource_group_name, + namespace=provider_name_space, + type=resource_type, + name=resource, + ) + else: + return resource + + +def create_dictionary_from_arg_string(values, option_string=None): + """ + Creates and returns dictionary from a string containing params in KEY=VALUE format. + """ + params_dict = {} + for item in values: + try: + key, value = item.split('=', 1) + params_dict[key.lower()] = value + except ValueError: + raise CLIError( + 'usage error: {} KEY=VALUE [KEY=VALUE ...]'.format(option_string) + ) + return params_dict diff --git a/src/connectedvmware/setup.cfg b/src/connectedvmware/setup.cfg new file mode 100644 index 00000000000..4852cdaa088 --- /dev/null +++ b/src/connectedvmware/setup.cfg @@ -0,0 +1,7 @@ +[bdist_wheel] +universal=1 +[flake8] +max-line-length=100 +# ignore=E501,W504 +exclude= + ./azext_connectedvmware/vendored_sdks/** diff --git a/src/connectedvmware/setup.py b/src/connectedvmware/setup.py new file mode 100644 index 00000000000..55055993cc5 --- /dev/null +++ b/src/connectedvmware/setup.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python + +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +from codecs import open +from setuptools import setup, find_packages + +try: + from azure_bdist_wheel import cmdclass +except ImportError: + from distutils import log as logger + + logger.warn("Wheel is not available, disabling bdist_wheel hook") + +# TODO: Confirm this is the right version number you want and it matches your +# HISTORY.rst entry. +VERSION = '0.1.0' + +# The full list of classifiers is available at +# https://pypi.python.org/pypi?%3Aaction=list_classifiers +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'License :: OSI Approved :: MIT License', +] + +# TODO: Add any additional SDK dependencies here +DEPENDENCIES = ['azure-cli-core'] + +with open('README.rst', 'r', encoding='utf-8') as f: + README = f.read() +with open('HISTORY.rst', 'r', encoding='utf-8') as f: + HISTORY = f.read() + +setup( + name='connectedvmware', + version=VERSION, + description='Microsoft Azure Command-Line Tools Connectedvmware Extension', + # TODO: Update author and email, if applicable + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + # TODO: consider pointing directly to your source code instead of the generic repo + url='https://github.com/Azure/azure-cli-extensions', + long_description=README + '\n\n' + HISTORY, + license='MIT', + classifiers=CLASSIFIERS, + packages=find_packages(), + install_requires=DEPENDENCIES, + package_data={'azext_connectedvmware': ['azext_metadata.json']}, +) From c3fe96141543577bb387b4fde361b2182c4c84ee Mon Sep 17 00:00:00 2001 From: Santosh Mishra Date: Sat, 8 May 2021 02:23:45 +0530 Subject: [PATCH 02/13] Fix validator issue --- .../azext_connectedvmware/__init__.py | 14 +- .../azext_connectedvmware/_actions.py | 4 +- .../azext_connectedvmware/_client_factory.py | 10 +- .../azext_connectedvmware/_help.py | 31 ++-- .../azext_connectedvmware/_params.py | 11 +- .../azext_connectedvmware/_validators.py | 7 +- .../azext_connectedvmware/commands.py | 19 +- .../azext_connectedvmware/custom.py | 172 +++++++++--------- .../azext_connectedvmware/tests/__init__.py | 2 +- .../tests/latest/__init__.py | 2 +- .../tests/latest/test_arcvmware_scenario.py | 23 --- .../azext_connectedvmware/vmware_constants.py | 5 - .../azext_connectedvmware/vmware_utils.py | 18 +- src/connectedvmware/setup.cfg | 2 +- 14 files changed, 143 insertions(+), 177 deletions(-) delete mode 100644 src/connectedvmware/azext_connectedvmware/tests/latest/test_arcvmware_scenario.py diff --git a/src/connectedvmware/azext_connectedvmware/__init__.py b/src/connectedvmware/azext_connectedvmware/__init__.py index c7ae194afeb..dbf717b143a 100644 --- a/src/connectedvmware/azext_connectedvmware/__init__.py +++ b/src/connectedvmware/azext_connectedvmware/__init__.py @@ -4,32 +4,28 @@ # -------------------------------------------------------------------------------------------- from azure.cli.core import AzCommandsLoader - -from azext_connectedvmware._help import helps # pylint: disable=unused-import +from azure.cli.core.commands import CliCommandType +from azext_connectedvmware._client_factory import cf_connectedvmware +from azext_connectedvmware._params import load_arguments +from azext_connectedvmware.commands import load_command_table class ConnectedvmwareCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): - from azure.cli.core.commands import CliCommandType - from azext_connectedvmware._client_factory import cf_connectedvmware - connectedvmware_custom = CliCommandType( operations_tmpl='azext_connectedvmware.custom#{}', client_factory=cf_connectedvmware, ) + # pylint: disable=R1725 super(ConnectedvmwareCommandsLoader, self).__init__( cli_ctx=cli_ctx, custom_command_type=connectedvmware_custom ) def load_command_table(self, args): - from azext_connectedvmware.commands import load_command_table - load_command_table(self, args) return self.command_table def load_arguments(self, command): - from azext_connectedvmware._params import load_arguments - load_arguments(self, command) diff --git a/src/connectedvmware/azext_connectedvmware/_actions.py b/src/connectedvmware/azext_connectedvmware/_actions.py index 189978c62fc..3bd21bc3f1c 100644 --- a/src/connectedvmware/azext_connectedvmware/_actions.py +++ b/src/connectedvmware/azext_connectedvmware/_actions.py @@ -10,7 +10,7 @@ from azext_connectedvmware.vmware_utils import create_dictionary_from_arg_string -class VmNicAddAction(argparse._AppendAction): +class VmNicAddAction(argparse._AppendAction): # pylint: disable=W0212, R0903 """ Action for parsing the nic arguments. """ @@ -23,7 +23,7 @@ def __call__(self, parser, namespace, values, option_string=None): namespace.nics = [nic_params_dict] -class VmDiskAddAction(argparse._AppendAction): +class VmDiskAddAction(argparse._AppendAction): # pylint: disable=W0212, R0903 """ Action for parsing the disk arguments. """ diff --git a/src/connectedvmware/azext_connectedvmware/_client_factory.py b/src/connectedvmware/azext_connectedvmware/_client_factory.py index 0eee0ffe856..3ea908e11e4 100644 --- a/src/connectedvmware/azext_connectedvmware/_client_factory.py +++ b/src/connectedvmware/azext_connectedvmware/_client_factory.py @@ -3,14 +3,12 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- +from azure.cli.core.commands.client_factory import get_mgmt_service_client +# Client factory for vmware clients. +from .vendored_sdks import AzureArcVMwareManagementServiceAPI -def cf_connectedvmware(cli_ctx, *_): - - from azure.cli.core.commands.client_factory import get_mgmt_service_client - - # Client factory for vmware clients. - from .vendored_sdks import AzureArcVMwareManagementServiceAPI +def cf_connectedvmware(cli_ctx, *_): return get_mgmt_service_client(cli_ctx, AzureArcVMwareManagementServiceAPI) diff --git a/src/connectedvmware/azext_connectedvmware/_help.py b/src/connectedvmware/azext_connectedvmware/_help.py index c47bdc6f2e8..3086b45fc1d 100644 --- a/src/connectedvmware/azext_connectedvmware/_help.py +++ b/src/connectedvmware/azext_connectedvmware/_help.py @@ -59,14 +59,14 @@ """ helps[ - 'connectedvmware resource-pool show' + 'connectedvmware resource-pool show_command' ] = """ type: command short-summary: "Get details of a resource pool by id, resource-group, resource pool name, or subscription" examples: - name: Get details of a resource pool text: |- - az connectedvmware resource-pool show --ids "resource id" --name "resource pool name" \ + az connectedvmware resource-pool show_command --ids "resource id" --name "resource pool name" \ --resource-group "resource group name" --subscription "subscription id" """ @@ -74,7 +74,7 @@ 'connectedvmware vcenter' ] = """ type: group - short-summary: Create, Get and Delete vcenter resource + short-summary: Vcenter resource. """ helps[ @@ -88,7 +88,7 @@ az connectedvmware vcenter connect --custom-location "custom location name" \ --fqdn "vcenter fqdn/ip" --username "vcenter user name" --password "vcenter password" \ --resource-group "resource group name" --subscription "subscription id" \ - --name "vcenter name" --inventory-item "inventory item name or id" + --name "vcenter name" --inventory-item "inventory item name or id" """ helps[ @@ -115,14 +115,14 @@ """ helps[ - 'connectedvmware vcenter show' + 'connectedvmware vcenter show_command' ] = """ type: command short-summary: "Get details of a vcenter resource by id, resource-group, vcenter name or subscription" examples: - name: Get details of a vcenter resource text: |- - az connectedvmware vcenter show --ids "resource id" --name "vcenter name" \ + az connectedvmware vcenter show_command --ids "resource id" --name "vcenter name" \ --resource-group "resource group name" --subscription "subscription id" """ @@ -171,14 +171,14 @@ """ helps[ - 'connectedvmware virtual-network show' + 'connectedvmware virtual-network show_command' ] = """ type: command short-summary: "Get details of a virtual network by id, resource-group, reource pool name or subscription" examples: - name: Get details of a virtual-network text: |- - az connectedvmware virtual-network show --ids "resource id" --name "virtual network name" \ + az connectedvmware virtual-network show_command --ids "resource id" --name "virtual network name" \ --resource-group "resource group name" --subscription "subscription id" """ @@ -238,14 +238,14 @@ """ helps[ - 'connectedvmware vm show' + 'connectedvmware vm show_command' ] = """ type: command short-summary: "Get details of a vm by id, resource-group, reource pool name or subscription" examples: - name: Get details of a vm resource text: |- - az connectedvmware vm show --ids "resource id" --name "vm template name" \ + az connectedvmware vm show_command --ids "resource id" --name "vm template name" \ --resource-group "resource group name" --subscription "subscription id" """ @@ -331,16 +331,17 @@ """ helps[ - 'connectedvmware vm-template show' + 'connectedvmware vm-template show_command' ] = """ type: command short-summary: "Get details of a vm template by id, resource-group, reource pool name or subscription" examples: - name: Get details of a vm template text: |- - az connectedvmware vm-template show --ids "resource id" --name "vm template name" \ + az connectedvmware vm-template show_command --ids "resource id" --name "vm template name" \ --resource-group "resource group name" --subscription "subscription id" """ + helps[ 'connectedvmware inventory-item' ] = """ @@ -357,17 +358,17 @@ - name: Retrieve a list of inventory item text: |- az connectedvmware inventory-item list --resource-group "resource group name" \ - --vcenter-name "name of the vcenter" + --vcenter-name "name of the vcenter" """ helps[ - 'connectedvmware inventory-item show' + 'connectedvmware inventory-item show_command' ] = """ type: command short-summary: "Get details of a inventory item by inventory item, resource-group and vcenter name." examples: - name: Get details of a vm template text: |- - az connectedvmware inventory-item show --inventory-item-name "name of the inventory item" \ + az connectedvmware inventory-item show_command --inventory-item-name "name of the inventory item" \ --resource-group "resource group name" --vcenter-name "name of the vcenter" """ diff --git a/src/connectedvmware/azext_connectedvmware/_params.py b/src/connectedvmware/azext_connectedvmware/_params.py index 7821a71889d..baa074f5a3f 100644 --- a/src/connectedvmware/azext_connectedvmware/_params.py +++ b/src/connectedvmware/azext_connectedvmware/_params.py @@ -2,20 +2,15 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -# pylint: disable=line-too-long from knack.arguments import CLIArgumentType +from azure.cli.core.commands.parameters import tags_type +from azure.cli.core.commands.validators import get_default_location_from_resource_group from ._actions import VmNicAddAction, VmDiskAddAction +# pylint: disable=R0915 def load_arguments(self, _): - - from azure.cli.core.commands.parameters import tags_type - from azure.cli.core.commands.validators import ( - get_default_location_from_resource_group, - ) - from azext_connectedvmware.vendored_sdks.models import NICType, PowerOnBootOption - connectedvmware_name_type = CLIArgumentType( options_list='--resource-name', help='Name of the resource.', id_part='name' ) diff --git a/src/connectedvmware/azext_connectedvmware/_validators.py b/src/connectedvmware/azext_connectedvmware/_validators.py index 81e3f340d08..73770324019 100644 --- a/src/connectedvmware/azext_connectedvmware/_validators.py +++ b/src/connectedvmware/azext_connectedvmware/_validators.py @@ -3,13 +3,14 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- +from azure.cli.core.commands.client_factory import get_subscription_id +from msrestazure.tools import is_valid_resource_id, resource_id + def example_name_or_id_validator(cmd, namespace): # This is an example validator , we can write our validators using this pattern as needed. # Example of a storage account name or ID validator. - # See: https://github.com/Azure/azure-cli/blob/dev/doc/authoring_command_modules/authoring_commands.md#supporting-name-or-id-parameters - from azure.cli.core.commands.client_factory import get_subscription_id - from msrestazure.tools import is_valid_resource_id, resource_id + # See: https://github.com/Azure/azure-cli/blob/dev/doc/authoring_command_modules/authoring_commands.md#supporting-name-or-id-parameters # pylint: disable=C0301 if namespace.storage_account: if not is_valid_resource_id(namespace.RESOURCE): diff --git a/src/connectedvmware/azext_connectedvmware/commands.py b/src/connectedvmware/azext_connectedvmware/commands.py index eb5b27faf7c..c41777bbfcd 100644 --- a/src/connectedvmware/azext_connectedvmware/commands.py +++ b/src/connectedvmware/azext_connectedvmware/commands.py @@ -4,7 +4,6 @@ # -------------------------------------------------------------------------------------------- # pylint: disable=line-too-long -from azure.cli.core.commands import CliCommandType from ._client_factory import ( cf_vcenter, cf_resource_pool, @@ -20,7 +19,7 @@ def load_command_table(self, _): with self.command_group('connectedvmware vcenter', client_factory=cf_vcenter) as g: g.custom_command('connect', 'connect_vcenter', supports_no_wait=True) g.custom_command('delete', 'delete_vcenter', supports_no_wait=True) - g.custom_command('show', 'show_vcenter') + g.custom_command('show_command', 'show_vcenter') g.custom_command('list', 'list_vcenter') with self.command_group( @@ -28,7 +27,7 @@ def load_command_table(self, _): ) as g: g.custom_command('create', 'create_resource_pool', supports_no_wait=True) g.custom_command('delete', 'delete_resource_pool', supports_no_wait=True) - g.custom_command('show', 'show_resource_pool') + g.custom_command('show_command', 'show_resource_pool') g.custom_command('list', 'list_resource_pool') with self.command_group( @@ -36,7 +35,7 @@ def load_command_table(self, _): ) as g: g.custom_command('create', 'create_virtual_network', supports_no_wait=True) g.custom_command('delete', 'delete_virtual_network', supports_no_wait=True) - g.custom_command('show', 'show_virtual_network') + g.custom_command('show_command', 'show_virtual_network') g.custom_command('list', 'list_virtual_network') with self.command_group( @@ -44,7 +43,7 @@ def load_command_table(self, _): ) as g: g.custom_command('create', 'create_vm_template', supports_no_wait=True) g.custom_command('delete', 'delete_vm_template', supports_no_wait=True) - g.custom_command('show', 'show_vm_template') + g.custom_command('show_command', 'show_vm_template') g.custom_command('list', 'list_vm_template') with self.command_group( @@ -53,7 +52,7 @@ def load_command_table(self, _): g.custom_command('create', 'create_vm', supports_no_wait=True) g.custom_command('delete', 'delete_vm', supports_no_wait=True) g.custom_command('update', 'update_vm', supports_no_wait=True) - g.custom_command('show', 'show_vm') + g.custom_command('show_command', 'show_vm') g.custom_command('list', 'list_vm') g.custom_command('start', 'start_vm', supports_no_wait=True) g.custom_command('stop', 'stop_vm', supports_no_wait=True) @@ -65,7 +64,7 @@ def load_command_table(self, _): g.custom_command('add', 'add_nic', supports_no_wait=True) g.custom_command('update', 'update_nic', supports_no_wait=True) g.custom_command('delete', 'delete_nics', supports_no_wait=True) - g.custom_command('show', 'show_nic') + g.custom_command('show_command', 'show_nic') g.custom_command('list', 'list_nics') with self.command_group( @@ -74,14 +73,14 @@ def load_command_table(self, _): g.custom_command('add', 'add_disk', supports_no_wait=True) g.custom_command('update', 'update_disk', supports_no_wait=True) g.custom_command('delete', 'delete_disks', supports_no_wait=True) - g.custom_command('show', 'show_disk') + g.custom_command('show_command', 'show_disk') g.custom_command('list', 'list_disks') with self.command_group( 'connectedvmware inventory-item', client_factory=cf_inventory_item ) as g: - g.custom_command('show', 'show_inventory_item') + g.custom_command('show_command', 'show_inventory_item') g.custom_command('list', 'list_inventory_item') with self.command_group('connectedvmware', is_preview=False): - pass \ No newline at end of file + pass diff --git a/src/connectedvmware/azext_connectedvmware/custom.py b/src/connectedvmware/azext_connectedvmware/custom.py index 4764165e78e..f468c8b9ab9 100644 --- a/src/connectedvmware/azext_connectedvmware/custom.py +++ b/src/connectedvmware/azext_connectedvmware/custom.py @@ -3,14 +3,37 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- +# pylint: disable=C0302 from knack.util import CLIError -from azext_connectedvmware.vmware_constants import * from azext_connectedvmware.vmware_utils import get_resource_id from azure.cli.core.util import sdk_no_wait from .vmware_constants import ( + VMWARE_NAMESPACE, + VCENTER_RESOURCE_TYPE, + RESOURCEPOOL_RESOURCE_TYPE, + VMTEMPLATE_RESOURCE_TYPE, + VIRTUALNETWORK_RESOURCE_TYPE, + DEFAULT_VCENTER_PORT, + EXTENDED_LOCATION_NAMESPACE, CUSTOM_LOCATION_RESOURCE_TYPE, EXTENDED_LOCATION_TYPE, + INVENTORY_ITEM_TYPE, + NAME_PARAMETER, + DEVICE_KEY, + NETWORK, + NIC_TYPE, + POWER_ON_BOOT, + ALLOCATION_METHOD, + IP_ADDRESS, + SUBNET_MASK, + GATEWAY, + GATEWAY_SEPERATOR, + DISK_SIZE, + DISK_MODE, + CONTROLLER_KEY, + UNIT_NUMBER ) + from .vendored_sdks.models import ( DiskMode, HardwareProfile, @@ -62,7 +85,6 @@ def connect_vcenter( username=None, password=None, port=DEFAULT_VCENTER_PORT, - tags=None, no_wait=False, ): @@ -97,7 +119,6 @@ def connect_vcenter( def delete_vcenter( - cmd, client: VCentersOperations, resource_group_name, resource_name, @@ -110,12 +131,12 @@ def delete_vcenter( ) -def show_vcenter(cmd, client: VCentersOperations, resource_group_name, resource_name): +def show_vcenter(client: VCentersOperations, resource_group_name, resource_name): return client.get(resource_group_name, resource_name) -def list_vcenter(cmd, client: VCentersOperations, resource_group_name=None): +def list_vcenter(client: VCentersOperations, resource_group_name=None): if resource_group_name: return client.list_by_resource_group(resource_group_name) @@ -137,7 +158,6 @@ def create_resource_pool( vcenter=None, mo_ref_id=None, inventory_item=None, - tags=None, no_wait=False, ): @@ -173,9 +193,7 @@ def create_resource_pool( ) else: if vcenter is None: - raise CLIError( - "Missing parameter, provide vcenter name or id." - ) + raise CLIError("Missing parameter, provide vcenter name or id.") vcenter_id = get_resource_id( cmd, resource_group_name, VMWARE_NAMESPACE, VCENTER_RESOURCE_TYPE, vcenter @@ -201,7 +219,6 @@ def create_resource_pool( def delete_resource_pool( - cmd, client: ResourcePoolsOperations, resource_group_name, resource_name, @@ -215,13 +232,13 @@ def delete_resource_pool( def show_resource_pool( - cmd, client: ResourcePoolsOperations, resource_group_name, resource_name + client: ResourcePoolsOperations, resource_group_name, resource_name ): return client.get(resource_group_name, resource_name) -def list_resource_pool(cmd, client: ResourcePoolsOperations, resource_group_name=None): +def list_resource_pool(client: ResourcePoolsOperations, resource_group_name=None): if resource_group_name: return client.list_by_resource_group(resource_group_name) @@ -243,7 +260,6 @@ def create_virtual_network( vcenter=None, mo_ref_id=None, inventory_item=None, - tags=None, no_wait=False, ): @@ -279,9 +295,7 @@ def create_virtual_network( ) else: if vcenter is None: - raise CLIError( - "Missing parameter, provide vcenter name or id." - ) + raise CLIError("Missing parameter, provide vcenter name or id.") vcenter_id = get_resource_id( cmd, resource_group_name, VMWARE_NAMESPACE, VCENTER_RESOURCE_TYPE, vcenter @@ -311,7 +325,6 @@ def create_virtual_network( def delete_virtual_network( - cmd, client: VirtualNetworksOperations, resource_group_name, resource_name, @@ -325,14 +338,14 @@ def delete_virtual_network( def show_virtual_network( - cmd, client: VirtualNetworksOperations, resource_group_name, resource_name + client: VirtualNetworksOperations, resource_group_name, resource_name ): return client.get(resource_group_name, resource_name) def list_virtual_network( - cmd, client: VirtualNetworksOperations, resource_group_name=None + client: VirtualNetworksOperations, resource_group_name=None ): if resource_group_name: @@ -355,7 +368,6 @@ def create_vm_template( vcenter=None, mo_ref_id=None, inventory_item=None, - tags=None, no_wait=True, ): @@ -391,9 +403,7 @@ def create_vm_template( ) else: if vcenter is None: - raise CLIError( - "Missing parameter, provide vcenter name or id." - ) + raise CLIError("Missing parameter, provide vcenter name or id.") vcenter_id = get_resource_id( cmd, resource_group_name, VMWARE_NAMESPACE, VCENTER_RESOURCE_TYPE, vcenter @@ -419,7 +429,6 @@ def create_vm_template( def delete_vm_template( - cmd, client: VirtualMachineTemplatesOperations, resource_group_name, resource_name, @@ -433,14 +442,14 @@ def delete_vm_template( def show_vm_template( - cmd, client: VirtualMachineTemplatesOperations, resource_group_name, resource_name + client: VirtualMachineTemplatesOperations, resource_group_name, resource_name ): return client.get(resource_group_name, resource_name) def list_vm_template( - cmd, client: VirtualMachineTemplatesOperations, resource_group_name=None + client: VirtualMachineTemplatesOperations, resource_group_name=None ): if resource_group_name: @@ -448,9 +457,11 @@ def list_vm_template( return client.list() -# region VirtualMachines +# endregion +# region VirtualMachines +# pylint: disable=R0914 def create_vm( cmd, client: VirtualMachinesOperations, @@ -469,7 +480,6 @@ def create_vm( memory_size=None, nics=None, disks=None, - tags=None, no_wait=False, ): @@ -498,13 +508,13 @@ def create_vm( if nics is not None: network_profile = NetworkProfile( network_interfaces=get_network_interfaces( - cmd, client, resource_group_name, nics + cmd, resource_group_name, nics ) ) if disks is not None: storage_profile = StorageProfile( - disks=get_disks(cmd, client, resource_group_name, disks) + disks=get_disks(disks) ) custom_location_id = get_resource_id( @@ -536,9 +546,7 @@ def create_vm( ) else: if vcenter is None: - raise CLIError( - "Missing parameter, provide vcenter name or id." - ) + raise CLIError("Missing parameter, provide vcenter name or id.") vcenter_id = get_resource_id( cmd, resource_group_name, VMWARE_NAMESPACE, VCENTER_RESOURCE_TYPE, vcenter @@ -591,7 +599,6 @@ def create_vm( def update_vm( - cmd, client: VirtualMachinesOperations, resource_group_name, resource_name, @@ -605,17 +612,17 @@ def update_vm( hardware_profile = None if ( - num_CPUs is None - and num_cores_per_socket is None - and memory_size is None - and tags is None + num_CPUs is None and + num_cores_per_socket is None and + memory_size is None and + tags is None ): raise CLIError("No inputs were given to update the vm.") if ( - num_CPUs is not None - or num_cores_per_socket is not None - or memory_size is not None + num_CPUs is not None or + num_cores_per_socket is not None or + memory_size is not None ): hardware_profile = HardwareProfile( memory_size_mb=memory_size, @@ -635,7 +642,6 @@ def update_vm( def delete_vm( - cmd, client: VirtualMachinesOperations, resource_group_name, resource_name, @@ -648,12 +654,12 @@ def delete_vm( ) -def show_vm(cmd, client: VirtualMachinesOperations, resource_group_name, resource_name): +def show_vm(client: VirtualMachinesOperations, resource_group_name, resource_name): return client.get(resource_group_name, resource_name) -def list_vm(cmd, client: VirtualMachinesOperations, resource_group_name=None): +def list_vm(client: VirtualMachinesOperations, resource_group_name=None): if resource_group_name: return client.list_by_resource_group(resource_group_name) @@ -661,7 +667,6 @@ def list_vm(cmd, client: VirtualMachinesOperations, resource_group_name=None): def start_vm( - cmd, client: VirtualMachinesOperations, resource_group_name, resource_name, @@ -672,7 +677,6 @@ def start_vm( def stop_vm( - cmd, client: VirtualMachinesOperations, resource_group_name, resource_name, @@ -690,7 +694,6 @@ def stop_vm( def restart_vm( - cmd, client: VirtualMachinesOperations, resource_group_name, resource_name, @@ -703,7 +706,7 @@ def restart_vm( def get_network_interfaces( - cmd, client: VirtualMachinesOperations, resource_group_name, input_nics + cmd, resource_group_name, input_nics ): """ Gets network interfaces from the given input. @@ -753,7 +756,7 @@ def get_network_interfaces( return nics -def get_disks(cmd, client: VirtualMachinesOperations, resource_group_name, input_disks): +def get_disks(input_disks): """ Gets disks from the given input. """ @@ -820,8 +823,8 @@ def add_nic( nics_update = [] vm = client.get(resource_group_name, vm_name) if ( - vm.network_profile is not None - and vm.network_profile.network_interfaces is not None + vm.network_profile is not None and + vm.network_profile.network_interfaces is not None ): for nic in vm.network_profile.network_interfaces: nic_update = NetworkInterfaceUpdate( @@ -876,8 +879,8 @@ def update_nic( nic_found = False vm = client.get(resource_group_name, vm_name) if ( - vm.network_profile is not None - and vm.network_profile.network_interfaces is not None + vm.network_profile is not None and + vm.network_profile.network_interfaces is not None ): for nic in vm.network_profile.network_interfaces: nic_update = NetworkInterfaceUpdate( @@ -895,17 +898,17 @@ def update_nic( # Validate nic name is matching with the expected device key if both were given in # the input when name is already assigned to the nic. if ( - nic_name is not None - and nic.name is not None - and nic.name != nic_name + nic_name is not None and + nic.name is not None and + nic.name != nic_name ) or (device_key is not None and nic.device_key != device_key): raise CLIError( - "Incorrect nic-name and device-key combination, Expected " - + "nic-name: " - + nic.name - + ", device-key: " - + str(nic.device_key) - + "." + "Incorrect nic-name and device-key combination, Expected " + + "nic-name: " + + nic.name + + ", device-key: " + + str(nic.device_key) + + "." ) nic_found = True @@ -947,8 +950,8 @@ def show_nic(client: VirtualMachinesOperations, resource_group_name, vm_name, ni vm = client.get(resource_group_name, vm_name) if ( - vm.network_profile is not None - and vm.network_profile.network_interfaces is not None + vm.network_profile is not None and + vm.network_profile.network_interfaces is not None ): for nic in vm.network_profile.network_interfaces: if nic.name == nic_name: @@ -975,8 +978,8 @@ def delete_nics( nics_update = [] vm = client.get(resource_group_name, vm_name) if ( - vm.network_profile is not None - and vm.network_profile.network_interfaces is not None + vm.network_profile is not None and + vm.network_profile.network_interfaces is not None ): for nic in vm.network_profile.network_interfaces: if nic.name in nics_to_delete: @@ -997,9 +1000,9 @@ def delete_nics( not_found_nics = not_found_nics + nic_name + ", " if not_found_nics != "": raise CLIError( - "Nics with name " - + not_found_nics - + 'not present in the given virtual machine.' + "Nics with name " + + not_found_nics + + 'not present in the given virtual machine.' ) network_profile = NetworkProfileUpdate(network_interfaces=nics_update) @@ -1016,7 +1019,6 @@ def delete_nics( def add_disk( - cmd, client: VirtualMachinesOperations, resource_group_name, vm_name, @@ -1063,7 +1065,6 @@ def add_disk( def update_disk( - cmd, client: VirtualMachinesOperations, resource_group_name, vm_name, @@ -1105,17 +1106,17 @@ def update_disk( # Validate disk name is matching with the expected device key if both were given in # the input when name is already assigned to the disk. if ( - disk_name is not None - and disk.name is not None - and disk.name != disk_name + disk_name is not None and + disk.name is not None and + disk.name != disk_name ) or (device_key is not None and disk.device_key != device_key): raise CLIError( "Incorrect disk-name and device-key combination, Expected " - + "disk-name: " - + disk.name - + ", device-key: " - + str(disk.device_key) - + "." + "disk-name: " + + disk.name + + ", device-key: " + + str(disk.device_key) + + "." ) disk_found = True @@ -1208,9 +1209,9 @@ def delete_disks( not_found_disks = not_found_disks + disk_name + ", " if not_found_disks != "": raise CLIError( - "Disks with name " - + not_found_disks - + "not present in the given virtual machine." + "Disks with name " + + not_found_disks + + "not present in the given virtual machine." ) storage_profile = StorageProfileUpdate(disks=disks_update) @@ -1223,11 +1224,10 @@ def delete_disks( # endregion -# endregion +# region InventoryItems def show_inventory_item( - cmd, client: InventoryItemsOperations, resource_group_name, vcenter_name, @@ -1238,7 +1238,7 @@ def show_inventory_item( def list_inventory_item( - cmd, client: InventoryItemsOperations, resource_group_name, vcenter_name + client: InventoryItemsOperations, resource_group_name, vcenter_name ): - return client.list_by_v_center(resource_group_name, vcenter_name) \ No newline at end of file + return client.list_by_v_center(resource_group_name, vcenter_name) diff --git a/src/connectedvmware/azext_connectedvmware/tests/__init__.py b/src/connectedvmware/azext_connectedvmware/tests/__init__.py index 2dcf9bb68b3..99c0f28cd71 100644 --- a/src/connectedvmware/azext_connectedvmware/tests/__init__.py +++ b/src/connectedvmware/azext_connectedvmware/tests/__init__.py @@ -2,4 +2,4 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. -# ----------------------------------------------------------------------------- \ No newline at end of file +# ----------------------------------------------------------------------------- diff --git a/src/connectedvmware/azext_connectedvmware/tests/latest/__init__.py b/src/connectedvmware/azext_connectedvmware/tests/latest/__init__.py index 2dcf9bb68b3..99c0f28cd71 100644 --- a/src/connectedvmware/azext_connectedvmware/tests/latest/__init__.py +++ b/src/connectedvmware/azext_connectedvmware/tests/latest/__init__.py @@ -2,4 +2,4 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. -# ----------------------------------------------------------------------------- \ No newline at end of file +# ----------------------------------------------------------------------------- diff --git a/src/connectedvmware/azext_connectedvmware/tests/latest/test_arcvmware_scenario.py b/src/connectedvmware/azext_connectedvmware/tests/latest/test_arcvmware_scenario.py deleted file mode 100644 index 2ffdb1394f2..00000000000 --- a/src/connectedvmware/azext_connectedvmware/tests/latest/test_arcvmware_scenario.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -import os -import unittest - -from azure_devtools.scenario_tests import AllowLargeResponse -from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer -from knack.util import CLIError -from azure.cli.testsdk import ScenarioTest - -TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) - - -class ConnectedvmwareScenarioTest(ScenarioTest): - @ResourceGroupPreparer(name_prefix='cli_test_connectedvmware') - def test_connectedvmware_vcenter(self, resource_group): - - self.kwargs.update({'name': 'test1'}) - - # raise CLIError('TODO') diff --git a/src/connectedvmware/azext_connectedvmware/vmware_constants.py b/src/connectedvmware/azext_connectedvmware/vmware_constants.py index 72318ba8864..541ee99ac2e 100644 --- a/src/connectedvmware/azext_connectedvmware/vmware_constants.py +++ b/src/connectedvmware/azext_connectedvmware/vmware_constants.py @@ -5,7 +5,6 @@ VMWARE_NAMESPACE = "Microsoft.ConnectedVmwarevSphere" VCENTER_RESOURCE_TYPE = "VCenters" -ARCZONE_RESOURCE_TYPE = "arczones" RESOURCEPOOL_RESOURCE_TYPE = "resourcepools" VMTEMPLATE_RESOURCE_TYPE = "virtualmachinetemplates" VIRTUALNETWORK_RESOURCE_TYPE = "virtualnetworks" @@ -17,10 +16,6 @@ EXTENDED_LOCATION_TYPE = "CustomLocation" INVENTORY_ITEM_TYPE = "InventoryItems" -# TODO (subbart): check how to get these constants from container service sdk itself. -CONTAINER_SERVICE_NAMESPACE = "Microsoft.ContainerService" -MANAGED_CLUSTERS_RESOURCE_TYPE = "managedClusters" - NAME_PARAMETER = "name" DEVICE_KEY = "device-key" diff --git a/src/connectedvmware/azext_connectedvmware/vmware_utils.py b/src/connectedvmware/azext_connectedvmware/vmware_utils.py index acd3e76a695..f19ed831d91 100644 --- a/src/connectedvmware/azext_connectedvmware/vmware_utils.py +++ b/src/connectedvmware/azext_connectedvmware/vmware_utils.py @@ -4,6 +4,8 @@ # -------------------------------------------------------------------------------------------- from knack.util import CLIError +from azure.cli.core.commands.client_factory import get_subscription_id +from msrestazure.tools import is_valid_resource_id, resource_id def get_resource_id( @@ -18,12 +20,11 @@ def get_resource_id( """ Gets the resource id for the resource if name is given. """ - from azure.cli.core.commands.client_factory import get_subscription_id - from msrestazure.tools import is_valid_resource_id, resource_id if not is_valid_resource_id(resource): + resource_ids = None if child_type_1 and child_name_1: - return resource_id( + resource_ids = resource_id( subscription=get_subscription_id(cmd.cli_ctx), resource_group=resource_group_name, namespace=provider_name_space, @@ -33,15 +34,18 @@ def get_resource_id( child_name_1=child_name_1, ) else: - return resource_id( + resource_ids = resource_id( subscription=get_subscription_id(cmd.cli_ctx), resource_group=resource_group_name, namespace=provider_name_space, type=resource_type, name=resource, ) + else: - return resource + resource_ids = resource + + return resource_ids def create_dictionary_from_arg_string(values, option_string=None): @@ -53,8 +57,8 @@ def create_dictionary_from_arg_string(values, option_string=None): try: key, value = item.split('=', 1) params_dict[key.lower()] = value - except ValueError: + except ValueError as item_no_exist: raise CLIError( 'usage error: {} KEY=VALUE [KEY=VALUE ...]'.format(option_string) - ) + ) from item_no_exist return params_dict diff --git a/src/connectedvmware/setup.cfg b/src/connectedvmware/setup.cfg index 4852cdaa088..f46f90607a7 100644 --- a/src/connectedvmware/setup.cfg +++ b/src/connectedvmware/setup.cfg @@ -2,6 +2,6 @@ universal=1 [flake8] max-line-length=100 -# ignore=E501,W504 +ignore=E501,E203,W503,W504 exclude= ./azext_connectedvmware/vendored_sdks/** From 49463b24672eff43f037e22380c08e6fa93d8112 Mon Sep 17 00:00:00 2001 From: Santosh Mishra Date: Sun, 9 May 2021 01:22:00 +0530 Subject: [PATCH 03/13] Addressed Zhou reviews comments --- src/connectedvmware/.gitignore | 1 + .../.vscode.example/launch.json | 42 ----- .../.vscode.example/settings.json | 22 --- src/connectedvmware/README.md | 23 +++ src/connectedvmware/README.rst | 5 - .../azext_connectedvmware/__init__.py | 10 +- .../azext_connectedvmware/_help.py | 165 +++++++++++++++--- .../azext_connectedvmware/_params.py | 71 +++++++- .../azext_connectedvmware/custom.py | 2 +- 9 files changed, 240 insertions(+), 101 deletions(-) delete mode 100644 src/connectedvmware/.vscode.example/launch.json delete mode 100644 src/connectedvmware/.vscode.example/settings.json create mode 100644 src/connectedvmware/README.md delete mode 100644 src/connectedvmware/README.rst diff --git a/src/connectedvmware/.gitignore b/src/connectedvmware/.gitignore index 1d74e21965c..0a798b060e8 100644 --- a/src/connectedvmware/.gitignore +++ b/src/connectedvmware/.gitignore @@ -1 +1,2 @@ .vscode/ +.vscode.example diff --git a/src/connectedvmware/.vscode.example/launch.json b/src/connectedvmware/.vscode.example/launch.json deleted file mode 100644 index ad71f69e923..00000000000 --- a/src/connectedvmware/.vscode.example/launch.json +++ /dev/null @@ -1,42 +0,0 @@ -// Set AZCLI_SRC_PATH as the path to the azure-cli source code on your local machine. -// You may also replace the content of `${env:AZCLI_SRC_PATH}` with the absolute path, if desired :). -{ - "version": "0.2.0", - "configurations": [ - { - "name": "Azure CLI Debug (Integrated Console)", - "type": "python", - "request": "launch", - "python": "${command:python.interpreterPath}", - "program": "${env:AZCLI_SRC_PATH}/src/azure-cli/azure/cli/__main__.py", - "args": [ ], // list of command arguments to execute when running in debug mode. - "console": "integratedTerminal", - "justMyCode": false - }, - { - "name": "Azure CLI Debug (External Console)", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "python": "${command:python.interpreterPath}", - "program": "${env:AZCLI_SRC_PATH}/src/azure-cli/azure/cli/__main__.py", - "cwd": "${workspaceRoot}", - "args": [ - "--help" - ], - "console": "externalTerminal" - }, - { - "name": "Azdev Scripts", - "type": "python", - "request": "launch", - "python": "${command:python.interpreterPath}", - "program": "${env:AZCLI_SRC_PATH}/src/azure-cli/azure/cli/__main__.py", - "cwd": "${workspaceRoot}", - "args": [ - "--help" - ], - "console": "integratedTerminal" - } - ] - } \ No newline at end of file diff --git a/src/connectedvmware/.vscode.example/settings.json b/src/connectedvmware/.vscode.example/settings.json deleted file mode 100644 index 80d3ffcbc02..00000000000 --- a/src/connectedvmware/.vscode.example/settings.json +++ /dev/null @@ -1,22 +0,0 @@ -{​​​​​ - "python.languageServer": "Pylance", - "python.formatting.provider": "black", - "python.formatting.blackArgs": [ - "--skip-string-normalization" - ], - "python.linting.enabled": true, - "python.linting.flake8Enabled": true, - "python.linting.flake8Args": [ - "--ignore=E203", - "--ignore=E266", - "--ignore=E501", - "--ignore=W503", - "--max-line-length=88", - "--select = B,C,E,F,W,T4,B9", - "--max-complexity = 18" - ], - "editor.formatOnSave": true, - "python.pythonPath": "$azcli/.venv/bin/python" // Set the path to python inside your virtual environment. -}​​​​​ - - diff --git a/src/connectedvmware/README.md b/src/connectedvmware/README.md new file mode 100644 index 00000000000..fb06b1a936d --- /dev/null +++ b/src/connectedvmware/README.md @@ -0,0 +1,23 @@ +# Microsoft Azure CLI ConnectedVMware Extension # + +The Azure CLI extension for [Azure Arc VMware Service](https://azure.microsoft.com/en-us/services/azure-arc) is an extension for Azure CLI 2.0. + +## Install +``` sh +az extension add --name connectedvmware +``` + +## Usage +See the [extension reference documenation](https://azure.microsoft.com/en-us/services/azure-arc). + +``` sh +az connectedvmware --help +az connectedvmware vcenter list -g $resourcegroup +az connectedvmware vcenter connect -g $rg --location $location --custom-location $customLocation --fqdn $fqdn --username $username --password $pwd +``` + +## Uninstall +You can see if the extension is installed by running `az --version` or `az extension list`. You can remove the extension by running: +``` sh +az extension remove --name connectedvmware +``` diff --git a/src/connectedvmware/README.rst b/src/connectedvmware/README.rst deleted file mode 100644 index 9a24507eef3..00000000000 --- a/src/connectedvmware/README.rst +++ /dev/null @@ -1,5 +0,0 @@ -Microsoft Azure CLI 'connectedvmware' Extension -========================================== - -This package is for the 'connectedvmware' extension. -i.e. 'az connectedvmware' diff --git a/src/connectedvmware/azext_connectedvmware/__init__.py b/src/connectedvmware/azext_connectedvmware/__init__.py index dbf717b143a..5659b774d57 100644 --- a/src/connectedvmware/azext_connectedvmware/__init__.py +++ b/src/connectedvmware/azext_connectedvmware/__init__.py @@ -4,14 +4,14 @@ # -------------------------------------------------------------------------------------------- from azure.cli.core import AzCommandsLoader -from azure.cli.core.commands import CliCommandType -from azext_connectedvmware._client_factory import cf_connectedvmware -from azext_connectedvmware._params import load_arguments -from azext_connectedvmware.commands import load_command_table +from azext_connectedvmware._help import helps # pylint: disable=unused-import +# pylint: disable=C0415 class ConnectedvmwareCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from azext_connectedvmware._client_factory import cf_connectedvmware connectedvmware_custom = CliCommandType( operations_tmpl='azext_connectedvmware.custom#{}', client_factory=cf_connectedvmware, @@ -22,10 +22,12 @@ def __init__(self, cli_ctx=None): ) def load_command_table(self, args): + from azext_connectedvmware.commands import load_command_table load_command_table(self, args) return self.command_table def load_arguments(self, command): + from azext_connectedvmware._params import load_arguments load_arguments(self, command) diff --git a/src/connectedvmware/azext_connectedvmware/_help.py b/src/connectedvmware/azext_connectedvmware/_help.py index 3086b45fc1d..780fad0643b 100644 --- a/src/connectedvmware/azext_connectedvmware/_help.py +++ b/src/connectedvmware/azext_connectedvmware/_help.py @@ -44,7 +44,7 @@ - name: Delete resource pool text: |- az connectedvmware resource-pool delete --ids "resource id" --name "resource pool name" \ - --resource-group "resource group name" --subscription "subscription id" + --resource-group "resource group name" --subscription "Name or ID of subscription" """ helps[ @@ -67,7 +67,7 @@ - name: Get details of a resource pool text: |- az connectedvmware resource-pool show_command --ids "resource id" --name "resource pool name" \ - --resource-group "resource group name" --subscription "subscription id" + --resource-group "resource group name" --subscription "Name or ID of subscription" """ helps[ @@ -87,8 +87,8 @@ text: |- az connectedvmware vcenter connect --custom-location "custom location name" \ --fqdn "vcenter fqdn/ip" --username "vcenter user name" --password "vcenter password" \ - --resource-group "resource group name" --subscription "subscription id" \ - --name "vcenter name" --inventory-item "inventory item name or id" + --resource-group "resource group name" --subscription "Name or ID of subscription" \ + --location "region name" --name "vcenter name" """ helps[ @@ -100,7 +100,7 @@ - name: Delete vcenter resource text: |- az connectedvmware vcenter delete --ids "resource id" --name "vcenter name" \ - --resource-group "resource group name" --subscription "subscription id" + --resource-group "resource group name" --subscription "Name or ID of subscription" """ helps[ @@ -123,7 +123,7 @@ - name: Get details of a vcenter resource text: |- az connectedvmware vcenter show_command --ids "resource id" --name "vcenter name" \ - --resource-group "resource group name" --subscription "subscription id" + --resource-group "resource group name" --subscription "Name or ID of subscription" """ helps[ @@ -141,7 +141,7 @@ examples: - name: Create virtual network text: |- - az connectedvmware virtual-network create --custom-location "custom location name" + az connectedvmware virtual-network create --custom-location "custom location name" \ --location "region name" --mo-ref-id "mo-ref id of the resource in vc" --name \ "virtual network name" --resource-group "resource group name" --vcenter \ "name or id of the vcenter" --inventory-item "inventory item name or id" @@ -156,7 +156,7 @@ - name: Delete virtual network text: |- az connectedvmware virtual-network delete --ids "resource id" --name "virtual network name" \ - --resource-group "resource group name" --subscription "subscription id" + --resource-group "resource group name" --subscription "Name or ID of subscription" """ helps[ @@ -179,7 +179,7 @@ - name: Get details of a virtual-network text: |- az connectedvmware virtual-network show_command --ids "resource id" --name "virtual network name" \ - --resource-group "resource group name" --subscription "subscription id" + --resource-group "resource group name" --subscription "Name or ID of subscription" """ helps[ @@ -211,7 +211,7 @@ - name: Delete vm text: |- az connectedvmware vm delete --ids "resource id" --name "virtual machine name" \ - --resource-group "resource group name" --subscription "subscription id" + --resource-group "resource group name" --subscription "Name or ID of subscription" """ helps[ @@ -222,7 +222,7 @@ examples: - name: Retrieve a list of vm resource text: |- - az connectedvmware vm list --resource-group "resource group name" + az connectedvmware vm list --resource-group "resource group name" """ helps[ @@ -234,7 +234,7 @@ - name: Restart vm text: |- az connectedvmware vm restart --ids "resource id" --name "virtual machine name" \ - --resource-group "resource group name" --subscription "subscription id" + --resource-group "resource group name" --subscription "Name or ID of subscription" """ helps[ @@ -246,7 +246,7 @@ - name: Get details of a vm resource text: |- az connectedvmware vm show_command --ids "resource id" --name "vm template name" \ - --resource-group "resource group name" --subscription "subscription id" + --resource-group "resource group name" --subscription "Name or ID of subscription" """ helps[ @@ -258,7 +258,7 @@ - name: Start vm text: |- az connectedvmware vm start --ids "resource id" --name "virtual machine name" \ - --resource-group "resource group name" --subscription "subscription id" + --resource-group "resource group name" --subscription "Name or ID of subscription" """ helps[ @@ -270,7 +270,7 @@ - name: Stop vm text: |- az connectedvmware vm stop --ids "resource id" --name "virtual machine name" \ - --resource-group "resource group name" --subscription "subscription id" + --resource-group "resource group name" --subscription "Name or ID of subscription" """ helps[ @@ -282,8 +282,131 @@ - name: Update vm text: |- az connectedvmware vm update --ids "resource id" --name "virtual machine name" \ - --resource-group "resource group name" --subscription "subscription id" \ - --memory-size --num-CPUs + --resource-group "resource group name" --subscription "Name or ID of subscription" \ + --memory-size "vm memory size in MB" --num-CPUs "no. of CPUs" +""" + +helps[ + 'connectedvmware vm disk' +] = """ + type: group + short-summary: vm disk +""" + +helps[ + 'connectedvmware vm disk add' +] = """ + type: command + short-summary: "Add virtual disk to a virtual machine" + examples: + - name: Add virtual disk to a virtual machine + text: |- + az connectedvmware vm disk add --controller-key "The controller key of the disk" \ + --disk-size "The disk size in GBs" --name "Name of the Disk" --resource-group \ + "resource group name" --vm-name "Name of the virtual machine" +""" + +helps[ + 'connectedvmware vm disk delete' +] = """ + type: command + short-summary: "Delete virtual disks to a virtual machine" + examples: + - name: Delete virtual disks to a virtual machine + text: |- + az connectedvmware vm disk delete --disk "Names of the Disks" --resource-group \ + "resource group name" --vm-name "Name of the virtual machine" +""" + +helps[ + 'connectedvmware vm disk list' +] = """ + type: command + short-summary: "Retrieve a list of vm disk from given resource group name and vm name" + examples: + - name: Retrieve a list of vm disk + text: |- + az connectedvmware vm disk list --resource-group "resource group name" --vm-name \ + "Name of the virtual machine" +""" + +helps[ + 'connectedvmware vm disk show_command' +] = """ + type: command + short-summary: "Get details of a vm disk by it's name, resource-group and vm name" + examples: + - name: Get details of vm disk + text: |- + az connectedvmware vm disk show_command --name "Name of the Disk" --resource-group \ + "resource group name" --vm-name "Name of the virtual machine" +""" +helps[ + 'connectedvmware vm disk update' +] = """ + type: command + short-summary: "Update virtual disk to a virtual machine" + examples: + - name: Update virtual disk to a virtual machine + text: |- + az connectedvmware vm disk update --controller-key "The controller key of the disk" \ + --disk-size "The disk size in GBs" --name "Name of the Disk" --resource-group \ + "resource group name" --vm-name "Name of the virtual machine" +""" + +helps[ + 'connectedvmware vm nic' +] = """ + type: group + short-summary: vm nic +""" + +helps[ + 'connectedvmware vm nic add' +] = """ + type: command + short-summary: "Add virtual nic to a virtual machine" + examples: + - name: Add virtual nic to a virtual machine + text: |- + az connectedvmware vm nic add --name "Name of the NIC" --network "Network Name or Id" \ + --resource-group "resource group name" --vm-name "Name of the virtual machine" +""" + +helps[ + 'connectedvmware vm nic delete' +] = """ + type: command + short-summary: "Delete virtual nic to a virtual machine" + examples: + - name: Delete virtual nic to a virtual machine + text: |- + az connectedvmware vm nic delete --nics "Names of the NICs" --resource-group \ + "resource group name" --vm-name "Name of the virtual machine" +""" + +helps[ + 'connectedvmware vm nic list' +] = """ + type: command + short-summary: "Retrieve a list of vm nic from given resource group name and vm name" + examples: + - name: Retrieve a list of vm nic + text: |- + az connectedvmware vm nic list --resource-group "resource group name" --vm-name \ + "Name of the virtual machine" +""" + +helps[ + 'connectedvmware vm nic show_command' +] = """ + type: command + short-summary: "Get details of a vm nic by it's name, resource-group and vm name" + examples: + - name: Get details of vm nic + text: |- + az connectedvmware vm nic show_command --name "Name of the NIC" --resource-group \ + "resource group name" --vm-name "Name of the virtual machine" """ helps[ @@ -316,7 +439,7 @@ - name: Delete virtual template text: |- az connectedvmware vm-template delete --ids "resource id" --name "vm template name" \ - --resource-group "resource group name" --subscription "subscription id" + --resource-group "resource group name" --subscription "Name or ID of subscription" """ helps[ @@ -339,7 +462,7 @@ - name: Get details of a vm template text: |- az connectedvmware vm-template show_command --ids "resource id" --name "vm template name" \ - --resource-group "resource group name" --subscription "subscription id" + --resource-group "resource group name" --subscription "Name or ID of subscription" """ helps[ @@ -365,10 +488,10 @@ 'connectedvmware inventory-item show_command' ] = """ type: command - short-summary: "Get details of a inventory item by inventory item, resource-group and vcenter name." + short-summary: "Get details of a inventory item by inventory item name or id, resource-group and vcenter name." examples: - name: Get details of a vm template text: |- - az connectedvmware inventory-item show_command --inventory-item-name "name of the inventory item" \ + az connectedvmware inventory-item show_command --inventory-item-name "inventory item name" \ --resource-group "resource group name" --vcenter-name "name of the vcenter" """ diff --git a/src/connectedvmware/azext_connectedvmware/_params.py b/src/connectedvmware/azext_connectedvmware/_params.py index baa074f5a3f..b28147d1b33 100644 --- a/src/connectedvmware/azext_connectedvmware/_params.py +++ b/src/connectedvmware/azext_connectedvmware/_params.py @@ -134,6 +134,11 @@ def load_arguments(self, _): options_list=['--arc-zone'], help="Name or ID of the Arc zone to deploy the vm.", ) + c.argument( + 'custom_location', + options_list=['--custom-location'], + help="Name or ID of the custom location that will manage this vm.", + ) c.argument( 'vcenter', options_list=['--vcenter'], @@ -261,7 +266,7 @@ def load_arguments(self, _): 'nic_names', options_list=['--nics'], nargs='+', help="Names of the NICs." ) - with self.argument_context('connectedvmware vm disk') as c: + with self.argument_context('connectedvmware vm disk add') as c: c.argument('disk_name', options_list=['--name', '-n'], help="Name of the Disk.") c.argument( 'vm_name', options_list=['--vm-name'], help="Name of the virtual machine." @@ -300,17 +305,71 @@ def load_arguments(self, _): help="Names of the Disks.", ) - with self.argument_context('connectedvmware inventory-item list') as c: + with self.argument_context('connectedvmware vm disk delete') as c: c.argument( - 'vcenter_name', options_list=['--vcenter-name'], help="Name of the vCenter." + 'vm_name', options_list=['--vm-name'], help="Name of the virtual machine." + ) + c.argument( + 'disk_names', + options_list=['--disks'], + nargs='+', + help="Names of the Disks.", + ) + + with self.argument_context('connectedvmware vm disk list') as c: + c.argument( + 'vm_name', options_list=['--vm-name'], help="Name of the virtual machine." + ) + + with self.argument_context('connectedvmware vm disk show_command') as c: + c.argument('disk_name', options_list=['--name', '-n'], help="Name of the Disk.") + c.argument( + 'vm_name', options_list=['--vm-name'], help="Name of the virtual machine." + ) + + with self.argument_context('connectedvmware vm disk update') as c: + c.argument('disk_name', options_list=['--name', '-n'], help="Name of the Disk.") + c.argument( + 'vm_name', options_list=['--vm-name'], help="Name of the virtual machine." + ) + c.argument( + 'disk_size', + type=int, + options_list=['--disk-size'], + help="The disk size in GBs.", + ) + c.argument( + 'disk_mode', options_list=['--disk-mode'], help="The mode of the disk." + ) + c.argument( + 'controller_key', + type=int, + options_list=['--controller-key'], + help="The controller key of the disk.", + ) + c.argument( + 'unit_number', + type=int, + options_list=['--unit-number'], + help="The unit number of the disk.", + ) + c.argument( + 'device_key', + type=int, + options_list=['--device-key'], + help="The device key for the disk.", ) - with self.argument_context('connectedvmware inventory-item show') as c: + with self.argument_context('connectedvmware inventory-item list') as c: c.argument( 'vcenter_name', options_list=['--vcenter-name'], help="Name of the vCenter." ) + + with self.argument_context('connectedvmware inventory-item show_command') as c: c.argument( 'inventory_item_name', - options_list=['--inventory-item-name'], - help="Name of the inventory item.", + options_list=['--inventory-item-name'], help="Name of the inventory item.", + ) + c.argument( + 'vcenter_name', options_list=['--vcenter-name'], help="Name of the vCenter.", ) diff --git a/src/connectedvmware/azext_connectedvmware/custom.py b/src/connectedvmware/azext_connectedvmware/custom.py index f468c8b9ab9..ecc05276ce6 100644 --- a/src/connectedvmware/azext_connectedvmware/custom.py +++ b/src/connectedvmware/azext_connectedvmware/custom.py @@ -1231,7 +1231,7 @@ def show_inventory_item( client: InventoryItemsOperations, resource_group_name, vcenter_name, - inventory_item_name, + inventory_item_name ): return client.get(resource_group_name, vcenter_name, inventory_item_name) From 4dcd3b76c2b91ee112dac3cf46032eea9f0e99fe Mon Sep 17 00:00:00 2001 From: Santosh Mishra Date: Mon, 10 May 2021 23:48:35 +0530 Subject: [PATCH 04/13] Fixes issue and added a simple test --- src/connectedvmware/.github/CODEOWNERS | 195 ++++++++++++++++++ src/connectedvmware/README.rst | 5 + .../test_connectedvmware_vcenter.yaml | 48 +++++ .../latest/test_connectedvmware_scenario.py | 14 +- 4 files changed, 257 insertions(+), 5 deletions(-) create mode 100644 src/connectedvmware/.github/CODEOWNERS create mode 100644 src/connectedvmware/README.rst create mode 100644 src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_vcenter.yaml diff --git a/src/connectedvmware/.github/CODEOWNERS b/src/connectedvmware/.github/CODEOWNERS new file mode 100644 index 00000000000..940c7ae84e9 --- /dev/null +++ b/src/connectedvmware/.github/CODEOWNERS @@ -0,0 +1,195 @@ +# See for instructions on this file https://help.github.com/articles/about-codeowners/ + +/linter_exclusions.yml @kairu-ms @fengzhou-msft + +/src/index.json @fengzhou-msft @qwordy @houk-ms @kairu-ms @jsntcy @Juliehzl @jiasli @zhoxing-ms @evelyn-ys @msyyc @xfz11 @08nholloway + +/src/footprint/ @jonunezd @Diego-Perez-Botero + +/src/image-copy/ @tamirkamara + +/src/webapp/ @panchagnula @dannysongg + +/src/aem/ @qwordy + +/src/subscription/ @wilcobmsft + +/src/alias/ @Juliehzl + +/src/managementpartner/ @jeffrey-ace + +/src/eventgrid/ @kalyanaj + +/src/storage-preview/ @Juliehzl + +/src/db-up/ @Juliehzl + +/src/dev-spaces/ @amsoedal + +/src/dms-preview/ @temandr + +/src/express-route-cross-connection/ @kairu-ms @msyyc + +/src/application-insights/ @alexeldeib + +/src/log-analytics/ @alexeldeib + +/src/mesh/ @linggengmsft @jeffj6123 + +/src/mixed-reality/ @xiangyul + +/src/resource-graph/ @demyanenko @amirhbk @chiragg4u + +/src/azure-firewall/ @kairu-ms @msyyc + +/src/virtual-network-tap/ @kairu-ms @msyyc + +/src/virtual-wan/ @kairu-ms @msyyc + +/src/front-door/ @pichandwork + +/src/interactive/ @jiasli + +/src/aks-preview/ @zqingqing1 @gtracer @xizhamsft @andyliuliming + +/src/vm-repair/ @swbae31 + +/src/netappfiles-preview/ @b-lefr + +/src/healthcareapis/ @fengzhou-msft @iviark + +/src/healthbot/ @guy-microsoft + +/src/hack/ @geektrainer + +/src/internet-analyzer/ @jsntcy + +/src/spring-cloud/ @peizhou298 + +/src/peering/ @jsntcy + +/src/connectedmachine/ @farehar + +/src/ip-group/ @msyyc + +/src/connectedk8s/ @akashkeshari @alphaWizard + +/src/storagesync/ @jsntcy + +/src/maintenance/ @gautamd-ms + +/src/ai-examples/ @mirdaki + +/src/notification-hub/ @fengzhou-msft + +/src/connection-monitor-preview/ @msyyc + +/src/support/ @mit2nil @shahbj79 @RudraSharma93Microsoft + +/src/alertsmanagement/ @qwordy + +/src/stream-analytics/ @houk-ms + +/src/databricks/ @fengzhou-msft @xfz11 + +/src/powerbidedicated/ @Juliehzl @tarostok @evelyn-ys + +/src/blueprint/ @fengzhou-msft + +/src/storage-blob-preview/ @Juliehzl + +/src/logic/ @jsntcy @msyyc @kairu + +/src/hardware-security-modules/ @bquantump + +/src/databox/ @jsntcy + +/src/datadog/ @limingu + +/src/hpc-cache/ @zhoxing-ms + +/src/timeseriesinsights/ @jiasli + +/src/portal/ @YalinLi0312 + +/src/import-export/ @xfz11 + +/src/account/ @jiasli @fengzhou-msft + +/src/quantum/ @anpaz-msft + +/src/datashare/ @fengzhou-msft + +/src/ssh/ @rlrossiter @danybeam @fengzhou-msft @N6UDP + +/src/k8sconfiguration/ @NarayanThiru @jonathan-innis + +/src/k8s-configuration/ @NarayanThiru @jonathan-innis + +/src/k8s-extension/ @NarayanThiru @jonathan-innis + +/src/log-analytics-solution/ @zhoxing-ms + +/src/kusto/ @ilayr @orhasban @astauben + +/src/custom-providers/ @jsntcy + +/src/costmanagement/ @msyyc + +/src/datafactory/ @qiaozha @fengzhou-msft @qwordy + +/src/blockchain/ @jsntcy + +/src/codespaces/ @derekbekoe + +/src/desktopvirtualization/ @changlong-liu + +/src/attestation/ @YalinLi0312 @houk-ms + +/src/guestconfig/ @gehuan + +/src/swiftlet/ @qwordy + +/src/maintenance/ @sotaneja + +/src/scheduled-query/ @jsntcy + +/src/cli-translator/ @houk-ms @fengzhou-msft + +/src/vmware/ @fengzhou-msft @qwordy + +/src/stack-hci/ @zhoxing-ms + +/src/acrtransfer/ @mabenedi + +/src/securityinsight/ @houk-ms + +/src/communication/ @msyyc + +/src/automation/ @qwordy + +/src/monitor-control-service/ @jsntcy @msyyc @kairu-ms + +/src/rdbms-connect/ @mjain2 @Juliehzl + +/src/confluent/ @fengzhou-msft + +/src/offazure/ @houk-ms + +/src/resource-mover/ @houk-ms + +/src/providerhub/ @wwendyc @vikashj + +/src/cosmosdb-preview/ @wmengmsft @MehaKaushik @kavskalyan + +/src/ad/ @evelyn-ys + +/src/next/ @zhoxing-ms + +/src/redisenterprise/ @greenms + +/src/cloudservice/ @qwordy + +/src/webpubsub/ @zackliu + +/src/connectedvmware/ @sanmishra18 diff --git a/src/connectedvmware/README.rst b/src/connectedvmware/README.rst new file mode 100644 index 00000000000..9a24507eef3 --- /dev/null +++ b/src/connectedvmware/README.rst @@ -0,0 +1,5 @@ +Microsoft Azure CLI 'connectedvmware' Extension +========================================== + +This package is for the 'connectedvmware' extension. +i.e. 'az connectedvmware' diff --git a/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_vcenter.yaml b/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_vcenter.yaml new file mode 100644 index 00000000000..facd579f37c --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_vcenter.yaml @@ -0,0 +1,48 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware vcenter list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVMwarevSphere/vcenters?api-version=2020-10-01-preview + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVMwarevSphere/vcenters/santosh-test-vcenter-onperm","name":"santosh-test-vcenter-onperm","type":"microsoft.connectedvmwarevsphere/vcenters","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/santosh-rg/providers/microsoft.extendedlocation/customlocations/santosh-test-cl-onperm"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-04-23T16:02:14.8484378Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-04-23T16:02:45.3494224Z"},"properties":{"credentials":{"username":"administrator@vsphere.local"},"fqdn":"arcvmw-vcenter.fareast.corp.microsoft.com","port":443,"provisioningState":"Succeeded","customResourceName":"b580832e-95c8-449a-b0c9-df9c3b5aa1d6","uuid":"b580832e-95c8-449a-b0c9-df9c3b5aa1d6","version":"6.7.0","instanceUuid":"87315321-c3ed-486b-842b-96832ce6de46","connectionStatus":"Connected"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '1148' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 10 May 2021 17:31:41 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +version: 1 diff --git a/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py b/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py index 2ffdb1394f2..3018685764b 100644 --- a/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py +++ b/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py @@ -15,9 +15,13 @@ class ConnectedvmwareScenarioTest(ScenarioTest): - @ResourceGroupPreparer(name_prefix='cli_test_connectedvmware') - def test_connectedvmware_vcenter(self, resource_group): + + def test_connectedvmware_vcenter(self): + resource_group = "santosh-rg" + location = "" + custom_loc = "" - self.kwargs.update({'name': 'test1'}) - - # raise CLIError('TODO') + # count the list of vcenter resources in this resource group + count = len(self.cmd('az connectedvmware vcenter list --resource-group santosh-rg').get_output_in_json()) + # vcenter count list should report 1 + self.assertEqual(count, 1, 'cluster count expected to be 1') From 8816603546bff3e82802dd7127b0a58225257338 Mon Sep 17 00:00:00 2001 From: Santosh Mishra Date: Tue, 11 May 2021 12:12:09 +0530 Subject: [PATCH 05/13] fix some general issue --- src/connectedvmware/.github/CODEOWNERS | 195 ------------------ .../latest/test_connectedvmware_scenario.py | 6 +- src/service_name.json | 5 + 3 files changed, 6 insertions(+), 200 deletions(-) delete mode 100644 src/connectedvmware/.github/CODEOWNERS diff --git a/src/connectedvmware/.github/CODEOWNERS b/src/connectedvmware/.github/CODEOWNERS deleted file mode 100644 index 940c7ae84e9..00000000000 --- a/src/connectedvmware/.github/CODEOWNERS +++ /dev/null @@ -1,195 +0,0 @@ -# See for instructions on this file https://help.github.com/articles/about-codeowners/ - -/linter_exclusions.yml @kairu-ms @fengzhou-msft - -/src/index.json @fengzhou-msft @qwordy @houk-ms @kairu-ms @jsntcy @Juliehzl @jiasli @zhoxing-ms @evelyn-ys @msyyc @xfz11 @08nholloway - -/src/footprint/ @jonunezd @Diego-Perez-Botero - -/src/image-copy/ @tamirkamara - -/src/webapp/ @panchagnula @dannysongg - -/src/aem/ @qwordy - -/src/subscription/ @wilcobmsft - -/src/alias/ @Juliehzl - -/src/managementpartner/ @jeffrey-ace - -/src/eventgrid/ @kalyanaj - -/src/storage-preview/ @Juliehzl - -/src/db-up/ @Juliehzl - -/src/dev-spaces/ @amsoedal - -/src/dms-preview/ @temandr - -/src/express-route-cross-connection/ @kairu-ms @msyyc - -/src/application-insights/ @alexeldeib - -/src/log-analytics/ @alexeldeib - -/src/mesh/ @linggengmsft @jeffj6123 - -/src/mixed-reality/ @xiangyul - -/src/resource-graph/ @demyanenko @amirhbk @chiragg4u - -/src/azure-firewall/ @kairu-ms @msyyc - -/src/virtual-network-tap/ @kairu-ms @msyyc - -/src/virtual-wan/ @kairu-ms @msyyc - -/src/front-door/ @pichandwork - -/src/interactive/ @jiasli - -/src/aks-preview/ @zqingqing1 @gtracer @xizhamsft @andyliuliming - -/src/vm-repair/ @swbae31 - -/src/netappfiles-preview/ @b-lefr - -/src/healthcareapis/ @fengzhou-msft @iviark - -/src/healthbot/ @guy-microsoft - -/src/hack/ @geektrainer - -/src/internet-analyzer/ @jsntcy - -/src/spring-cloud/ @peizhou298 - -/src/peering/ @jsntcy - -/src/connectedmachine/ @farehar - -/src/ip-group/ @msyyc - -/src/connectedk8s/ @akashkeshari @alphaWizard - -/src/storagesync/ @jsntcy - -/src/maintenance/ @gautamd-ms - -/src/ai-examples/ @mirdaki - -/src/notification-hub/ @fengzhou-msft - -/src/connection-monitor-preview/ @msyyc - -/src/support/ @mit2nil @shahbj79 @RudraSharma93Microsoft - -/src/alertsmanagement/ @qwordy - -/src/stream-analytics/ @houk-ms - -/src/databricks/ @fengzhou-msft @xfz11 - -/src/powerbidedicated/ @Juliehzl @tarostok @evelyn-ys - -/src/blueprint/ @fengzhou-msft - -/src/storage-blob-preview/ @Juliehzl - -/src/logic/ @jsntcy @msyyc @kairu - -/src/hardware-security-modules/ @bquantump - -/src/databox/ @jsntcy - -/src/datadog/ @limingu - -/src/hpc-cache/ @zhoxing-ms - -/src/timeseriesinsights/ @jiasli - -/src/portal/ @YalinLi0312 - -/src/import-export/ @xfz11 - -/src/account/ @jiasli @fengzhou-msft - -/src/quantum/ @anpaz-msft - -/src/datashare/ @fengzhou-msft - -/src/ssh/ @rlrossiter @danybeam @fengzhou-msft @N6UDP - -/src/k8sconfiguration/ @NarayanThiru @jonathan-innis - -/src/k8s-configuration/ @NarayanThiru @jonathan-innis - -/src/k8s-extension/ @NarayanThiru @jonathan-innis - -/src/log-analytics-solution/ @zhoxing-ms - -/src/kusto/ @ilayr @orhasban @astauben - -/src/custom-providers/ @jsntcy - -/src/costmanagement/ @msyyc - -/src/datafactory/ @qiaozha @fengzhou-msft @qwordy - -/src/blockchain/ @jsntcy - -/src/codespaces/ @derekbekoe - -/src/desktopvirtualization/ @changlong-liu - -/src/attestation/ @YalinLi0312 @houk-ms - -/src/guestconfig/ @gehuan - -/src/swiftlet/ @qwordy - -/src/maintenance/ @sotaneja - -/src/scheduled-query/ @jsntcy - -/src/cli-translator/ @houk-ms @fengzhou-msft - -/src/vmware/ @fengzhou-msft @qwordy - -/src/stack-hci/ @zhoxing-ms - -/src/acrtransfer/ @mabenedi - -/src/securityinsight/ @houk-ms - -/src/communication/ @msyyc - -/src/automation/ @qwordy - -/src/monitor-control-service/ @jsntcy @msyyc @kairu-ms - -/src/rdbms-connect/ @mjain2 @Juliehzl - -/src/confluent/ @fengzhou-msft - -/src/offazure/ @houk-ms - -/src/resource-mover/ @houk-ms - -/src/providerhub/ @wwendyc @vikashj - -/src/cosmosdb-preview/ @wmengmsft @MehaKaushik @kavskalyan - -/src/ad/ @evelyn-ys - -/src/next/ @zhoxing-ms - -/src/redisenterprise/ @greenms - -/src/cloudservice/ @qwordy - -/src/webpubsub/ @zackliu - -/src/connectedvmware/ @sanmishra18 diff --git a/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py b/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py index 3018685764b..f250f3cc37c 100644 --- a/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py +++ b/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py @@ -15,12 +15,8 @@ class ConnectedvmwareScenarioTest(ScenarioTest): - - def test_connectedvmware_vcenter(self): - resource_group = "santosh-rg" - location = "" - custom_loc = "" + def test_connectedvmware_vcenter(self): # count the list of vcenter resources in this resource group count = len(self.cmd('az connectedvmware vcenter list --resource-group santosh-rg').get_output_in_json()) # vcenter count list should report 1 diff --git a/src/service_name.json b/src/service_name.json index 79f89aee73e..93206b176c0 100644 --- a/src/service_name.json +++ b/src/service_name.json @@ -363,5 +363,10 @@ "Command": "az webpubsub", "AzureServiceName": "Azure Web PubSub", "URL": "" + }, + { + "Command": "az connectedvmware", + "AzureServiceName": "Azure Arc for VMware PrivateCloud", + "URL": "" } ] From 97c67e177d4609cf8c345f76f25da393c57bd460 Mon Sep 17 00:00:00 2001 From: Santosh Mishra Date: Tue, 11 May 2021 12:26:05 +0530 Subject: [PATCH 06/13] Updated CODEOWNERS --- .github/CODEOWNERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 63b4a123364..940c7ae84e9 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -191,3 +191,5 @@ /src/cloudservice/ @qwordy /src/webpubsub/ @zackliu + +/src/connectedvmware/ @sanmishra18 From c7448d6001aa5b0780be5d38d0957c4e070fbcec Mon Sep 17 00:00:00 2001 From: Santosh Mishra Date: Thu, 13 May 2021 12:57:50 +0530 Subject: [PATCH 07/13] Added more test cases --- .../test_connectedvmware_resourcePool.yaml | 48 ++++++++++++++++ .../test_connectedvmware_vcenter.yaml | 2 +- .../test_connectedvmware_virtualNetwork.yaml | 48 ++++++++++++++++ .../recordings/test_connectedvmware_vm.yaml | 57 +++++++++++++++++++ .../latest/test_connectedvmware_scenario.py | 28 ++++++++- 5 files changed, 181 insertions(+), 2 deletions(-) create mode 100644 src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_resourcePool.yaml create mode 100644 src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_virtualNetwork.yaml create mode 100644 src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_vm.yaml diff --git a/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_resourcePool.yaml b/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_resourcePool.yaml new file mode 100644 index 00000000000..62f214a6786 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_resourcePool.yaml @@ -0,0 +1,48 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware resource-pool list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools?api-version=2020-10-01-preview + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/testrspl001","name":"testrspl001","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/santosh-rg/providers/microsoft.extendedlocation/customlocations/santosh-test-cl-onperm"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-04-23T18:46:52.8966978Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-04-23T18:47:07.5931765Z"},"properties":{"inventoryItemId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/santosh-test-vcenter-onperm/InventoryItems/resgroup-1033","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/santosh-test-vcenter-onperm","moRefId":"resgroup-1033","provisioningState":"Succeeded","customResourceName":"5c0ed909-4008-4718-a0c5-87578a57c24e","uuid":"5c0ed909-4008-4718-a0c5-87578a57c24e","moName":"pm-demo-resourcepool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}]}' + headers: + cache-control: + - no-cache + content-length: + - '1410' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 13 May 2021 07:23:43 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +version: 1 diff --git a/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_vcenter.yaml b/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_vcenter.yaml index facd579f37c..25361ae252d 100644 --- a/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_vcenter.yaml +++ b/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_vcenter.yaml @@ -27,7 +27,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 10 May 2021 17:31:41 GMT + - Thu, 13 May 2021 07:23:44 GMT expires: - '-1' pragma: diff --git a/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_virtualNetwork.yaml b/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_virtualNetwork.yaml new file mode 100644 index 00000000000..5e2fd1bf086 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_virtualNetwork.yaml @@ -0,0 +1,48 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware virtual-network list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks?api-version=2020-10-01-preview + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/testntw001","name":"testntw001","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/santosh-rg/providers/microsoft.extendedlocation/customlocations/santosh-test-cl-onperm"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-04-23T19:16:26.6574315Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-04-23T19:16:37.9491519Z"},"properties":{"inventoryItemId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/santosh-test-vcenter-onperm/InventoryItems/dvportgroup-3195","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/santosh-test-vcenter-onperm","moRefId":"dvportgroup-3195","provisioningState":"Succeeded","customResourceName":"41a8b474-5fa1-43e0-8a83-60eead19ebc6","uuid":"41a8b474-5fa1-43e0-8a83-60eead19ebc6","moName":"DSwitch-testsubb-DVUplinks-3194"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '1344' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 13 May 2021 07:23:53 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +version: 1 diff --git a/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_vm.yaml b/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_vm.yaml new file mode 100644 index 00000000000..f3c8f9c24a9 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_vm.yaml @@ -0,0 +1,57 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware vm list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines?api-version=2020-10-01-preview + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/testvm001","name":"testvm001","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/santosh-rg/providers/microsoft.extendedlocation/customlocations/santosh-test-cl-onperm"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-04-23T19:53:04.0917074Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-04-23T19:53:38.3705126Z"},"properties":{"inventoryItemId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/santosh-test-vcenter-onperm/InventoryItems/vm-2146","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/santosh-test-vcenter-onperm","provisioningState":"Succeeded","customResourceName":"f9b81181-b670-4b9a-990c-3fa2c030ab5e","uuid":"f9b81181-b670-4b9a-990c-3fa2c030ab5e","vmId":"f9b81181-b670-4b9a-990c-3fa2c030ab5e","networkProfile":{"networkInterfaces":[{"label":"Network + adapter 1","macAddress":"00:50:56:af:5e:eb","networkMoRefId":"network-12","networkMoName":"VM + Network","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset","ipAddress":"10.150.172.216","subnetMask":"255.255.248.0","ipAddressInfo":[{"ipAddress":"10.150.172.216","subnetMask":"255.255.248.0"},{"ipAddress":"2404:f801:4800:18:250:56ff:feaf:5eeb","subnetMask":"ffff:ffff:ffff:ffff:0000:0000:0000:0000"},{"ipAddress":"fe80::250:56ff:feaf:5eeb","subnetMask":"ffff:ffff:ffff:ffff:0000:0000:0000:0000"}]}},{"label":"Network + adapter 2","macAddress":"00:50:56:af:56:69","networkMoRefId":"network-12","networkMoName":"VM + Network","nicType":"vmxnet3","deviceKey":4001,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset","ipAddress":"10.150.172.217","subnetMask":"255.255.248.0","ipAddressInfo":[{"ipAddress":"10.150.172.217","subnetMask":"255.255.248.0"},{"ipAddress":"2404:f801:4800:18:250:56ff:feaf:5669","subnetMask":"ffff:ffff:ffff:ffff:0000:0000:0000:0000"},{"ipAddress":"fe80::250:56ff:feaf:5669","subnetMask":"ffff:ffff:ffff:ffff:0000:0000:0000:0000"}]}}]},"storageProfile":{"disks":[{"diskObjectId":"9-2000","label":"Hard + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"niarodemo1","osType":"Linux","osName":"Ubuntu + Linux (64-bit)","toolsRunningStatus":"guestToolsNotRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":false,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":false},"instanceUuid":"ba2fded7-1524-4e00-a183-bde472883510","moRefId":"vm-2146","moName":"niarodemo1","folderPath":"Datacenter","powerState":"poweredOff"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVMwarevSphere/VirtualMachines/vm-3461","name":"vm-3461","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/santosh-rg/providers/microsoft.extendedlocation/customlocations/santosh-test-cl-onperm"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-04T08:29:26.1021939Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-04T08:29:58.9859806Z"},"properties":{"inventoryItemId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/santosh-test-vcenter-onperm/InventoryItems/vm-3461","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/santosh-test-vcenter-onperm","provisioningState":"Succeeded","customResourceName":"00a45f80-0731-403c-9ebd-3bbb4ad7197e","uuid":"00a45f80-0731-403c-9ebd-3bbb4ad7197e","vmId":"00a45f80-0731-403c-9ebd-3bbb4ad7197e","networkProfile":{"networkInterfaces":[{"label":"Network + adapter 1","ipAddresses":["10.150.92.249","10.150.88.82","fe80::250:56ff:feaf:c97d"],"macAddress":"00:50:56:af:c9:7d","networkMoRefId":"network-51","networkMoName":"NIC2","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset","gateway":["10.150.88.1"],"ipAddress":"10.150.92.249","subnetMask":"255.255.248.0","ipAddressInfo":[{"ipAddress":"10.150.92.249","subnetMask":"255.255.248.0"},{"ipAddress":"10.150.88.82","subnetMask":"255.255.255.255"},{"ipAddress":"fe80::250:56ff:feaf:c97d","subnetMask":"ffff:ffff:ffff:ffff:0000:0000:0000:0000"}]}}]},"storageProfile":{"disks":[{"diskObjectId":"2880-2000","label":"Hard + disk 1","diskSizeGB":97,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogicsas","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"28cd668da43c8b6735991efc7fb825ceaa189dd5e84a5-control-plane-0","osType":"Linux","osName":"Other + 4.x or later Linux (64-bit)","toolsRunningStatus":"guestToolsRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11296"},"hardwareProfile":{"memorySizeMB":16384,"numCPUs":4,"numCoresPerSocket":2,"cpuHotAddEnabled":false,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":false},"instanceUuid":"422f5d77-2193-9786-f957-00b6be747055","moRefId":"vm-3461","moName":"28cd668da43c8b6735991efc7fb825ceaa189dd5e84a5-control-plane-0","folderPath":"Datacenter","powerState":"poweredOn"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '6131' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 13 May 2021 07:23:44 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +version: 1 diff --git a/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py b/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py index f250f3cc37c..d6c303318c7 100644 --- a/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py +++ b/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py @@ -17,7 +17,33 @@ class ConnectedvmwareScenarioTest(ScenarioTest): def test_connectedvmware_vcenter(self): + resource_group = "santosh-rg" + # count the list of vcenter resources in this resource group - count = len(self.cmd('az connectedvmware vcenter list --resource-group santosh-rg').get_output_in_json()) + count = len(self.cmd('az connectedvmware vcenter list --resource-group ' + resource_group).get_output_in_json()) # vcenter count list should report 1 self.assertEqual(count, 1, 'cluster count expected to be 1') + + def test_connectedvmware_resourcePool(self): + resource_group = "santosh-rg" + + # count the resource-pool resources in this resource group + count = len(self.cmd('az connectedvmware resource-pool list --resource-group ' + resource_group).get_output_in_json()) + # resource-pool count should be greater than 1 + assert count >= 1 + + def test_connectedvmware_virtualNetwork(self): + resource_group = "santosh-rg" + + # count the virtual-network resources in this resource group + count = len(self.cmd('az connectedvmware virtual-network list --resource-group ' + resource_group).get_output_in_json()) + # virtual-network count should be greater than or equal to 1 + assert count >= 1 + + def test_connectedvmware_vm(self): + resource_group = "santosh-rg" + + # count the list of vm resources in this resource group + count = len(self.cmd('az connectedvmware vm list --resource-group ' + resource_group).get_output_in_json()) + # vm count should be greater than or equal 1 + assert count >= 1 From 85dad4498d9e00232621619c7a3cad4effbace05 Mon Sep 17 00:00:00 2001 From: Santosh Mishra Date: Tue, 18 May 2021 19:20:02 +0530 Subject: [PATCH 08/13] Added more test. --- src/connectedvmware/README.md | 4 +- .../azext_connectedvmware/_help.py | 4 +- .../recordings/test_connectedvmware.yaml | 1188 +++++++++++++++++ .../test_connectedvmware_resourcePool.yaml | 48 - .../test_connectedvmware_vcenter.yaml | 48 - .../test_connectedvmware_virtualNetwork.yaml | 48 - .../recordings/test_connectedvmware_vm.yaml | 57 - .../latest/test_connectedvmware_scenario.py | 92 +- 8 files changed, 1261 insertions(+), 228 deletions(-) create mode 100644 src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware.yaml delete mode 100644 src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_resourcePool.yaml delete mode 100644 src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_vcenter.yaml delete mode 100644 src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_virtualNetwork.yaml delete mode 100644 src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_vm.yaml diff --git a/src/connectedvmware/README.md b/src/connectedvmware/README.md index fb06b1a936d..a9e613aa3e1 100644 --- a/src/connectedvmware/README.md +++ b/src/connectedvmware/README.md @@ -1,6 +1,6 @@ # Microsoft Azure CLI ConnectedVMware Extension # -The Azure CLI extension for [Azure Arc VMware Service](https://azure.microsoft.com/en-us/services/azure-arc) is an extension for Azure CLI 2.0. +The Azure CLI extension for [Azure Arc VMware Service](https://github.com/Azure/azure-arc-enabled-vmware-vsphere-preview/blob/main/docs/overview.md) is an extension for Azure CLI 2.0. ## Install ``` sh @@ -8,7 +8,7 @@ az extension add --name connectedvmware ``` ## Usage -See the [extension reference documenation](https://azure.microsoft.com/en-us/services/azure-arc). +See the [extension reference documenation](https://github.com/Azure/azure-arc-enabled-vmware-vsphere-preview/blob/main/docs/overview.md). ``` sh az connectedvmware --help diff --git a/src/connectedvmware/azext_connectedvmware/_help.py b/src/connectedvmware/azext_connectedvmware/_help.py index 780fad0643b..14116636dd7 100644 --- a/src/connectedvmware/azext_connectedvmware/_help.py +++ b/src/connectedvmware/azext_connectedvmware/_help.py @@ -426,8 +426,8 @@ text: |- az connectedvmware vm-template create --custom-location "custom location name" \ --location "region name" --mo-ref-id "mo-ref id of the resource in vc" --name \ - "vm template name" --resource-group "resource group name" --vcenter \ - "name or id of the vcenter" --inventory-item "inventory item name or id" + "vm template name" --resource-group "resource group name" --vcenter "name or id of \ + the vcenter" --inventory-item "inventory item name or id" """ helps[ diff --git a/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware.yaml b/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware.yaml new file mode 100644 index 00000000000..2b15b541b35 --- /dev/null +++ b/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware.yaml @@ -0,0 +1,1188 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware vcenter show_command + Connection: + - keep-alive + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/vcenters/azcli-test-vcenter-avs?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/vcenters/azcli-test-vcenter-avs","name":"azcli-test-vcenter-avs","type":"microsoft.connectedvmwarevsphere/vcenters","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/azcli-test-rg/providers/microsoft.extendedlocation/customlocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-17T11:38:14.9072191Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-17T11:38:32.5791082Z"},"properties":{"credentials":{"username":"cloudadmin@vsphere.local"},"fqdn":"10.160.0.2","port":443,"provisioningState":"Succeeded","customResourceName":"fc8fce52-028e-4b61-b931-9a5902ab5a81","uuid":"fc8fce52-028e-4b61-b931-9a5902ab5a81","version":"6.7.0","instanceUuid":"4ea21e20-2883-44e4-9224-0a48dfff2a81","connectionStatus":"Connected"}}' + headers: + cache-control: + - no-cache + content-length: + - '1093' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 13:37:27 GMT + etag: + - '"03005e99-0000-3400-0000-60a255b90000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware vcenter list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/vcenters?api-version=2020-10-01-preview + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/vcenters/azcli-test-vcenter-avs","name":"azcli-test-vcenter-avs","type":"microsoft.connectedvmwarevsphere/vcenters","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/azcli-test-rg/providers/microsoft.extendedlocation/customlocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-17T11:38:14.9072191Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-17T11:38:32.5791082Z"},"properties":{"credentials":{"username":"cloudadmin@vsphere.local"},"fqdn":"10.160.0.2","port":443,"provisioningState":"Succeeded","customResourceName":"fc8fce52-028e-4b61-b931-9a5902ab5a81","uuid":"fc8fce52-028e-4b61-b931-9a5902ab5a81","version":"6.7.0","instanceUuid":"4ea21e20-2883-44e4-9224-0a48dfff2a81","connectionStatus":"Connected"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '1105' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 13:37:29 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus2euap", "extendedLocation": {"type": "CustomLocation", + "name": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"}, + "properties": {"vCenterId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs", + "moRefId": "resgroup-5034"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware resource-pool create + Connection: + - keep-alive + Content-Length: + - '454' + Content-Type: + - application/json + ParameterSetName: + - -g -l --custom-location --vcenter --mo-ref-id --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T13:37:32.110869Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-18T13:37:32.110869Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Accepted"}}' + headers: + api-supported-versions: + - 2019-12-20-privatepreview, 2020-10-01-preview + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/b7ed1ebe-676a-4053-bb5a-fb553d53f325?api-version=2020-10-01-preview + cache-control: + - no-cache + content-length: + - '970' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 13:37:40 GMT + etag: + - '"0000e76c-0000-3400-0000-60a3c3240000"' + expires: + - '-1' + location: + - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/ResourcePools/azcli-test-resource-pool + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware resource-pool create + Connection: + - keep-alive + ParameterSetName: + - -g -l --custom-location --vcenter --mo-ref-id --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/b7ed1ebe-676a-4053-bb5a-fb553d53f325?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/b7ed1ebe-676a-4053-bb5a-fb553d53f325","name":"b7ed1ebe-676a-4053-bb5a-fb553d53f325","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","status":"Succeeded","startTime":"2021-05-18T13:37:40.130615Z","endTime":"2021-05-18T13:37:50.1361064Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '475' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 13:38:10 GMT + etag: + - '"02001e2f-0000-3400-0000-60a3c32e0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware resource-pool create + Connection: + - keep-alive + ParameterSetName: + - -g -l --custom-location --vcenter --mo-ref-id --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T13:37:32.110869Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T13:37:49.9305901Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Succeeded","customResourceName":"134d3260-3e5c-498b-9b21-c9a4688bb62a","uuid":"134d3260-3e5c-498b-9b21-c9a4688bb62a","moName":"SanmishraResourcePool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}' + headers: + cache-control: + - no-cache + content-length: + - '1216' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 13:38:10 GMT + etag: + - '"0000ed6c-0000-3400-0000-60a3c32e0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware resource-pool show_command + Connection: + - keep-alive + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T13:37:32.110869Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T13:37:49.9305901Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Succeeded","customResourceName":"134d3260-3e5c-498b-9b21-c9a4688bb62a","uuid":"134d3260-3e5c-498b-9b21-c9a4688bb62a","moName":"SanmishraResourcePool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}' + headers: + cache-control: + - no-cache + content-length: + - '1216' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 13:38:12 GMT + etag: + - '"0000ed6c-0000-3400-0000-60a3c32e0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware resource-pool list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools?api-version=2020-10-01-preview + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T13:37:32.110869Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T13:37:49.9305901Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Succeeded","customResourceName":"134d3260-3e5c-498b-9b21-c9a4688bb62a","uuid":"134d3260-3e5c-498b-9b21-c9a4688bb62a","moName":"SanmishraResourcePool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}]}' + headers: + cache-control: + - no-cache + content-length: + - '1228' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 13:38:14 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus2euap", "extendedLocation": {"type": "CustomLocation", + "name": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"}, + "properties": {"vCenterId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs", + "moRefId": "network-o761"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware virtual-network create + Connection: + - keep-alive + Content-Length: + - '453' + Content-Type: + - application/json + ParameterSetName: + - -g -l --custom-location --vcenter --mo-ref-id --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T13:38:16.9571675Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-18T13:38:16.9571675Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Accepted"}}' + headers: + api-supported-versions: + - 2019-12-20-privatepreview, 2020-10-01-preview + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/21173c74-0fe1-4935-8500-b92a94b84842?api-version=2020-10-01-preview + cache-control: + - no-cache + content-length: + - '979' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 13:38:19 GMT + etag: + - '"0100a3f8-0000-3400-0000-60a3c34b0000"' + expires: + - '-1' + location: + - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/VirtualNetworks/azcli-test-virtual-network + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware virtual-network create + Connection: + - keep-alive + ParameterSetName: + - -g -l --custom-location --vcenter --mo-ref-id --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/21173c74-0fe1-4935-8500-b92a94b84842?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/21173c74-0fe1-4935-8500-b92a94b84842","name":"21173c74-0fe1-4935-8500-b92a94b84842","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","status":"Succeeded","startTime":"2021-05-18T13:38:18.8619425Z","endTime":"2021-05-18T13:38:23.3272266Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '480' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 13:38:49 GMT + etag: + - '"0200202f-0000-3400-0000-60a3c34f0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware virtual-network create + Connection: + - keep-alive + ParameterSetName: + - -g -l --custom-location --vcenter --mo-ref-id --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T13:38:16.9571675Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T13:38:23.1435182Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Succeeded","customResourceName":"325f22b1-c59b-4a62-8c7d-11691a5aeb8c","uuid":"325f22b1-c59b-4a62-8c7d-11691a5aeb8c","moName":"segment-2"}}' + headers: + cache-control: + - no-cache + content-length: + - '1127' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 13:38:50 GMT + etag: + - '"0100a9f8-0000-3400-0000-60a3c34f0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware virtual-network show_command + Connection: + - keep-alive + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T13:38:16.9571675Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T13:38:23.1435182Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Succeeded","customResourceName":"325f22b1-c59b-4a62-8c7d-11691a5aeb8c","uuid":"325f22b1-c59b-4a62-8c7d-11691a5aeb8c","moName":"segment-2"}}' + headers: + cache-control: + - no-cache + content-length: + - '1127' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 13:38:52 GMT + etag: + - '"0100a9f8-0000-3400-0000-60a3c34f0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware virtual-network list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks?api-version=2020-10-01-preview + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T13:38:16.9571675Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T13:38:23.1435182Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Succeeded","customResourceName":"325f22b1-c59b-4a62-8c7d-11691a5aeb8c","uuid":"325f22b1-c59b-4a62-8c7d-11691a5aeb8c","moName":"segment-2"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '1139' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 13:38:54 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus2euap", "extendedLocation": {"type": "CustomLocation", + "name": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"}, + "properties": {"vCenterId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs", + "moRefId": "vm-64"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware vm-template create + Connection: + - keep-alive + Content-Length: + - '446' + Content-Type: + - application/json + ParameterSetName: + - -g -l --custom-location --vcenter --mo-ref-id --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T13:38:56.839885Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-18T13:38:56.839885Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"vm-64","provisioningState":"Accepted"}}' + headers: + api-supported-versions: + - 2019-12-20-privatepreview, 2020-10-01-preview + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/1daa9e66-87d2-4945-bbc8-2fceae209f31?api-version=2020-10-01-preview + cache-control: + - no-cache + content-length: + - '978' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 13:39:04 GMT + etag: + - '"0000fe5c-0000-3400-0000-60a3c3780000"' + expires: + - '-1' + location: + - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/VirtualMachineTemplates/azcli-test-vm-template + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware vm-template create + Connection: + - keep-alive + ParameterSetName: + - -g -l --custom-location --vcenter --mo-ref-id --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/1daa9e66-87d2-4945-bbc8-2fceae209f31?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/1daa9e66-87d2-4945-bbc8-2fceae209f31","name":"1daa9e66-87d2-4945-bbc8-2fceae209f31","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","status":"Succeeded","startTime":"2021-05-18T13:39:04.2733397Z","endTime":"2021-05-18T13:39:13.3852486Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '484' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 13:39:34 GMT + etag: + - '"02003d2f-0000-3400-0000-60a3c3810000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware vm-template create + Connection: + - keep-alive + ParameterSetName: + - -g -l --custom-location --vcenter --mo-ref-id --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T13:38:56.839885Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T13:39:13.1256964Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"vm-64","provisioningState":"Succeeded","customResourceName":"57b746b6-ef4b-45e3-be72-e380c2037b27","uuid":"57b746b6-ef4b-45e3-be72-e380c2037b27","networkInterfaces":[{"name":"nic_1","label":"Network + adapter 1","macAddress":"00:50:56:93:fb:46","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}],"disks":[{"diskObjectId":"403-2000","name":"disk_1","label":"Hard + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"moName":"azurevmwarecloudtestubuntu20.04","memorySizeMB":2048,"numCPUs":1,"numCoresPerSocket":1,"osType":"Linux","osName":"Ubuntu + Linux (64-bit)","folderPath":"SDDC-Datacenter/Templates"}}' + headers: + cache-control: + - no-cache + content-length: + - '1725' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 13:39:35 GMT + etag: + - '"0000045d-0000-3400-0000-60a3c3810000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware vm-template show_command + Connection: + - keep-alive + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T13:38:56.839885Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T13:39:13.1256964Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"vm-64","provisioningState":"Succeeded","customResourceName":"57b746b6-ef4b-45e3-be72-e380c2037b27","uuid":"57b746b6-ef4b-45e3-be72-e380c2037b27","networkInterfaces":[{"name":"nic_1","label":"Network + adapter 1","macAddress":"00:50:56:93:fb:46","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}],"disks":[{"diskObjectId":"403-2000","name":"disk_1","label":"Hard + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"moName":"azurevmwarecloudtestubuntu20.04","memorySizeMB":2048,"numCPUs":1,"numCoresPerSocket":1,"osType":"Linux","osName":"Ubuntu + Linux (64-bit)","folderPath":"SDDC-Datacenter/Templates"}}' + headers: + cache-control: + - no-cache + content-length: + - '1725' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 13:39:38 GMT + etag: + - '"0000045d-0000-3400-0000-60a3c3810000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware vm-template list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates?api-version=2020-10-01-preview + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T13:38:56.839885Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T13:39:13.1256964Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"vm-64","provisioningState":"Succeeded","customResourceName":"57b746b6-ef4b-45e3-be72-e380c2037b27","uuid":"57b746b6-ef4b-45e3-be72-e380c2037b27","networkInterfaces":[{"name":"nic_1","label":"Network + adapter 1","macAddress":"00:50:56:93:fb:46","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}],"disks":[{"diskObjectId":"403-2000","name":"disk_1","label":"Hard + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"moName":"azurevmwarecloudtestubuntu20.04","memorySizeMB":2048,"numCPUs":1,"numCoresPerSocket":1,"osType":"Linux","osName":"Ubuntu + Linux (64-bit)","folderPath":"SDDC-Datacenter/Templates"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '1737' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 13:39:39 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware inventory-item show_command + Connection: + - keep-alive + ParameterSetName: + - -g --vcenter-name --inventory-item + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/vcenters/azcli-test-vcenter-avs/inventoryItems/resgroup-5034?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/azcli-test-vcenter-avs/InventoryItems/resgroup-5034","name":"resgroup-5034","type":"microsoft.connectedvmwarevsphere/vcenters/inventoryitems","systemData":{"createdBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","createdByType":"Application","createdAt":"2021-05-17T11:38:31.7591468Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T12:54:33.3252357Z"},"properties":{"inventoryType":"ResourcePool","managedResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/ResourcePools/azcli-test-resource-pool","moRefId":"resgroup-5034","provisioningState":"Succeeded","parent":{"moName":"Resources","inventoryItemId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/azcli-test-vcenter-avs/InventoryItems/resgroup-8"},"moName":"SanmishraResourcePool"}}' + headers: + cache-control: + - no-cache + content-length: + - '1116' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 13:39:41 GMT + etag: + - '"410034c2-0000-3400-0000-60a3b9090000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware resource-pool delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool?api-version=2020-10-01-preview&force=false + response: + body: + string: 'null' + headers: + api-supported-versions: + - 2019-12-20-privatepreview, 2020-10-01-preview + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 13:39:43 GMT + etag: + - '"0000ef6c-0000-3400-0000-60a3c3a00000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/03b92c8b-4364-40a7-9b9f-bef0ea1faf29?api-version=2020-10-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware resource-pool delete + Connection: + - keep-alive + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/03b92c8b-4364-40a7-9b9f-bef0ea1faf29?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/03b92c8b-4364-40a7-9b9f-bef0ea1faf29","name":"03b92c8b-4364-40a7-9b9f-bef0ea1faf29","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","status":"Succeeded","startTime":"2021-05-18T13:39:44.3151142Z","endTime":"2021-05-18T13:39:45.7503125Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '476' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 13:40:14 GMT + etag: + - '"0200412f-0000-3400-0000-60a3c3a10000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware virtual-network delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network?api-version=2020-10-01-preview&force=false + response: + body: + string: 'null' + headers: + api-supported-versions: + - 2019-12-20-privatepreview, 2020-10-01-preview + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 13:40:16 GMT + etag: + - '"0100dff8-0000-3400-0000-60a3c3c00000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/efb64f1a-8071-4d35-bb13-fd54e3f9c908?api-version=2020-10-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware virtual-network delete + Connection: + - keep-alive + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/efb64f1a-8071-4d35-bb13-fd54e3f9c908?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/efb64f1a-8071-4d35-bb13-fd54e3f9c908","name":"efb64f1a-8071-4d35-bb13-fd54e3f9c908","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","status":"Succeeded","startTime":"2021-05-18T13:40:16.3743534Z","endTime":"2021-05-18T13:40:18.2215669Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '480' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 13:40:46 GMT + etag: + - '"0200442f-0000-3400-0000-60a3c3c20000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware vm-template delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template?api-version=2020-10-01-preview&force=false + response: + body: + string: 'null' + headers: + api-supported-versions: + - 2019-12-20-privatepreview, 2020-10-01-preview + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 13:40:49 GMT + etag: + - '"0000065d-0000-3400-0000-60a3c3e10000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/caf49c04-38c2-4fb7-83b4-c033df21048d?api-version=2020-10-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware vm-template delete + Connection: + - keep-alive + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/caf49c04-38c2-4fb7-83b4-c033df21048d?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/caf49c04-38c2-4fb7-83b4-c033df21048d","name":"caf49c04-38c2-4fb7-83b4-c033df21048d","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","status":"Succeeded","startTime":"2021-05-18T13:40:49.5253554Z","endTime":"2021-05-18T13:40:50.3334457Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '484' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 13:41:19 GMT + etag: + - '"0200462f-0000-3400-0000-60a3c3e20000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_resourcePool.yaml b/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_resourcePool.yaml deleted file mode 100644 index 62f214a6786..00000000000 --- a/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_resourcePool.yaml +++ /dev/null @@ -1,48 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedvmware resource-pool list - Connection: - - keep-alive - ParameterSetName: - - --resource-group - User-Agent: - - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools?api-version=2020-10-01-preview - response: - body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/testrspl001","name":"testrspl001","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/santosh-rg/providers/microsoft.extendedlocation/customlocations/santosh-test-cl-onperm"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-04-23T18:46:52.8966978Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-04-23T18:47:07.5931765Z"},"properties":{"inventoryItemId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/santosh-test-vcenter-onperm/InventoryItems/resgroup-1033","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/santosh-test-vcenter-onperm","moRefId":"resgroup-1033","provisioningState":"Succeeded","customResourceName":"5c0ed909-4008-4718-a0c5-87578a57c24e","uuid":"5c0ed909-4008-4718-a0c5-87578a57c24e","moName":"pm-demo-resourcepool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}]}' - headers: - cache-control: - - no-cache - content-length: - - '1410' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 13 May 2021 07:23:43 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - status: - code: 200 - message: OK -version: 1 diff --git a/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_vcenter.yaml b/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_vcenter.yaml deleted file mode 100644 index 25361ae252d..00000000000 --- a/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_vcenter.yaml +++ /dev/null @@ -1,48 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedvmware vcenter list - Connection: - - keep-alive - ParameterSetName: - - --resource-group - User-Agent: - - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVMwarevSphere/vcenters?api-version=2020-10-01-preview - response: - body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVMwarevSphere/vcenters/santosh-test-vcenter-onperm","name":"santosh-test-vcenter-onperm","type":"microsoft.connectedvmwarevsphere/vcenters","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/santosh-rg/providers/microsoft.extendedlocation/customlocations/santosh-test-cl-onperm"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-04-23T16:02:14.8484378Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-04-23T16:02:45.3494224Z"},"properties":{"credentials":{"username":"administrator@vsphere.local"},"fqdn":"arcvmw-vcenter.fareast.corp.microsoft.com","port":443,"provisioningState":"Succeeded","customResourceName":"b580832e-95c8-449a-b0c9-df9c3b5aa1d6","uuid":"b580832e-95c8-449a-b0c9-df9c3b5aa1d6","version":"6.7.0","instanceUuid":"87315321-c3ed-486b-842b-96832ce6de46","connectionStatus":"Connected"}}]}' - headers: - cache-control: - - no-cache - content-length: - - '1148' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 13 May 2021 07:23:44 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - status: - code: 200 - message: OK -version: 1 diff --git a/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_virtualNetwork.yaml b/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_virtualNetwork.yaml deleted file mode 100644 index 5e2fd1bf086..00000000000 --- a/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_virtualNetwork.yaml +++ /dev/null @@ -1,48 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedvmware virtual-network list - Connection: - - keep-alive - ParameterSetName: - - --resource-group - User-Agent: - - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks?api-version=2020-10-01-preview - response: - body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/testntw001","name":"testntw001","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/santosh-rg/providers/microsoft.extendedlocation/customlocations/santosh-test-cl-onperm"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-04-23T19:16:26.6574315Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-04-23T19:16:37.9491519Z"},"properties":{"inventoryItemId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/santosh-test-vcenter-onperm/InventoryItems/dvportgroup-3195","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/santosh-test-vcenter-onperm","moRefId":"dvportgroup-3195","provisioningState":"Succeeded","customResourceName":"41a8b474-5fa1-43e0-8a83-60eead19ebc6","uuid":"41a8b474-5fa1-43e0-8a83-60eead19ebc6","moName":"DSwitch-testsubb-DVUplinks-3194"}}]}' - headers: - cache-control: - - no-cache - content-length: - - '1344' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 13 May 2021 07:23:53 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - status: - code: 200 - message: OK -version: 1 diff --git a/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_vm.yaml b/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_vm.yaml deleted file mode 100644 index f3c8f9c24a9..00000000000 --- a/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware_vm.yaml +++ /dev/null @@ -1,57 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedvmware vm list - Connection: - - keep-alive - ParameterSetName: - - --resource-group - User-Agent: - - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines?api-version=2020-10-01-preview - response: - body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/testvm001","name":"testvm001","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/santosh-rg/providers/microsoft.extendedlocation/customlocations/santosh-test-cl-onperm"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-04-23T19:53:04.0917074Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-04-23T19:53:38.3705126Z"},"properties":{"inventoryItemId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/santosh-test-vcenter-onperm/InventoryItems/vm-2146","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/santosh-test-vcenter-onperm","provisioningState":"Succeeded","customResourceName":"f9b81181-b670-4b9a-990c-3fa2c030ab5e","uuid":"f9b81181-b670-4b9a-990c-3fa2c030ab5e","vmId":"f9b81181-b670-4b9a-990c-3fa2c030ab5e","networkProfile":{"networkInterfaces":[{"label":"Network - adapter 1","macAddress":"00:50:56:af:5e:eb","networkMoRefId":"network-12","networkMoName":"VM - Network","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset","ipAddress":"10.150.172.216","subnetMask":"255.255.248.0","ipAddressInfo":[{"ipAddress":"10.150.172.216","subnetMask":"255.255.248.0"},{"ipAddress":"2404:f801:4800:18:250:56ff:feaf:5eeb","subnetMask":"ffff:ffff:ffff:ffff:0000:0000:0000:0000"},{"ipAddress":"fe80::250:56ff:feaf:5eeb","subnetMask":"ffff:ffff:ffff:ffff:0000:0000:0000:0000"}]}},{"label":"Network - adapter 2","macAddress":"00:50:56:af:56:69","networkMoRefId":"network-12","networkMoName":"VM - Network","nicType":"vmxnet3","deviceKey":4001,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset","ipAddress":"10.150.172.217","subnetMask":"255.255.248.0","ipAddressInfo":[{"ipAddress":"10.150.172.217","subnetMask":"255.255.248.0"},{"ipAddress":"2404:f801:4800:18:250:56ff:feaf:5669","subnetMask":"ffff:ffff:ffff:ffff:0000:0000:0000:0000"},{"ipAddress":"fe80::250:56ff:feaf:5669","subnetMask":"ffff:ffff:ffff:ffff:0000:0000:0000:0000"}]}}]},"storageProfile":{"disks":[{"diskObjectId":"9-2000","label":"Hard - disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"niarodemo1","osType":"Linux","osName":"Ubuntu - Linux (64-bit)","toolsRunningStatus":"guestToolsNotRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":false,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":false},"instanceUuid":"ba2fded7-1524-4e00-a183-bde472883510","moRefId":"vm-2146","moName":"niarodemo1","folderPath":"Datacenter","powerState":"poweredOff"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVMwarevSphere/VirtualMachines/vm-3461","name":"vm-3461","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/santosh-rg/providers/microsoft.extendedlocation/customlocations/santosh-test-cl-onperm"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-04T08:29:26.1021939Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-04T08:29:58.9859806Z"},"properties":{"inventoryItemId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/santosh-test-vcenter-onperm/InventoryItems/vm-3461","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/santosh-rg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/santosh-test-vcenter-onperm","provisioningState":"Succeeded","customResourceName":"00a45f80-0731-403c-9ebd-3bbb4ad7197e","uuid":"00a45f80-0731-403c-9ebd-3bbb4ad7197e","vmId":"00a45f80-0731-403c-9ebd-3bbb4ad7197e","networkProfile":{"networkInterfaces":[{"label":"Network - adapter 1","ipAddresses":["10.150.92.249","10.150.88.82","fe80::250:56ff:feaf:c97d"],"macAddress":"00:50:56:af:c9:7d","networkMoRefId":"network-51","networkMoName":"NIC2","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset","gateway":["10.150.88.1"],"ipAddress":"10.150.92.249","subnetMask":"255.255.248.0","ipAddressInfo":[{"ipAddress":"10.150.92.249","subnetMask":"255.255.248.0"},{"ipAddress":"10.150.88.82","subnetMask":"255.255.255.255"},{"ipAddress":"fe80::250:56ff:feaf:c97d","subnetMask":"ffff:ffff:ffff:ffff:0000:0000:0000:0000"}]}}]},"storageProfile":{"disks":[{"diskObjectId":"2880-2000","label":"Hard - disk 1","diskSizeGB":97,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogicsas","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"28cd668da43c8b6735991efc7fb825ceaa189dd5e84a5-control-plane-0","osType":"Linux","osName":"Other - 4.x or later Linux (64-bit)","toolsRunningStatus":"guestToolsRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11296"},"hardwareProfile":{"memorySizeMB":16384,"numCPUs":4,"numCoresPerSocket":2,"cpuHotAddEnabled":false,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":false},"instanceUuid":"422f5d77-2193-9786-f957-00b6be747055","moRefId":"vm-3461","moName":"28cd668da43c8b6735991efc7fb825ceaa189dd5e84a5-control-plane-0","folderPath":"Datacenter","powerState":"poweredOn"}}]}' - headers: - cache-control: - - no-cache - content-length: - - '6131' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 13 May 2021 07:23:44 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - status: - code: 200 - message: OK -version: 1 diff --git a/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py b/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py index d6c303318c7..84cc18a0428 100644 --- a/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py +++ b/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py @@ -16,34 +16,80 @@ class ConnectedvmwareScenarioTest(ScenarioTest): - def test_connectedvmware_vcenter(self): - resource_group = "santosh-rg" + def test_connectedvmware(self): + self.kwargs.update({ + 'rg': 'azcli-test-rg', + 'loc': 'eastus2euap', + 'cus_loc': 'azcli-test-cl-avs', + 'vc_name': 'azcli-test-vcenter-avs', + 'rp_morefid': 'resgroup-5034', + 'rp_name': 'azcli-test-resource-pool', + 'vnet_morefid': 'network-o761', + 'vnet_name': 'azcli-test-virtual-network', + 'vmtpl_morefid': 'vm-64', + 'vmtpl_name': 'azcli-test-vm-template', + 'vm_name': 'azcli-test-vm' + }) - # count the list of vcenter resources in this resource group - count = len(self.cmd('az connectedvmware vcenter list --resource-group ' + resource_group).get_output_in_json()) + # Validate the show command output with vcenter name. + self.cmd('az connectedvmware vcenter show_command -g {rg} --name {vc_name}', checks=[ + self.check('name', '{vc_name}'), + ]) + + # Count the vcenter resources in this resource group with list command + count = len(self.cmd('az connectedvmware vcenter list -g {rg}').get_output_in_json()) # vcenter count list should report 1 - self.assertEqual(count, 1, 'cluster count expected to be 1') + self.assertEqual(count, 1, 'vcenter resource count expected to be 1') + + # Create resource-pool resource. + self.cmd('az connectedvmware resource-pool create -g {rg} -l {loc} --custom-location {cus_loc} --vcenter {vc_name} --mo-ref-id {rp_morefid} --name {rp_name}') + + # Validate the show command output with resource-pool name. + self.cmd('az connectedvmware resource-pool show_command -g {rg} --name {rp_name}', checks=[ + self.check('name', '{rp_name}'), + ]) + + # List the resource-pool resources in this resource group. + resource_list = self.cmd('az connectedvmware resource-pool list -g {rg}').get_output_in_json() + # At this point there should be 1 resource-pool resource. + assert len(resource_list) >= 1 + + # Create virtual-network resource. + self.cmd('az connectedvmware virtual-network create -g {rg} -l {loc} --custom-location {cus_loc} --vcenter {vc_name} --mo-ref-id {vnet_morefid} --name {vnet_name}') + + # Validate the show command output with virtual-network name. + self.cmd('az connectedvmware virtual-network show_command -g {rg} --name {vnet_name}', checks=[ + self.check('name', '{vnet_name}'), + ]) + + # List the virtual-network resources in this resource group. + resource_list = self.cmd('az connectedvmware virtual-network list -g {rg}').get_output_in_json() + # At this point there should be 1 virtual-network resource. + assert len(resource_list) >= 1 + + # Create vm-template resource. + self.cmd('az connectedvmware vm-template create -g {rg} -l {loc} --custom-location {cus_loc} --vcenter {vc_name} --mo-ref-id {vmtpl_morefid} --name {vmtpl_name}') - def test_connectedvmware_resourcePool(self): - resource_group = "santosh-rg" + # Validate the show command output with vm-template name. + self.cmd('az connectedvmware vm-template show_command -g {rg} --name {vmtpl_name}', checks=[ + self.check('name', '{vmtpl_name}'), + ]) - # count the resource-pool resources in this resource group - count = len(self.cmd('az connectedvmware resource-pool list --resource-group ' + resource_group).get_output_in_json()) - # resource-pool count should be greater than 1 - assert count >= 1 + # List the vm-template resources in this resource group. + resource_list = self.cmd('az connectedvmware vm-template list -g {rg}').get_output_in_json() + # At this point there should be 1 vm-template resource. + assert len(resource_list) >= 1 - def test_connectedvmware_virtualNetwork(self): - resource_group = "santosh-rg" + # Validate the show command output with inventory-item name. + self.cmd('az connectedvmware inventory-item show_command -g {rg} --vcenter-name {vc_name} --inventory-item {rp_morefid}', checks=[ + self.check('name', '{rp_morefid}'), + ]) - # count the virtual-network resources in this resource group - count = len(self.cmd('az connectedvmware virtual-network list --resource-group ' + resource_group).get_output_in_json()) - # virtual-network count should be greater than or equal to 1 - assert count >= 1 + # Delete the created resource-pool. + self.cmd('az connectedvmware resource-pool delete -g {rg} --name {rp_name}') - def test_connectedvmware_vm(self): - resource_group = "santosh-rg" + # Delete the created virtual-network. + self.cmd('az connectedvmware virtual-network delete -g {rg} --name {vnet_name}') - # count the list of vm resources in this resource group - count = len(self.cmd('az connectedvmware vm list --resource-group ' + resource_group).get_output_in_json()) - # vm count should be greater than or equal 1 - assert count >= 1 + # Delete the created vm-template. + self.cmd('az connectedvmware vm-template delete -g {rg} --name {vmtpl_name}') From 5c45cddc34a0a4a80b9c7d801d3700066cc18587 Mon Sep 17 00:00:00 2001 From: Santosh Mishra Date: Wed, 19 May 2021 01:09:28 +0530 Subject: [PATCH 09/13] Add vm put, get, show and list test cases --- .../azext_connectedvmware/custom.py | 2 +- .../recordings/test_connectedvmware.yaml | 929 +++++++++++++++--- .../latest/test_connectedvmware_scenario.py | 20 +- 3 files changed, 805 insertions(+), 146 deletions(-) diff --git a/src/connectedvmware/azext_connectedvmware/custom.py b/src/connectedvmware/azext_connectedvmware/custom.py index ecc05276ce6..379dd647a29 100644 --- a/src/connectedvmware/azext_connectedvmware/custom.py +++ b/src/connectedvmware/azext_connectedvmware/custom.py @@ -680,7 +680,7 @@ def stop_vm( client: VirtualMachinesOperations, resource_group_name, resource_name, - skip_shutdown=False, + skip_shutdown=None, no_wait=False, ): diff --git a/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware.yaml b/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware.yaml index 2b15b541b35..5dc4f529f1a 100644 --- a/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware.yaml +++ b/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware.yaml @@ -27,7 +27,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 13:37:27 GMT + - Tue, 18 May 2021 19:25:34 GMT etag: - '"03005e99-0000-3400-0000-60a255b90000"' expires: @@ -75,7 +75,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 13:37:29 GMT + - Tue, 18 May 2021 19:25:36 GMT expires: - '-1' pragma: @@ -119,22 +119,22 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T13:37:32.110869Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-18T13:37:32.110869Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Accepted"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:25:39.1685722Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-18T19:25:39.1685722Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Accepted"}}' headers: api-supported-versions: - 2019-12-20-privatepreview, 2020-10-01-preview azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/b7ed1ebe-676a-4053-bb5a-fb553d53f325?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/b9484208-5949-46c9-a239-009814c5d74f?api-version=2020-10-01-preview cache-control: - no-cache content-length: - - '970' + - '972' content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 13:37:40 GMT + - Tue, 18 May 2021 19:25:41 GMT etag: - - '"0000e76c-0000-3400-0000-60a3c3240000"' + - '"00005c89-0000-3400-0000-60a414b50000"' expires: - '-1' location: @@ -148,7 +148,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1198' status: code: 201 message: Created @@ -168,21 +168,452 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/b7ed1ebe-676a-4053-bb5a-fb553d53f325?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/b9484208-5949-46c9-a239-009814c5d74f?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/b7ed1ebe-676a-4053-bb5a-fb553d53f325","name":"b7ed1ebe-676a-4053-bb5a-fb553d53f325","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","status":"Succeeded","startTime":"2021-05-18T13:37:40.130615Z","endTime":"2021-05-18T13:37:50.1361064Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/b9484208-5949-46c9-a239-009814c5d74f","name":"b9484208-5949-46c9-a239-009814c5d74f","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","status":"Succeeded","startTime":"2021-05-18T19:25:41.3383315Z","endTime":"2021-05-18T19:25:46.7204927Z","properties":null}' headers: cache-control: - no-cache content-length: - - '475' + - '476' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 19:26:12 GMT + etag: + - '"0200c23d-0000-3400-0000-60a414ba0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware resource-pool create + Connection: + - keep-alive + ParameterSetName: + - -g -l --custom-location --vcenter --mo-ref-id --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:25:39.1685722Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T19:25:46.4434332Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Succeeded","customResourceName":"cc2e2607-a2a9-48d3-9b25-984e9d70ae41","uuid":"cc2e2607-a2a9-48d3-9b25-984e9d70ae41","moName":"SanmishraResourcePool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}' + headers: + cache-control: + - no-cache + content-length: + - '1217' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 19:26:12 GMT + etag: + - '"00006289-0000-3400-0000-60a414ba0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware resource-pool show_command + Connection: + - keep-alive + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:25:39.1685722Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T19:25:46.4434332Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Succeeded","customResourceName":"cc2e2607-a2a9-48d3-9b25-984e9d70ae41","uuid":"cc2e2607-a2a9-48d3-9b25-984e9d70ae41","moName":"SanmishraResourcePool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}' + headers: + cache-control: + - no-cache + content-length: + - '1217' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 19:26:14 GMT + etag: + - '"00006289-0000-3400-0000-60a414ba0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware resource-pool list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools?api-version=2020-10-01-preview + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:25:39.1685722Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T19:25:46.4434332Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Succeeded","customResourceName":"cc2e2607-a2a9-48d3-9b25-984e9d70ae41","uuid":"cc2e2607-a2a9-48d3-9b25-984e9d70ae41","moName":"SanmishraResourcePool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}]}' + headers: + cache-control: + - no-cache + content-length: + - '1229' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 19:26:21 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus2euap", "extendedLocation": {"type": "CustomLocation", + "name": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"}, + "properties": {"vCenterId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs", + "moRefId": "network-o761"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware virtual-network create + Connection: + - keep-alive + Content-Length: + - '453' + Content-Type: + - application/json + ParameterSetName: + - -g -l --custom-location --vcenter --mo-ref-id --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:26:25.120357Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-18T19:26:25.120357Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Accepted"}}' + headers: + api-supported-versions: + - 2019-12-20-privatepreview, 2020-10-01-preview + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/6c6f9820-48d3-4100-9d5b-55b8b86a1ddf?api-version=2020-10-01-preview + cache-control: + - no-cache + content-length: + - '977' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 19:26:29 GMT + etag: + - '"0200eb05-0000-3400-0000-60a414e50000"' + expires: + - '-1' + location: + - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/VirtualNetworks/azcli-test-virtual-network + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware virtual-network create + Connection: + - keep-alive + ParameterSetName: + - -g -l --custom-location --vcenter --mo-ref-id --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/6c6f9820-48d3-4100-9d5b-55b8b86a1ddf?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/6c6f9820-48d3-4100-9d5b-55b8b86a1ddf","name":"6c6f9820-48d3-4100-9d5b-55b8b86a1ddf","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","status":"Accepted","startTime":"2021-05-18T19:26:29.4569051Z"}' + headers: + cache-control: + - no-cache + content-length: + - '420' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 19:27:00 GMT + etag: + - '"0200cd3d-0000-3400-0000-60a414e50000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware virtual-network create + Connection: + - keep-alive + ParameterSetName: + - -g -l --custom-location --vcenter --mo-ref-id --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/6c6f9820-48d3-4100-9d5b-55b8b86a1ddf?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/6c6f9820-48d3-4100-9d5b-55b8b86a1ddf","name":"6c6f9820-48d3-4100-9d5b-55b8b86a1ddf","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","status":"Accepted","startTime":"2021-05-18T19:26:29.4569051Z"}' + headers: + cache-control: + - no-cache + content-length: + - '420' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 19:27:30 GMT + etag: + - '"0200cd3d-0000-3400-0000-60a414e50000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware virtual-network create + Connection: + - keep-alive + ParameterSetName: + - -g -l --custom-location --vcenter --mo-ref-id --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/6c6f9820-48d3-4100-9d5b-55b8b86a1ddf?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/6c6f9820-48d3-4100-9d5b-55b8b86a1ddf","name":"6c6f9820-48d3-4100-9d5b-55b8b86a1ddf","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","status":"Accepted","startTime":"2021-05-18T19:26:29.4569051Z"}' + headers: + cache-control: + - no-cache + content-length: + - '420' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 19:28:00 GMT + etag: + - '"0200cd3d-0000-3400-0000-60a414e50000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware virtual-network create + Connection: + - keep-alive + ParameterSetName: + - -g -l --custom-location --vcenter --mo-ref-id --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/6c6f9820-48d3-4100-9d5b-55b8b86a1ddf?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/6c6f9820-48d3-4100-9d5b-55b8b86a1ddf","name":"6c6f9820-48d3-4100-9d5b-55b8b86a1ddf","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","status":"Accepted","startTime":"2021-05-18T19:26:29.4569051Z"}' + headers: + cache-control: + - no-cache + content-length: + - '420' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 19:28:31 GMT + etag: + - '"0200cd3d-0000-3400-0000-60a414e50000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware virtual-network create + Connection: + - keep-alive + ParameterSetName: + - -g -l --custom-location --vcenter --mo-ref-id --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/6c6f9820-48d3-4100-9d5b-55b8b86a1ddf?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/6c6f9820-48d3-4100-9d5b-55b8b86a1ddf","name":"6c6f9820-48d3-4100-9d5b-55b8b86a1ddf","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","status":"Succeeded","startTime":"2021-05-18T19:26:29.4569051Z","endTime":"2021-05-18T19:28:43.6851948Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '480' content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 13:38:10 GMT + - Tue, 18 May 2021 19:29:01 GMT etag: - - '"02001e2f-0000-3400-0000-60a3c32e0000"' + - '"0200dd3d-0000-3400-0000-60a4156b0000"' expires: - '-1' pragma: @@ -206,7 +637,7 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - connectedvmware resource-pool create + - connectedvmware virtual-network create Connection: - keep-alive ParameterSetName: @@ -214,21 +645,21 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool?api-version=2020-10-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T13:37:32.110869Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T13:37:49.9305901Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Succeeded","customResourceName":"134d3260-3e5c-498b-9b21-c9a4688bb62a","uuid":"134d3260-3e5c-498b-9b21-c9a4688bb62a","moName":"SanmishraResourcePool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:26:25.120357Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T19:28:43.3653125Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Succeeded","customResourceName":"f7b95c73-47f7-4faa-84eb-e5ddfe445366","uuid":"f7b95c73-47f7-4faa-84eb-e5ddfe445366","moName":"segment-2"}}' headers: cache-control: - no-cache content-length: - - '1216' + - '1126' content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 13:38:10 GMT + - Tue, 18 May 2021 19:29:02 GMT etag: - - '"0000ed6c-0000-3400-0000-60a3c32e0000"' + - '"0200f105-0000-3400-0000-60a4156b0000"' expires: - '-1' pragma: @@ -254,7 +685,7 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - connectedvmware resource-pool show_command + - connectedvmware virtual-network show_command Connection: - keep-alive ParameterSetName: @@ -262,21 +693,21 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool?api-version=2020-10-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T13:37:32.110869Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T13:37:49.9305901Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Succeeded","customResourceName":"134d3260-3e5c-498b-9b21-c9a4688bb62a","uuid":"134d3260-3e5c-498b-9b21-c9a4688bb62a","moName":"SanmishraResourcePool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:26:25.120357Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T19:28:43.3653125Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Succeeded","customResourceName":"f7b95c73-47f7-4faa-84eb-e5ddfe445366","uuid":"f7b95c73-47f7-4faa-84eb-e5ddfe445366","moName":"segment-2"}}' headers: cache-control: - no-cache content-length: - - '1216' + - '1126' content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 13:38:12 GMT + - Tue, 18 May 2021 19:29:05 GMT etag: - - '"0000ed6c-0000-3400-0000-60a3c32e0000"' + - '"0200f105-0000-3400-0000-60a4156b0000"' expires: - '-1' pragma: @@ -302,7 +733,7 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - connectedvmware resource-pool list + - connectedvmware virtual-network list Connection: - keep-alive ParameterSetName: @@ -310,19 +741,19 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools?api-version=2020-10-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks?api-version=2020-10-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T13:37:32.110869Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T13:37:49.9305901Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Succeeded","customResourceName":"134d3260-3e5c-498b-9b21-c9a4688bb62a","uuid":"134d3260-3e5c-498b-9b21-c9a4688bb62a","moName":"SanmishraResourcePool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}]}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:26:25.120357Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T19:28:43.3653125Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Succeeded","customResourceName":"f7b95c73-47f7-4faa-84eb-e5ddfe445366","uuid":"f7b95c73-47f7-4faa-84eb-e5ddfe445366","moName":"segment-2"}}]}' headers: cache-control: - no-cache content-length: - - '1228' + - '1138' content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 13:38:14 GMT + - Tue, 18 May 2021 19:29:07 GMT expires: - '-1' pragma: @@ -344,18 +775,18 @@ interactions: body: '{"location": "eastus2euap", "extendedLocation": {"type": "CustomLocation", "name": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"}, "properties": {"vCenterId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs", - "moRefId": "network-o761"}}' + "moRefId": "vm-55"}}' headers: Accept: - application/json Accept-Encoding: - gzip, deflate CommandName: - - connectedvmware virtual-network create + - connectedvmware vm-template create Connection: - keep-alive Content-Length: - - '453' + - '446' Content-Type: - application/json ParameterSetName: @@ -363,29 +794,29 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network?api-version=2020-10-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T13:38:16.9571675Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-18T13:38:16.9571675Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Accepted"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:29:10.3767045Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-18T19:29:10.3767045Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"vm-55","provisioningState":"Accepted"}}' headers: api-supported-versions: - 2019-12-20-privatepreview, 2020-10-01-preview azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/21173c74-0fe1-4935-8500-b92a94b84842?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/af143eaf-f161-4be9-a448-9baf065120bd?api-version=2020-10-01-preview cache-control: - no-cache content-length: - - '979' + - '980' content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 13:38:19 GMT + - Tue, 18 May 2021 19:29:12 GMT etag: - - '"0100a3f8-0000-3400-0000-60a3c34b0000"' + - '"0000335e-0000-3400-0000-60a415880000"' expires: - '-1' location: - - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/VirtualNetworks/azcli-test-virtual-network + - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/VirtualMachineTemplates/azcli-test-vm-template pragma: - no-cache strict-transport-security: @@ -395,7 +826,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1199' status: code: 201 message: Created @@ -407,7 +838,7 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - connectedvmware virtual-network create + - connectedvmware vm-template create Connection: - keep-alive ParameterSetName: @@ -415,21 +846,21 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/21173c74-0fe1-4935-8500-b92a94b84842?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/af143eaf-f161-4be9-a448-9baf065120bd?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/21173c74-0fe1-4935-8500-b92a94b84842","name":"21173c74-0fe1-4935-8500-b92a94b84842","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","status":"Succeeded","startTime":"2021-05-18T13:38:18.8619425Z","endTime":"2021-05-18T13:38:23.3272266Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/af143eaf-f161-4be9-a448-9baf065120bd","name":"af143eaf-f161-4be9-a448-9baf065120bd","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","status":"Succeeded","startTime":"2021-05-18T19:29:12.4997597Z","endTime":"2021-05-18T19:29:16.5301458Z","properties":null}' headers: cache-control: - no-cache content-length: - - '480' + - '484' content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 13:38:49 GMT + - Tue, 18 May 2021 19:29:43 GMT etag: - - '"0200202f-0000-3400-0000-60a3c34f0000"' + - '"0200e03d-0000-3400-0000-60a4158c0000"' expires: - '-1' pragma: @@ -453,7 +884,7 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - connectedvmware virtual-network create + - connectedvmware vm-template create Connection: - keep-alive ParameterSetName: @@ -461,21 +892,24 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network?api-version=2020-10-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T13:38:16.9571675Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T13:38:23.1435182Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Succeeded","customResourceName":"325f22b1-c59b-4a62-8c7d-11691a5aeb8c","uuid":"325f22b1-c59b-4a62-8c7d-11691a5aeb8c","moName":"segment-2"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:29:10.3767045Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T19:29:16.3313464Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"vm-55","provisioningState":"Succeeded","customResourceName":"b90215fb-1d10-4876-832c-cbe192f0c694","uuid":"b90215fb-1d10-4876-832c-cbe192f0c694","networkInterfaces":[{"name":"nic_1","label":"Network + adapter 1","macAddress":"00:50:56:93:2b:71","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}],"disks":[{"diskObjectId":"1816-2000","name":"disk_1","label":"Hard + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"moName":"azurevmwarecloudtestubuntu","memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"osType":"Linux","osName":"Ubuntu + Linux (64-bit)","folderPath":"SDDC-Datacenter/Templates"}}' headers: cache-control: - no-cache content-length: - - '1127' + - '1722' content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 13:38:50 GMT + - Tue, 18 May 2021 19:29:44 GMT etag: - - '"0100a9f8-0000-3400-0000-60a3c34f0000"' + - '"0000395e-0000-3400-0000-60a4158c0000"' expires: - '-1' pragma: @@ -501,7 +935,7 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - connectedvmware virtual-network show_command + - connectedvmware vm-template show_command Connection: - keep-alive ParameterSetName: @@ -509,21 +943,24 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network?api-version=2020-10-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T13:38:16.9571675Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T13:38:23.1435182Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Succeeded","customResourceName":"325f22b1-c59b-4a62-8c7d-11691a5aeb8c","uuid":"325f22b1-c59b-4a62-8c7d-11691a5aeb8c","moName":"segment-2"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:29:10.3767045Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T19:29:16.3313464Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"vm-55","provisioningState":"Succeeded","customResourceName":"b90215fb-1d10-4876-832c-cbe192f0c694","uuid":"b90215fb-1d10-4876-832c-cbe192f0c694","networkInterfaces":[{"name":"nic_1","label":"Network + adapter 1","macAddress":"00:50:56:93:2b:71","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}],"disks":[{"diskObjectId":"1816-2000","name":"disk_1","label":"Hard + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"moName":"azurevmwarecloudtestubuntu","memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"osType":"Linux","osName":"Ubuntu + Linux (64-bit)","folderPath":"SDDC-Datacenter/Templates"}}' headers: cache-control: - no-cache content-length: - - '1127' + - '1722' content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 13:38:52 GMT + - Tue, 18 May 2021 19:29:46 GMT etag: - - '"0100a9f8-0000-3400-0000-60a3c34f0000"' + - '"0000395e-0000-3400-0000-60a4158c0000"' expires: - '-1' pragma: @@ -549,7 +986,7 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - connectedvmware virtual-network list + - connectedvmware vm-template list Connection: - keep-alive ParameterSetName: @@ -557,19 +994,70 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks?api-version=2020-10-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates?api-version=2020-10-01-preview + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:29:10.3767045Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T19:29:16.3313464Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"vm-55","provisioningState":"Succeeded","customResourceName":"b90215fb-1d10-4876-832c-cbe192f0c694","uuid":"b90215fb-1d10-4876-832c-cbe192f0c694","networkInterfaces":[{"name":"nic_1","label":"Network + adapter 1","macAddress":"00:50:56:93:2b:71","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}],"disks":[{"diskObjectId":"1816-2000","name":"disk_1","label":"Hard + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"moName":"azurevmwarecloudtestubuntu","memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"osType":"Linux","osName":"Ubuntu + Linux (64-bit)","folderPath":"SDDC-Datacenter/Templates"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '1734' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 19:29:48 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware inventory-item show_command + Connection: + - keep-alive + ParameterSetName: + - -g --vcenter-name --inventory-item + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/vcenters/azcli-test-vcenter-avs/inventoryItems/resgroup-5034?api-version=2020-10-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T13:38:16.9571675Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T13:38:23.1435182Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Succeeded","customResourceName":"325f22b1-c59b-4a62-8c7d-11691a5aeb8c","uuid":"325f22b1-c59b-4a62-8c7d-11691a5aeb8c","moName":"segment-2"}}]}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/azcli-test-vcenter-avs/InventoryItems/resgroup-5034","name":"resgroup-5034","type":"microsoft.connectedvmwarevsphere/vcenters/inventoryitems","systemData":{"createdBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","createdByType":"Application","createdAt":"2021-05-17T11:38:31.7591468Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T19:03:10.0204731Z"},"properties":{"inventoryType":"ResourcePool","managedResourceId":"","moRefId":"resgroup-5034","provisioningState":"Succeeded","parent":{"moName":"Resources","inventoryItemId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/azcli-test-vcenter-avs/InventoryItems/resgroup-8"},"moName":"SanmishraResourcePool"}}' headers: cache-control: - no-cache content-length: - - '1139' + - '954' content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 13:38:54 GMT + - Tue, 18 May 2021 19:29:51 GMT + etag: + - '"46003de7-0000-3400-0000-60a40f6e0000"' expires: - '-1' pragma: @@ -590,49 +1078,50 @@ interactions: - request: body: '{"location": "eastus2euap", "extendedLocation": {"type": "CustomLocation", "name": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"}, - "properties": {"vCenterId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs", - "moRefId": "vm-64"}}' + "properties": {"resourcePoolId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool", + "templateId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template", + "vCenterId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs"}}' headers: Accept: - application/json Accept-Encoding: - gzip, deflate CommandName: - - connectedvmware vm-template create + - connectedvmware vm create Connection: - keep-alive Content-Length: - - '446' + - '798' Content-Type: - application/json ParameterSetName: - - -g -l --custom-location --vcenter --mo-ref-id --name + - -g -l --custom-location --vcenter --resource-pool --vm-template --name User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template?api-version=2020-10-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T13:38:56.839885Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-18T13:38:56.839885Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"vm-64","provisioningState":"Accepted"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:29:53.8016842Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-18T19:29:53.8016842Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Accepted"}}' headers: api-supported-versions: - 2019-12-20-privatepreview, 2020-10-01-preview azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/1daa9e66-87d2-4945-bbc8-2fceae209f31?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d364bd4b-7a37-491c-b033-bb793fc7b7ee?api-version=2020-10-01-preview cache-control: - no-cache content-length: - - '978' + - '1338' content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 13:39:04 GMT + - Tue, 18 May 2021 19:29:56 GMT etag: - - '"0000fe5c-0000-3400-0000-60a3c3780000"' + - '"01002821-0000-3400-0000-60a415b40000"' expires: - '-1' location: - - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/VirtualMachineTemplates/azcli-test-vm-template + - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/VirtualMachines/azcli-test-virtual-machine pragma: - no-cache strict-transport-security: @@ -642,7 +1131,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1199' status: code: 201 message: Created @@ -654,29 +1143,29 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - connectedvmware vm-template create + - connectedvmware vm create Connection: - keep-alive ParameterSetName: - - -g -l --custom-location --vcenter --mo-ref-id --name + - -g -l --custom-location --vcenter --resource-pool --vm-template --name User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/1daa9e66-87d2-4945-bbc8-2fceae209f31?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d364bd4b-7a37-491c-b033-bb793fc7b7ee?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/1daa9e66-87d2-4945-bbc8-2fceae209f31","name":"1daa9e66-87d2-4945-bbc8-2fceae209f31","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","status":"Succeeded","startTime":"2021-05-18T13:39:04.2733397Z","endTime":"2021-05-18T13:39:13.3852486Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d364bd4b-7a37-491c-b033-bb793fc7b7ee","name":"d364bd4b-7a37-491c-b033-bb793fc7b7ee","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Accepted","startTime":"2021-05-18T19:29:55.6615302Z"}' headers: cache-control: - no-cache content-length: - - '484' + - '420' content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 13:39:34 GMT + - Tue, 18 May 2021 19:30:26 GMT etag: - - '"02003d2f-0000-3400-0000-60a3c3810000"' + - '"0200e43d-0000-3400-0000-60a415b30000"' expires: - '-1' pragma: @@ -700,32 +1189,124 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - connectedvmware vm-template create + - connectedvmware vm create Connection: - keep-alive ParameterSetName: - - -g -l --custom-location --vcenter --mo-ref-id --name + - -g -l --custom-location --vcenter --resource-pool --vm-template --name User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d364bd4b-7a37-491c-b033-bb793fc7b7ee?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T13:38:56.839885Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T13:39:13.1256964Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"vm-64","provisioningState":"Succeeded","customResourceName":"57b746b6-ef4b-45e3-be72-e380c2037b27","uuid":"57b746b6-ef4b-45e3-be72-e380c2037b27","networkInterfaces":[{"name":"nic_1","label":"Network - adapter 1","macAddress":"00:50:56:93:fb:46","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}],"disks":[{"diskObjectId":"403-2000","name":"disk_1","label":"Hard - disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"moName":"azurevmwarecloudtestubuntu20.04","memorySizeMB":2048,"numCPUs":1,"numCoresPerSocket":1,"osType":"Linux","osName":"Ubuntu - Linux (64-bit)","folderPath":"SDDC-Datacenter/Templates"}}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d364bd4b-7a37-491c-b033-bb793fc7b7ee","name":"d364bd4b-7a37-491c-b033-bb793fc7b7ee","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Accepted","startTime":"2021-05-18T19:29:55.6615302Z"}' + headers: + cache-control: + - no-cache + content-length: + - '420' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 19:30:57 GMT + etag: + - '"0200e43d-0000-3400-0000-60a415b30000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware vm create + Connection: + - keep-alive + ParameterSetName: + - -g -l --custom-location --vcenter --resource-pool --vm-template --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d364bd4b-7a37-491c-b033-bb793fc7b7ee?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d364bd4b-7a37-491c-b033-bb793fc7b7ee","name":"d364bd4b-7a37-491c-b033-bb793fc7b7ee","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Succeeded","startTime":"2021-05-18T19:29:55.6615302Z","endTime":"2021-05-18T19:31:12.4365947Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '480' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 19:31:27 GMT + etag: + - '"0200f03d-0000-3400-0000-60a416000000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware vm create + Connection: + - keep-alive + ParameterSetName: + - -g -l --custom-location --vcenter --resource-pool --vm-template --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:29:53.8016842Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T19:31:28.0724561Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Succeeded","customResourceName":"3d8b4763-16cb-4b15-a57e-a0019157d2b7","uuid":"3d8b4763-16cb-4b15-a57e-a0019157d2b7","vmId":"3d8b4763-16cb-4b15-a57e-a0019157d2b7","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network + adapter 1","ipAddresses":["172.16.0.116","fe80::250:56ff:fe93:75b3"],"macAddress":"00:50:56:93:75:b3","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset","gateway":["172.16.0.1"],"ipAddress":"172.16.0.116","subnetMask":"255.255.252.0","ipAddressInfo":[{"ipAddress":"172.16.0.116","subnetMask":"255.255.252.0"},{"ipAddress":"fe80::250:56ff:fe93:75b3","subnetMask":"ffff:ffff:ffff:ffff:0000:0000:0000:0000"}]}}]},"storageProfile":{"disks":[{"diskObjectId":"12451-2000","name":"disk_1","label":"Hard + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"azcli-test-virtual-machine","osType":"Linux","osName":"Ubuntu + Linux (64-bit)","toolsRunningStatus":"guestToolsRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"3d8b4763-16cb-4b15-a57e-a0019157d2b7","moRefId":"vm-25036","moName":"azcli-test-virtual-machine","folderPath":"SDDC-Datacenter","powerState":"poweredOn"}}' headers: cache-control: - no-cache content-length: - - '1725' + - '2936' content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 13:39:35 GMT + - Tue, 18 May 2021 19:31:28 GMT etag: - - '"0000045d-0000-3400-0000-60a3c3810000"' + - '"01005421-0000-3400-0000-60a416100000"' expires: - '-1' pragma: @@ -751,7 +1332,7 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - connectedvmware vm-template show_command + - connectedvmware vm show_command Connection: - keep-alive ParameterSetName: @@ -759,24 +1340,24 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template?api-version=2020-10-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T13:38:56.839885Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T13:39:13.1256964Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"vm-64","provisioningState":"Succeeded","customResourceName":"57b746b6-ef4b-45e3-be72-e380c2037b27","uuid":"57b746b6-ef4b-45e3-be72-e380c2037b27","networkInterfaces":[{"name":"nic_1","label":"Network - adapter 1","macAddress":"00:50:56:93:fb:46","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}],"disks":[{"diskObjectId":"403-2000","name":"disk_1","label":"Hard - disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"moName":"azurevmwarecloudtestubuntu20.04","memorySizeMB":2048,"numCPUs":1,"numCoresPerSocket":1,"osType":"Linux","osName":"Ubuntu - Linux (64-bit)","folderPath":"SDDC-Datacenter/Templates"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:29:53.8016842Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T19:31:28.0724561Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Succeeded","customResourceName":"3d8b4763-16cb-4b15-a57e-a0019157d2b7","uuid":"3d8b4763-16cb-4b15-a57e-a0019157d2b7","vmId":"3d8b4763-16cb-4b15-a57e-a0019157d2b7","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network + adapter 1","ipAddresses":["172.16.0.116","fe80::250:56ff:fe93:75b3"],"macAddress":"00:50:56:93:75:b3","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset","gateway":["172.16.0.1"],"ipAddress":"172.16.0.116","subnetMask":"255.255.252.0","ipAddressInfo":[{"ipAddress":"172.16.0.116","subnetMask":"255.255.252.0"},{"ipAddress":"fe80::250:56ff:fe93:75b3","subnetMask":"ffff:ffff:ffff:ffff:0000:0000:0000:0000"}]}}]},"storageProfile":{"disks":[{"diskObjectId":"12451-2000","name":"disk_1","label":"Hard + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"azcli-test-virtual-machine","osType":"Linux","osName":"Ubuntu + Linux (64-bit)","toolsRunningStatus":"guestToolsRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"3d8b4763-16cb-4b15-a57e-a0019157d2b7","moRefId":"vm-25036","moName":"azcli-test-virtual-machine","folderPath":"SDDC-Datacenter","powerState":"poweredOn"}}' headers: cache-control: - no-cache content-length: - - '1725' + - '2936' content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 13:39:38 GMT + - Tue, 18 May 2021 19:31:30 GMT etag: - - '"0000045d-0000-3400-0000-60a3c3810000"' + - '"01005421-0000-3400-0000-60a416100000"' expires: - '-1' pragma: @@ -802,7 +1383,7 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - connectedvmware vm-template list + - connectedvmware vm list Connection: - keep-alive ParameterSetName: @@ -810,22 +1391,34 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates?api-version=2020-10-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines?api-version=2020-10-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T13:38:56.839885Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T13:39:13.1256964Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"vm-64","provisioningState":"Succeeded","customResourceName":"57b746b6-ef4b-45e3-be72-e380c2037b27","uuid":"57b746b6-ef4b-45e3-be72-e380c2037b27","networkInterfaces":[{"name":"nic_1","label":"Network - adapter 1","macAddress":"00:50:56:93:fb:46","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}],"disks":[{"diskObjectId":"403-2000","name":"disk_1","label":"Hard - disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"moName":"azurevmwarecloudtestubuntu20.04","memorySizeMB":2048,"numCPUs":1,"numCoresPerSocket":1,"osType":"Linux","osName":"Ubuntu - Linux (64-bit)","folderPath":"SDDC-Datacenter/Templates"}}]}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-vm1","name":"azcli-test-vm1","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T12:59:04.7997974Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T13:00:23.2903159Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Failed","customResourceName":"ce0e4391-4972-499a-ba6b-4aad235a5f83","uuid":"ce0e4391-4972-499a-ba6b-4aad235a5f83","vmId":"ce0e4391-4972-499a-ba6b-4aad235a5f83","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network + adapter 1","macAddress":"00:50:56:93:24:aa","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}]},"storageProfile":{"disks":[{"diskObjectId":"12430-2000","name":"disk_1","label":"Hard + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"","osType":"Linux","osName":"Ubuntu + Linux (64-bit)","toolsRunningStatus":"guestToolsNotRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11301"},"hardwareProfile":{"memorySizeMB":2048,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"ce0e4391-4972-499a-ba6b-4aad235a5f83","moRefId":"vm-24786","moName":"azcli-test-vm1","folderPath":"SDDC-Datacenter","powerState":"poweredOff"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-vm2","name":"azcli-test-vm2","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T13:01:40.9747469Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T13:03:08.5635184Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Failed","customResourceName":"73f5c042-0a76-4eae-a5a4-337a1355bf0b","uuid":"73f5c042-0a76-4eae-a5a4-337a1355bf0b","vmId":"73f5c042-0a76-4eae-a5a4-337a1355bf0b","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network + adapter 1","macAddress":"00:50:56:93:d4:5e","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}]},"storageProfile":{"disks":[{"diskObjectId":"12441-2000","name":"disk_1","label":"Hard + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"","osType":"Linux","osName":"Ubuntu + Linux (64-bit)","toolsRunningStatus":"guestToolsNotRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11301"},"hardwareProfile":{"memorySizeMB":2048,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"73f5c042-0a76-4eae-a5a4-337a1355bf0b","moRefId":"vm-24804","moName":"azcli-test-vm2","folderPath":"SDDC-Datacenter","powerState":"poweredOff"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-vm5","name":"azcli-test-vm5","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T18:28:42.4763239Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T18:30:02.1805026Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Failed","customResourceName":"97b4c72d-6fe5-4f09-a71a-f23f97fd023e","uuid":"97b4c72d-6fe5-4f09-a71a-f23f97fd023e","vmId":"97b4c72d-6fe5-4f09-a71a-f23f97fd023e","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network + adapter 1","macAddress":"00:50:56:93:81:7b","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}]},"storageProfile":{"disks":[{"diskObjectId":"12541-2000","name":"disk_1","label":"Hard + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"","osType":"Linux","osName":"Ubuntu + Linux (64-bit)","toolsRunningStatus":"guestToolsNotRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11301"},"hardwareProfile":{"memorySizeMB":2048,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"97b4c72d-6fe5-4f09-a71a-f23f97fd023e","moRefId":"vm-24976","moName":"azcli-test-vm5","folderPath":"SDDC-Datacenter","powerState":"poweredOff"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-vm6","name":"azcli-test-vm6","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T18:36:04.6331302Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T18:39:37.2256893Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template2","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Succeeded","customResourceName":"b84184fc-8e13-4147-a58c-99ac11a82e03","uuid":"b84184fc-8e13-4147-a58c-99ac11a82e03","vmId":"b84184fc-8e13-4147-a58c-99ac11a82e03","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network + adapter 1","macAddress":"00:50:56:93:d1:c3","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}]},"storageProfile":{"disks":[{"diskObjectId":"12551-2000","name":"disk_1","label":"Hard + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"azcli-test-vm6","osType":"Linux","osName":"Ubuntu + Linux (64-bit)","toolsRunningStatus":"guestToolsNotRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"b84184fc-8e13-4147-a58c-99ac11a82e03","moRefId":"vm-24993","moName":"azcli-test-vm6","folderPath":"SDDC-Datacenter","powerState":"poweredOff"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:29:53.8016842Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T19:31:28.0724561Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Succeeded","customResourceName":"3d8b4763-16cb-4b15-a57e-a0019157d2b7","uuid":"3d8b4763-16cb-4b15-a57e-a0019157d2b7","vmId":"3d8b4763-16cb-4b15-a57e-a0019157d2b7","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network + adapter 1","ipAddresses":["172.16.0.116","fe80::250:56ff:fe93:75b3"],"macAddress":"00:50:56:93:75:b3","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset","gateway":["172.16.0.1"],"ipAddress":"172.16.0.116","subnetMask":"255.255.252.0","ipAddressInfo":[{"ipAddress":"172.16.0.116","subnetMask":"255.255.252.0"},{"ipAddress":"fe80::250:56ff:fe93:75b3","subnetMask":"ffff:ffff:ffff:ffff:0000:0000:0000:0000"}]}}]},"storageProfile":{"disks":[{"diskObjectId":"12451-2000","name":"disk_1","label":"Hard + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"azcli-test-virtual-machine","osType":"Linux","osName":"Ubuntu + Linux (64-bit)","toolsRunningStatus":"guestToolsRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"3d8b4763-16cb-4b15-a57e-a0019157d2b7","moRefId":"vm-25036","moName":"azcli-test-virtual-machine","folderPath":"SDDC-Datacenter","powerState":"poweredOn"}}]}' headers: cache-control: - no-cache content-length: - - '1737' + - '13226' content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 13:39:39 GMT + - Tue, 18 May 2021 19:31:32 GMT expires: - '-1' pragma: @@ -851,29 +1444,81 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - connectedvmware inventory-item show_command + - connectedvmware vm delete Connection: - keep-alive + Content-Length: + - '0' ParameterSetName: - - -g --vcenter-name --inventory-item + - -g --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine?api-version=2020-10-01-preview&force=false + response: + body: + string: 'null' + headers: + api-supported-versions: + - 2019-12-20-privatepreview, 2020-10-01-preview + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 18 May 2021 19:31:35 GMT + etag: + - '"01005a21-0000-3400-0000-60a416170000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/5e064512-5619-4002-a393-1a00f124781f?api-version=2020-10-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14996' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware vm delete + Connection: + - keep-alive + ParameterSetName: + - -g --name User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/vcenters/azcli-test-vcenter-avs/inventoryItems/resgroup-5034?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/5e064512-5619-4002-a393-1a00f124781f?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/azcli-test-vcenter-avs/InventoryItems/resgroup-5034","name":"resgroup-5034","type":"microsoft.connectedvmwarevsphere/vcenters/inventoryitems","systemData":{"createdBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","createdByType":"Application","createdAt":"2021-05-17T11:38:31.7591468Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T12:54:33.3252357Z"},"properties":{"inventoryType":"ResourcePool","managedResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/ResourcePools/azcli-test-resource-pool","moRefId":"resgroup-5034","provisioningState":"Succeeded","parent":{"moName":"Resources","inventoryItemId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/azcli-test-vcenter-avs/InventoryItems/resgroup-8"},"moName":"SanmishraResourcePool"}}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/5e064512-5619-4002-a393-1a00f124781f","name":"5e064512-5619-4002-a393-1a00f124781f","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Succeeded","startTime":"2021-05-18T19:31:35.7932289Z","endTime":"2021-05-18T19:31:48.1545555Z","properties":null}' headers: cache-control: - no-cache content-length: - - '1116' + - '480' content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 13:39:41 GMT + - Tue, 18 May 2021 19:32:06 GMT etag: - - '"410034c2-0000-3400-0000-60a3b9090000"' + - '"0200fe3d-0000-3400-0000-60a416240000"' expires: - '-1' pragma: @@ -886,8 +1531,6 @@ interactions: - Accept-Encoding x-content-type-options: - nosniff - x-ms-providerhub-traffic: - - 'True' status: code: 200 message: OK @@ -923,13 +1566,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 13:39:43 GMT + - Tue, 18 May 2021 19:32:08 GMT etag: - - '"0000ef6c-0000-3400-0000-60a3c3a00000"' + - '"00008389-0000-3400-0000-60a416390000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/03b92c8b-4364-40a7-9b9f-bef0ea1faf29?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d643a3af-bdd7-47a2-9eae-9eeeca6cd267?api-version=2020-10-01-preview pragma: - no-cache strict-transport-security: @@ -939,7 +1582,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - - '14998' + - '14999' status: code: 202 message: Accepted @@ -959,10 +1602,10 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/03b92c8b-4364-40a7-9b9f-bef0ea1faf29?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d643a3af-bdd7-47a2-9eae-9eeeca6cd267?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/03b92c8b-4364-40a7-9b9f-bef0ea1faf29","name":"03b92c8b-4364-40a7-9b9f-bef0ea1faf29","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","status":"Succeeded","startTime":"2021-05-18T13:39:44.3151142Z","endTime":"2021-05-18T13:39:45.7503125Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d643a3af-bdd7-47a2-9eae-9eeeca6cd267","name":"d643a3af-bdd7-47a2-9eae-9eeeca6cd267","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","status":"Succeeded","startTime":"2021-05-18T19:32:09.0436292Z","endTime":"2021-05-18T19:32:09.9472992Z","properties":null}' headers: cache-control: - no-cache @@ -971,9 +1614,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 13:40:14 GMT + - Tue, 18 May 2021 19:32:39 GMT etag: - - '"0200412f-0000-3400-0000-60a3c3a10000"' + - '"0200033e-0000-3400-0000-60a416390000"' expires: - '-1' pragma: @@ -1021,13 +1664,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 13:40:16 GMT + - Tue, 18 May 2021 19:32:42 GMT etag: - - '"0100dff8-0000-3400-0000-60a3c3c00000"' + - '"02000606-0000-3400-0000-60a4165a0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/efb64f1a-8071-4d35-bb13-fd54e3f9c908?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/3b2982f6-04cc-40cf-94cf-42cff0c56693?api-version=2020-10-01-preview pragma: - no-cache strict-transport-security: @@ -1057,10 +1700,10 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/efb64f1a-8071-4d35-bb13-fd54e3f9c908?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/3b2982f6-04cc-40cf-94cf-42cff0c56693?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/efb64f1a-8071-4d35-bb13-fd54e3f9c908","name":"efb64f1a-8071-4d35-bb13-fd54e3f9c908","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","status":"Succeeded","startTime":"2021-05-18T13:40:16.3743534Z","endTime":"2021-05-18T13:40:18.2215669Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/3b2982f6-04cc-40cf-94cf-42cff0c56693","name":"3b2982f6-04cc-40cf-94cf-42cff0c56693","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","status":"Succeeded","startTime":"2021-05-18T19:32:42.5347627Z","endTime":"2021-05-18T19:32:43.1844139Z","properties":null}' headers: cache-control: - no-cache @@ -1069,9 +1712,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 13:40:46 GMT + - Tue, 18 May 2021 19:33:13 GMT etag: - - '"0200442f-0000-3400-0000-60a3c3c20000"' + - '"02002c3e-0000-3400-0000-60a4165b0000"' expires: - '-1' pragma: @@ -1119,13 +1762,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 13:40:49 GMT + - Tue, 18 May 2021 19:33:15 GMT etag: - - '"0000065d-0000-3400-0000-60a3c3e10000"' + - '"00004a5e-0000-3400-0000-60a4167c0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/caf49c04-38c2-4fb7-83b4-c033df21048d?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/a848ca77-6313-4c35-8c05-cb44dd21b3fd?api-version=2020-10-01-preview pragma: - no-cache strict-transport-security: @@ -1135,7 +1778,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - - '14999' + - '14998' status: code: 202 message: Accepted @@ -1155,10 +1798,10 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/caf49c04-38c2-4fb7-83b4-c033df21048d?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/a848ca77-6313-4c35-8c05-cb44dd21b3fd?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/caf49c04-38c2-4fb7-83b4-c033df21048d","name":"caf49c04-38c2-4fb7-83b4-c033df21048d","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","status":"Succeeded","startTime":"2021-05-18T13:40:49.5253554Z","endTime":"2021-05-18T13:40:50.3334457Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/a848ca77-6313-4c35-8c05-cb44dd21b3fd","name":"a848ca77-6313-4c35-8c05-cb44dd21b3fd","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","status":"Succeeded","startTime":"2021-05-18T19:33:16.3684672Z","endTime":"2021-05-18T19:33:17.3436288Z","properties":null}' headers: cache-control: - no-cache @@ -1167,9 +1810,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 13:41:19 GMT + - Tue, 18 May 2021 19:33:46 GMT etag: - - '"0200462f-0000-3400-0000-60a3c3e20000"' + - '"02002f3e-0000-3400-0000-60a4167d0000"' expires: - '-1' pragma: diff --git a/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py b/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py index 84cc18a0428..be8dc227edb 100644 --- a/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py +++ b/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py @@ -26,9 +26,9 @@ def test_connectedvmware(self): 'rp_name': 'azcli-test-resource-pool', 'vnet_morefid': 'network-o761', 'vnet_name': 'azcli-test-virtual-network', - 'vmtpl_morefid': 'vm-64', + 'vmtpl_morefid': 'vm-55', 'vmtpl_name': 'azcli-test-vm-template', - 'vm_name': 'azcli-test-vm' + 'vm_name': 'azcli-test-virtual-machine' }) # Validate the show command output with vcenter name. @@ -85,6 +85,22 @@ def test_connectedvmware(self): self.check('name', '{rp_morefid}'), ]) + # Create vm resource. + self.cmd('az connectedvmware vm create -g {rg} -l {loc} --custom-location {cus_loc} --vcenter {vc_name} --resource-pool {rp_name} --vm-template {vmtpl_name} --name {vm_name}') + + # Validate the show command output with vm name. + self.cmd('az connectedvmware vm show_command -g {rg} --name {vm_name}', checks=[ + self.check('name', '{vm_name}'), + ]) + + # List the vm resources in this resource group. + resource_list = self.cmd('az connectedvmware vm list -g {rg}').get_output_in_json() + # At this point there should be 1 vm resource. + assert len(resource_list) >= 1 + + # Delete the created vm. + self.cmd('az connectedvmware vm delete -g {rg} --name {vm_name}') + # Delete the created resource-pool. self.cmd('az connectedvmware resource-pool delete -g {rg} --name {rp_name}') From 6d5e640d6df39bfd3ea41b400a055930aa31d740 Mon Sep 17 00:00:00 2001 From: Santosh Mishra Date: Wed, 19 May 2021 14:40:18 +0530 Subject: [PATCH 10/13] Fix VM stop issue and add vm stop and start test. --- .../azext_connectedvmware/custom.py | 6 +- .../recordings/test_connectedvmware.yaml | 654 +++++++++--------- .../latest/test_connectedvmware_scenario.py | 10 +- 3 files changed, 347 insertions(+), 323 deletions(-) diff --git a/src/connectedvmware/azext_connectedvmware/custom.py b/src/connectedvmware/azext_connectedvmware/custom.py index 379dd647a29..6fc383a9d9b 100644 --- a/src/connectedvmware/azext_connectedvmware/custom.py +++ b/src/connectedvmware/azext_connectedvmware/custom.py @@ -58,6 +58,7 @@ VirtualMachineUpdate, VirtualNetwork, ExtendedLocation, + StopVirtualMachineOptions, ) from .vendored_sdks.operations import ( @@ -680,16 +681,17 @@ def stop_vm( client: VirtualMachinesOperations, resource_group_name, resource_name, - skip_shutdown=None, + skip_shutdown=False, no_wait=False, ): + body = StopVirtualMachineOptions(skip_shutdown=skip_shutdown) return sdk_no_wait( no_wait, client.begin_stop, resource_group_name, resource_name, - str(skip_shutdown).lower(), + body ) diff --git a/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware.yaml b/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware.yaml index 5dc4f529f1a..f5c2e988112 100644 --- a/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware.yaml +++ b/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware.yaml @@ -27,7 +27,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:25:34 GMT + - Wed, 19 May 2021 08:02:12 GMT etag: - '"03005e99-0000-3400-0000-60a255b90000"' expires: @@ -75,7 +75,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:25:36 GMT + - Wed, 19 May 2021 08:02:14 GMT expires: - '-1' pragma: @@ -119,22 +119,22 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:25:39.1685722Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-18T19:25:39.1685722Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Accepted"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T08:02:16.765789Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-19T08:02:16.765789Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Accepted"}}' headers: api-supported-versions: - 2019-12-20-privatepreview, 2020-10-01-preview azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/b9484208-5949-46c9-a239-009814c5d74f?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/0a3d9ecd-ca1a-4290-b89c-3248e1e0e7a6?api-version=2020-10-01-preview cache-control: - no-cache content-length: - - '972' + - '970' content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:25:41 GMT + - Wed, 19 May 2021 08:02:19 GMT etag: - - '"00005c89-0000-3400-0000-60a414b50000"' + - '"00000f9e-0000-3400-0000-60a4c60a0000"' expires: - '-1' location: @@ -148,7 +148,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1197' status: code: 201 message: Created @@ -168,21 +168,21 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/b9484208-5949-46c9-a239-009814c5d74f?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/0a3d9ecd-ca1a-4290-b89c-3248e1e0e7a6?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/b9484208-5949-46c9-a239-009814c5d74f","name":"b9484208-5949-46c9-a239-009814c5d74f","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","status":"Succeeded","startTime":"2021-05-18T19:25:41.3383315Z","endTime":"2021-05-18T19:25:46.7204927Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/0a3d9ecd-ca1a-4290-b89c-3248e1e0e7a6","name":"0a3d9ecd-ca1a-4290-b89c-3248e1e0e7a6","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","status":"Succeeded","startTime":"2021-05-19T08:02:18.591482Z","endTime":"2021-05-19T08:02:23.9870219Z","properties":null}' headers: cache-control: - no-cache content-length: - - '476' + - '475' content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:26:12 GMT + - Wed, 19 May 2021 08:02:49 GMT etag: - - '"0200c23d-0000-3400-0000-60a414ba0000"' + - '"0200fd68-0000-3400-0000-60a4c60f0000"' expires: - '-1' pragma: @@ -217,18 +217,18 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:25:39.1685722Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T19:25:46.4434332Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Succeeded","customResourceName":"cc2e2607-a2a9-48d3-9b25-984e9d70ae41","uuid":"cc2e2607-a2a9-48d3-9b25-984e9d70ae41","moName":"SanmishraResourcePool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T08:02:16.765789Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T08:02:23.7243045Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Succeeded","customResourceName":"37931da9-67a0-412e-baac-04f81232a5ba","uuid":"37931da9-67a0-412e-baac-04f81232a5ba","moName":"SanmishraResourcePool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}' headers: cache-control: - no-cache content-length: - - '1217' + - '1216' content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:26:12 GMT + - Wed, 19 May 2021 08:02:49 GMT etag: - - '"00006289-0000-3400-0000-60a414ba0000"' + - '"0000159e-0000-3400-0000-60a4c6100000"' expires: - '-1' pragma: @@ -265,18 +265,18 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:25:39.1685722Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T19:25:46.4434332Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Succeeded","customResourceName":"cc2e2607-a2a9-48d3-9b25-984e9d70ae41","uuid":"cc2e2607-a2a9-48d3-9b25-984e9d70ae41","moName":"SanmishraResourcePool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T08:02:16.765789Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T08:02:23.7243045Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Succeeded","customResourceName":"37931da9-67a0-412e-baac-04f81232a5ba","uuid":"37931da9-67a0-412e-baac-04f81232a5ba","moName":"SanmishraResourcePool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}' headers: cache-control: - no-cache content-length: - - '1217' + - '1216' content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:26:14 GMT + - Wed, 19 May 2021 08:02:56 GMT etag: - - '"00006289-0000-3400-0000-60a414ba0000"' + - '"0000159e-0000-3400-0000-60a4c6100000"' expires: - '-1' pragma: @@ -313,16 +313,16 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools?api-version=2020-10-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:25:39.1685722Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T19:25:46.4434332Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Succeeded","customResourceName":"cc2e2607-a2a9-48d3-9b25-984e9d70ae41","uuid":"cc2e2607-a2a9-48d3-9b25-984e9d70ae41","moName":"SanmishraResourcePool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}]}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T08:02:16.765789Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T08:02:23.7243045Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Succeeded","customResourceName":"37931da9-67a0-412e-baac-04f81232a5ba","uuid":"37931da9-67a0-412e-baac-04f81232a5ba","moName":"SanmishraResourcePool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}]}' headers: cache-control: - no-cache content-length: - - '1229' + - '1228' content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:26:21 GMT + - Wed, 19 May 2021 08:02:57 GMT expires: - '-1' pragma: @@ -366,22 +366,22 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:26:25.120357Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-18T19:26:25.120357Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Accepted"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T08:03:00.8033039Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-19T08:03:00.8033039Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Accepted"}}' headers: api-supported-versions: - 2019-12-20-privatepreview, 2020-10-01-preview azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/6c6f9820-48d3-4100-9d5b-55b8b86a1ddf?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/ac55316a-f3d4-40da-b7b0-4d411d5be6de?api-version=2020-10-01-preview cache-control: - no-cache content-length: - - '977' + - '979' content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:26:29 GMT + - Wed, 19 May 2021 08:03:02 GMT etag: - - '"0200eb05-0000-3400-0000-60a414e50000"' + - '"02008754-0000-3400-0000-60a4c6360000"' expires: - '-1' location: @@ -415,194 +415,10 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/6c6f9820-48d3-4100-9d5b-55b8b86a1ddf?api-version=2020-10-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/6c6f9820-48d3-4100-9d5b-55b8b86a1ddf","name":"6c6f9820-48d3-4100-9d5b-55b8b86a1ddf","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","status":"Accepted","startTime":"2021-05-18T19:26:29.4569051Z"}' - headers: - cache-control: - - no-cache - content-length: - - '420' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 18 May 2021 19:27:00 GMT - etag: - - '"0200cd3d-0000-3400-0000-60a414e50000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedvmware virtual-network create - Connection: - - keep-alive - ParameterSetName: - - -g -l --custom-location --vcenter --mo-ref-id --name - User-Agent: - - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/6c6f9820-48d3-4100-9d5b-55b8b86a1ddf?api-version=2020-10-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/6c6f9820-48d3-4100-9d5b-55b8b86a1ddf","name":"6c6f9820-48d3-4100-9d5b-55b8b86a1ddf","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","status":"Accepted","startTime":"2021-05-18T19:26:29.4569051Z"}' - headers: - cache-control: - - no-cache - content-length: - - '420' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 18 May 2021 19:27:30 GMT - etag: - - '"0200cd3d-0000-3400-0000-60a414e50000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedvmware virtual-network create - Connection: - - keep-alive - ParameterSetName: - - -g -l --custom-location --vcenter --mo-ref-id --name - User-Agent: - - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/6c6f9820-48d3-4100-9d5b-55b8b86a1ddf?api-version=2020-10-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/6c6f9820-48d3-4100-9d5b-55b8b86a1ddf","name":"6c6f9820-48d3-4100-9d5b-55b8b86a1ddf","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","status":"Accepted","startTime":"2021-05-18T19:26:29.4569051Z"}' - headers: - cache-control: - - no-cache - content-length: - - '420' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 18 May 2021 19:28:00 GMT - etag: - - '"0200cd3d-0000-3400-0000-60a414e50000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedvmware virtual-network create - Connection: - - keep-alive - ParameterSetName: - - -g -l --custom-location --vcenter --mo-ref-id --name - User-Agent: - - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/6c6f9820-48d3-4100-9d5b-55b8b86a1ddf?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/ac55316a-f3d4-40da-b7b0-4d411d5be6de?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/6c6f9820-48d3-4100-9d5b-55b8b86a1ddf","name":"6c6f9820-48d3-4100-9d5b-55b8b86a1ddf","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","status":"Accepted","startTime":"2021-05-18T19:26:29.4569051Z"}' - headers: - cache-control: - - no-cache - content-length: - - '420' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 18 May 2021 19:28:31 GMT - etag: - - '"0200cd3d-0000-3400-0000-60a414e50000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - connectedvmware virtual-network create - Connection: - - keep-alive - ParameterSetName: - - -g -l --custom-location --vcenter --mo-ref-id --name - User-Agent: - - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/6c6f9820-48d3-4100-9d5b-55b8b86a1ddf?api-version=2020-10-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/6c6f9820-48d3-4100-9d5b-55b8b86a1ddf","name":"6c6f9820-48d3-4100-9d5b-55b8b86a1ddf","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","status":"Succeeded","startTime":"2021-05-18T19:26:29.4569051Z","endTime":"2021-05-18T19:28:43.6851948Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/ac55316a-f3d4-40da-b7b0-4d411d5be6de","name":"ac55316a-f3d4-40da-b7b0-4d411d5be6de","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","status":"Succeeded","startTime":"2021-05-19T08:03:01.8890214Z","endTime":"2021-05-19T08:03:06.5763703Z","properties":null}' headers: cache-control: - no-cache @@ -611,9 +427,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:29:01 GMT + - Wed, 19 May 2021 08:03:32 GMT etag: - - '"0200dd3d-0000-3400-0000-60a4156b0000"' + - '"02001d69-0000-3400-0000-60a4c63a0000"' expires: - '-1' pragma: @@ -648,7 +464,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:26:25.120357Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T19:28:43.3653125Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Succeeded","customResourceName":"f7b95c73-47f7-4faa-84eb-e5ddfe445366","uuid":"f7b95c73-47f7-4faa-84eb-e5ddfe445366","moName":"segment-2"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T08:03:00.8033039Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T08:03:06.332101Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Succeeded","customResourceName":"c104cd42-5728-480b-87b3-6dd4624c133d","uuid":"c104cd42-5728-480b-87b3-6dd4624c133d","moName":"segment-2"}}' headers: cache-control: - no-cache @@ -657,9 +473,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:29:02 GMT + - Wed, 19 May 2021 08:03:33 GMT etag: - - '"0200f105-0000-3400-0000-60a4156b0000"' + - '"0200b554-0000-3400-0000-60a4c63a0000"' expires: - '-1' pragma: @@ -696,7 +512,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:26:25.120357Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T19:28:43.3653125Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Succeeded","customResourceName":"f7b95c73-47f7-4faa-84eb-e5ddfe445366","uuid":"f7b95c73-47f7-4faa-84eb-e5ddfe445366","moName":"segment-2"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T08:03:00.8033039Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T08:03:06.332101Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Succeeded","customResourceName":"c104cd42-5728-480b-87b3-6dd4624c133d","uuid":"c104cd42-5728-480b-87b3-6dd4624c133d","moName":"segment-2"}}' headers: cache-control: - no-cache @@ -705,9 +521,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:29:05 GMT + - Wed, 19 May 2021 08:03:34 GMT etag: - - '"0200f105-0000-3400-0000-60a4156b0000"' + - '"0200b554-0000-3400-0000-60a4c63a0000"' expires: - '-1' pragma: @@ -744,7 +560,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks?api-version=2020-10-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:26:25.120357Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T19:28:43.3653125Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Succeeded","customResourceName":"f7b95c73-47f7-4faa-84eb-e5ddfe445366","uuid":"f7b95c73-47f7-4faa-84eb-e5ddfe445366","moName":"segment-2"}}]}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T08:03:00.8033039Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T08:03:06.332101Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Succeeded","customResourceName":"c104cd42-5728-480b-87b3-6dd4624c133d","uuid":"c104cd42-5728-480b-87b3-6dd4624c133d","moName":"segment-2"}}]}' headers: cache-control: - no-cache @@ -753,7 +569,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:29:07 GMT + - Wed, 19 May 2021 08:03:36 GMT expires: - '-1' pragma: @@ -797,22 +613,25 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:29:10.3767045Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-18T19:29:10.3767045Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"vm-55","provisioningState":"Accepted"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T07:32:47.7931701Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T07:32:55.3327703Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","networkInterfaces":[{"name":"nic_1","label":"Network + adapter 1","macAddress":"00:50:56:93:fb:46","networkId":null,"networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}],"disks":[{"diskObjectId":"403-2000","name":"disk_1","label":"Hard + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"customResourceName":"815156a3-2df3-4655-9cab-5c43eeb9804c","moRefId":"vm-55","moName":"azurevmwarecloudtestubuntu20.04","memorySizeMB":2048,"numCPUs":1,"numCoresPerSocket":1,"osName":"Ubuntu + Linux (64-bit)","folderPath":"SDDC-Datacenter/Templates","uuid":"815156a3-2df3-4655-9cab-5c43eeb9804c","provisioningState":"Accepted"}}' headers: api-supported-versions: - 2019-12-20-privatepreview, 2020-10-01-preview azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/af143eaf-f161-4be9-a448-9baf065120bd?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/20e81ce8-9326-4af6-b560-91faa6c3516e?api-version=2020-10-01-preview cache-control: - no-cache content-length: - - '980' + - '1725' content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:29:12 GMT + - Wed, 19 May 2021 08:03:39 GMT etag: - - '"0000335e-0000-3400-0000-60a415880000"' + - '"00007b69-0000-3400-0000-60a4c65c0000"' expires: - '-1' location: @@ -846,10 +665,10 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/af143eaf-f161-4be9-a448-9baf065120bd?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/20e81ce8-9326-4af6-b560-91faa6c3516e?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/af143eaf-f161-4be9-a448-9baf065120bd","name":"af143eaf-f161-4be9-a448-9baf065120bd","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","status":"Succeeded","startTime":"2021-05-18T19:29:12.4997597Z","endTime":"2021-05-18T19:29:16.5301458Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/20e81ce8-9326-4af6-b560-91faa6c3516e","name":"20e81ce8-9326-4af6-b560-91faa6c3516e","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","status":"Succeeded","startTime":"2021-05-19T08:03:40.3557665Z","endTime":"2021-05-19T08:03:43.7933698Z","properties":null}' headers: cache-control: - no-cache @@ -858,9 +677,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:29:43 GMT + - Wed, 19 May 2021 08:04:11 GMT etag: - - '"0200e03d-0000-3400-0000-60a4158c0000"' + - '"02002369-0000-3400-0000-60a4c65f0000"' expires: - '-1' pragma: @@ -895,10 +714,10 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:29:10.3767045Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T19:29:16.3313464Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"vm-55","provisioningState":"Succeeded","customResourceName":"b90215fb-1d10-4876-832c-cbe192f0c694","uuid":"b90215fb-1d10-4876-832c-cbe192f0c694","networkInterfaces":[{"name":"nic_1","label":"Network + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T07:32:47.7931701Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T08:03:43.5788892Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","networkInterfaces":[{"name":"nic_1","label":"Network adapter 1","macAddress":"00:50:56:93:2b:71","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}],"disks":[{"diskObjectId":"1816-2000","name":"disk_1","label":"Hard - disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"moName":"azurevmwarecloudtestubuntu","memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"osType":"Linux","osName":"Ubuntu - Linux (64-bit)","folderPath":"SDDC-Datacenter/Templates"}}' + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"customResourceName":"815156a3-2df3-4655-9cab-5c43eeb9804c","moRefId":"vm-55","moName":"azurevmwarecloudtestubuntu","memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"osName":"Ubuntu + Linux (64-bit)","folderPath":"SDDC-Datacenter/Templates","uuid":"815156a3-2df3-4655-9cab-5c43eeb9804c","provisioningState":"Succeeded","osType":"Linux"}}' headers: cache-control: - no-cache @@ -907,9 +726,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:29:44 GMT + - Wed, 19 May 2021 08:04:11 GMT etag: - - '"0000395e-0000-3400-0000-60a4158c0000"' + - '"00008069-0000-3400-0000-60a4c65f0000"' expires: - '-1' pragma: @@ -946,10 +765,10 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:29:10.3767045Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T19:29:16.3313464Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"vm-55","provisioningState":"Succeeded","customResourceName":"b90215fb-1d10-4876-832c-cbe192f0c694","uuid":"b90215fb-1d10-4876-832c-cbe192f0c694","networkInterfaces":[{"name":"nic_1","label":"Network + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T07:32:47.7931701Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T08:03:43.5788892Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","networkInterfaces":[{"name":"nic_1","label":"Network adapter 1","macAddress":"00:50:56:93:2b:71","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}],"disks":[{"diskObjectId":"1816-2000","name":"disk_1","label":"Hard - disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"moName":"azurevmwarecloudtestubuntu","memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"osType":"Linux","osName":"Ubuntu - Linux (64-bit)","folderPath":"SDDC-Datacenter/Templates"}}' + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"customResourceName":"815156a3-2df3-4655-9cab-5c43eeb9804c","moRefId":"vm-55","moName":"azurevmwarecloudtestubuntu","memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"osName":"Ubuntu + Linux (64-bit)","folderPath":"SDDC-Datacenter/Templates","uuid":"815156a3-2df3-4655-9cab-5c43eeb9804c","provisioningState":"Succeeded","osType":"Linux"}}' headers: cache-control: - no-cache @@ -958,9 +777,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:29:46 GMT + - Wed, 19 May 2021 08:04:12 GMT etag: - - '"0000395e-0000-3400-0000-60a4158c0000"' + - '"00008069-0000-3400-0000-60a4c65f0000"' expires: - '-1' pragma: @@ -997,10 +816,10 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates?api-version=2020-10-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:29:10.3767045Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T19:29:16.3313464Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"vm-55","provisioningState":"Succeeded","customResourceName":"b90215fb-1d10-4876-832c-cbe192f0c694","uuid":"b90215fb-1d10-4876-832c-cbe192f0c694","networkInterfaces":[{"name":"nic_1","label":"Network + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T07:32:47.7931701Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T08:03:43.5788892Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","networkInterfaces":[{"name":"nic_1","label":"Network adapter 1","macAddress":"00:50:56:93:2b:71","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}],"disks":[{"diskObjectId":"1816-2000","name":"disk_1","label":"Hard - disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"moName":"azurevmwarecloudtestubuntu","memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"osType":"Linux","osName":"Ubuntu - Linux (64-bit)","folderPath":"SDDC-Datacenter/Templates"}}]}' + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"customResourceName":"815156a3-2df3-4655-9cab-5c43eeb9804c","moRefId":"vm-55","moName":"azurevmwarecloudtestubuntu","memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"osName":"Ubuntu + Linux (64-bit)","folderPath":"SDDC-Datacenter/Templates","uuid":"815156a3-2df3-4655-9cab-5c43eeb9804c","provisioningState":"Succeeded","osType":"Linux"}}]}' headers: cache-control: - no-cache @@ -1009,7 +828,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:29:48 GMT + - Wed, 19 May 2021 08:04:13 GMT expires: - '-1' pragma: @@ -1046,18 +865,18 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/vcenters/azcli-test-vcenter-avs/inventoryItems/resgroup-5034?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/azcli-test-vcenter-avs/InventoryItems/resgroup-5034","name":"resgroup-5034","type":"microsoft.connectedvmwarevsphere/vcenters/inventoryitems","systemData":{"createdBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","createdByType":"Application","createdAt":"2021-05-17T11:38:31.7591468Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T19:03:10.0204731Z"},"properties":{"inventoryType":"ResourcePool","managedResourceId":"","moRefId":"resgroup-5034","provisioningState":"Succeeded","parent":{"moName":"Resources","inventoryItemId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/azcli-test-vcenter-avs/InventoryItems/resgroup-8"},"moName":"SanmishraResourcePool"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/azcli-test-vcenter-avs/InventoryItems/resgroup-5034","name":"resgroup-5034","type":"microsoft.connectedvmwarevsphere/vcenters/inventoryitems","systemData":{"createdBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","createdByType":"Application","createdAt":"2021-05-17T11:38:31.7591468Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T07:30:22.0003802Z"},"properties":{"inventoryType":"ResourcePool","managedResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/ResourcePools/azcli-test-resource-pool","moRefId":"resgroup-5034","provisioningState":"Succeeded","parent":{"moName":"Resources","inventoryItemId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/azcli-test-vcenter-avs/InventoryItems/resgroup-8"},"moName":"SanmishraResourcePool"}}' headers: cache-control: - no-cache content-length: - - '954' + - '1116' content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:29:51 GMT + - Wed, 19 May 2021 08:04:15 GMT etag: - - '"46003de7-0000-3400-0000-60a40f6e0000"' + - '"51006bb6-0000-3400-0000-60a4be8e0000"' expires: - '-1' pragma: @@ -1102,12 +921,12 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:29:53.8016842Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-18T19:29:53.8016842Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Accepted"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T08:04:18.1437613Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-19T08:04:18.1437613Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Accepted"}}' headers: api-supported-versions: - 2019-12-20-privatepreview, 2020-10-01-preview azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d364bd4b-7a37-491c-b033-bb793fc7b7ee?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/c34c048d-5b7a-4a8a-bfc1-ad8e75fd36ca?api-version=2020-10-01-preview cache-control: - no-cache content-length: @@ -1115,9 +934,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:29:56 GMT + - Wed, 19 May 2021 08:04:19 GMT etag: - - '"01002821-0000-3400-0000-60a415b40000"' + - '"01009e4d-0000-3400-0000-60a4c6830000"' expires: - '-1' location: @@ -1131,7 +950,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 201 message: Created @@ -1151,10 +970,10 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d364bd4b-7a37-491c-b033-bb793fc7b7ee?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/c34c048d-5b7a-4a8a-bfc1-ad8e75fd36ca?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d364bd4b-7a37-491c-b033-bb793fc7b7ee","name":"d364bd4b-7a37-491c-b033-bb793fc7b7ee","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Accepted","startTime":"2021-05-18T19:29:55.6615302Z"}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/c34c048d-5b7a-4a8a-bfc1-ad8e75fd36ca","name":"c34c048d-5b7a-4a8a-bfc1-ad8e75fd36ca","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Accepted","startTime":"2021-05-19T08:04:19.3809311Z"}' headers: cache-control: - no-cache @@ -1163,9 +982,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:30:26 GMT + - Wed, 19 May 2021 08:04:49 GMT etag: - - '"0200e43d-0000-3400-0000-60a415b30000"' + - '"02002469-0000-3400-0000-60a4c6830000"' expires: - '-1' pragma: @@ -1197,10 +1016,10 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d364bd4b-7a37-491c-b033-bb793fc7b7ee?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/c34c048d-5b7a-4a8a-bfc1-ad8e75fd36ca?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d364bd4b-7a37-491c-b033-bb793fc7b7ee","name":"d364bd4b-7a37-491c-b033-bb793fc7b7ee","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Accepted","startTime":"2021-05-18T19:29:55.6615302Z"}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/c34c048d-5b7a-4a8a-bfc1-ad8e75fd36ca","name":"c34c048d-5b7a-4a8a-bfc1-ad8e75fd36ca","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Accepted","startTime":"2021-05-19T08:04:19.3809311Z"}' headers: cache-control: - no-cache @@ -1209,9 +1028,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:30:57 GMT + - Wed, 19 May 2021 08:05:20 GMT etag: - - '"0200e43d-0000-3400-0000-60a415b30000"' + - '"02002469-0000-3400-0000-60a4c6830000"' expires: - '-1' pragma: @@ -1243,10 +1062,10 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d364bd4b-7a37-491c-b033-bb793fc7b7ee?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/c34c048d-5b7a-4a8a-bfc1-ad8e75fd36ca?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d364bd4b-7a37-491c-b033-bb793fc7b7ee","name":"d364bd4b-7a37-491c-b033-bb793fc7b7ee","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Succeeded","startTime":"2021-05-18T19:29:55.6615302Z","endTime":"2021-05-18T19:31:12.4365947Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/c34c048d-5b7a-4a8a-bfc1-ad8e75fd36ca","name":"c34c048d-5b7a-4a8a-bfc1-ad8e75fd36ca","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Succeeded","startTime":"2021-05-19T08:04:19.3809311Z","endTime":"2021-05-19T08:05:40.9702005Z","properties":null}' headers: cache-control: - no-cache @@ -1255,9 +1074,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:31:27 GMT + - Wed, 19 May 2021 08:05:50 GMT etag: - - '"0200f03d-0000-3400-0000-60a416000000"' + - '"02002769-0000-3400-0000-60a4c6d40000"' expires: - '-1' pragma: @@ -1292,21 +1111,21 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:29:53.8016842Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T19:31:28.0724561Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Succeeded","customResourceName":"3d8b4763-16cb-4b15-a57e-a0019157d2b7","uuid":"3d8b4763-16cb-4b15-a57e-a0019157d2b7","vmId":"3d8b4763-16cb-4b15-a57e-a0019157d2b7","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network - adapter 1","ipAddresses":["172.16.0.116","fe80::250:56ff:fe93:75b3"],"macAddress":"00:50:56:93:75:b3","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset","gateway":["172.16.0.1"],"ipAddress":"172.16.0.116","subnetMask":"255.255.252.0","ipAddressInfo":[{"ipAddress":"172.16.0.116","subnetMask":"255.255.252.0"},{"ipAddress":"fe80::250:56ff:fe93:75b3","subnetMask":"ffff:ffff:ffff:ffff:0000:0000:0000:0000"}]}}]},"storageProfile":{"disks":[{"diskObjectId":"12451-2000","name":"disk_1","label":"Hard - disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"azcli-test-virtual-machine","osType":"Linux","osName":"Ubuntu - Linux (64-bit)","toolsRunningStatus":"guestToolsRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"3d8b4763-16cb-4b15-a57e-a0019157d2b7","moRefId":"vm-25036","moName":"azcli-test-virtual-machine","folderPath":"SDDC-Datacenter","powerState":"poweredOn"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T08:04:18.1437613Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T08:05:40.7415117Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Succeeded","customResourceName":"7c45803e-848b-47c7-9cd8-5f2cdf90aeb3","uuid":"7c45803e-848b-47c7-9cd8-5f2cdf90aeb3","vmId":"7c45803e-848b-47c7-9cd8-5f2cdf90aeb3","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network + adapter 1","macAddress":"00:50:56:93:43:f8","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}]},"storageProfile":{"disks":[{"diskObjectId":"12573-2000","name":"disk_1","label":"Hard + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"","osType":"Linux","osName":"Ubuntu + Linux (64-bit)","toolsRunningStatus":"guestToolsRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"7c45803e-848b-47c7-9cd8-5f2cdf90aeb3","moRefId":"vm-25277","moName":"azcli-test-virtual-machine","folderPath":"SDDC-Datacenter","powerState":"poweredOn"}}' headers: cache-control: - no-cache content-length: - - '2936' + - '2599' content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:31:28 GMT + - Wed, 19 May 2021 08:05:51 GMT etag: - - '"01005421-0000-3400-0000-60a416100000"' + - '"0100de4d-0000-3400-0000-60a4c6d40000"' expires: - '-1' pragma: @@ -1343,21 +1162,21 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:29:53.8016842Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T19:31:28.0724561Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Succeeded","customResourceName":"3d8b4763-16cb-4b15-a57e-a0019157d2b7","uuid":"3d8b4763-16cb-4b15-a57e-a0019157d2b7","vmId":"3d8b4763-16cb-4b15-a57e-a0019157d2b7","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network - adapter 1","ipAddresses":["172.16.0.116","fe80::250:56ff:fe93:75b3"],"macAddress":"00:50:56:93:75:b3","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset","gateway":["172.16.0.1"],"ipAddress":"172.16.0.116","subnetMask":"255.255.252.0","ipAddressInfo":[{"ipAddress":"172.16.0.116","subnetMask":"255.255.252.0"},{"ipAddress":"fe80::250:56ff:fe93:75b3","subnetMask":"ffff:ffff:ffff:ffff:0000:0000:0000:0000"}]}}]},"storageProfile":{"disks":[{"diskObjectId":"12451-2000","name":"disk_1","label":"Hard - disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"azcli-test-virtual-machine","osType":"Linux","osName":"Ubuntu - Linux (64-bit)","toolsRunningStatus":"guestToolsRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"3d8b4763-16cb-4b15-a57e-a0019157d2b7","moRefId":"vm-25036","moName":"azcli-test-virtual-machine","folderPath":"SDDC-Datacenter","powerState":"poweredOn"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T08:04:18.1437613Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T08:05:40.7415117Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Succeeded","customResourceName":"7c45803e-848b-47c7-9cd8-5f2cdf90aeb3","uuid":"7c45803e-848b-47c7-9cd8-5f2cdf90aeb3","vmId":"7c45803e-848b-47c7-9cd8-5f2cdf90aeb3","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network + adapter 1","macAddress":"00:50:56:93:43:f8","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}]},"storageProfile":{"disks":[{"diskObjectId":"12573-2000","name":"disk_1","label":"Hard + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"","osType":"Linux","osName":"Ubuntu + Linux (64-bit)","toolsRunningStatus":"guestToolsRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"7c45803e-848b-47c7-9cd8-5f2cdf90aeb3","moRefId":"vm-25277","moName":"azcli-test-virtual-machine","folderPath":"SDDC-Datacenter","powerState":"poweredOn"}}' headers: cache-control: - no-cache content-length: - - '2936' + - '2599' content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:31:30 GMT + - Wed, 19 May 2021 08:05:53 GMT etag: - - '"01005421-0000-3400-0000-60a416100000"' + - '"0100de4d-0000-3400-0000-60a4c6d40000"' expires: - '-1' pragma: @@ -1406,19 +1225,122 @@ interactions: Linux (64-bit)","toolsRunningStatus":"guestToolsNotRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11301"},"hardwareProfile":{"memorySizeMB":2048,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"97b4c72d-6fe5-4f09-a71a-f23f97fd023e","moRefId":"vm-24976","moName":"azcli-test-vm5","folderPath":"SDDC-Datacenter","powerState":"poweredOff"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-vm6","name":"azcli-test-vm6","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T18:36:04.6331302Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T18:39:37.2256893Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template2","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Succeeded","customResourceName":"b84184fc-8e13-4147-a58c-99ac11a82e03","uuid":"b84184fc-8e13-4147-a58c-99ac11a82e03","vmId":"b84184fc-8e13-4147-a58c-99ac11a82e03","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network adapter 1","macAddress":"00:50:56:93:d1:c3","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}]},"storageProfile":{"disks":[{"diskObjectId":"12551-2000","name":"disk_1","label":"Hard disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"azcli-test-vm6","osType":"Linux","osName":"Ubuntu - Linux (64-bit)","toolsRunningStatus":"guestToolsNotRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"b84184fc-8e13-4147-a58c-99ac11a82e03","moRefId":"vm-24993","moName":"azcli-test-vm6","folderPath":"SDDC-Datacenter","powerState":"poweredOff"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-18T19:29:53.8016842Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-18T19:31:28.0724561Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Succeeded","customResourceName":"3d8b4763-16cb-4b15-a57e-a0019157d2b7","uuid":"3d8b4763-16cb-4b15-a57e-a0019157d2b7","vmId":"3d8b4763-16cb-4b15-a57e-a0019157d2b7","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network - adapter 1","ipAddresses":["172.16.0.116","fe80::250:56ff:fe93:75b3"],"macAddress":"00:50:56:93:75:b3","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset","gateway":["172.16.0.1"],"ipAddress":"172.16.0.116","subnetMask":"255.255.252.0","ipAddressInfo":[{"ipAddress":"172.16.0.116","subnetMask":"255.255.252.0"},{"ipAddress":"fe80::250:56ff:fe93:75b3","subnetMask":"ffff:ffff:ffff:ffff:0000:0000:0000:0000"}]}}]},"storageProfile":{"disks":[{"diskObjectId":"12451-2000","name":"disk_1","label":"Hard - disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"azcli-test-virtual-machine","osType":"Linux","osName":"Ubuntu - Linux (64-bit)","toolsRunningStatus":"guestToolsRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"3d8b4763-16cb-4b15-a57e-a0019157d2b7","moRefId":"vm-25036","moName":"azcli-test-virtual-machine","folderPath":"SDDC-Datacenter","powerState":"poweredOn"}}]}' + Linux (64-bit)","toolsRunningStatus":"guestToolsNotRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"b84184fc-8e13-4147-a58c-99ac11a82e03","moRefId":"vm-24993","moName":"azcli-test-vm6","folderPath":"SDDC-Datacenter","powerState":"poweredOff"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/stop-vm-test","name":"stop-vm-test","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T07:36:13.9786742Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T07:37:42.6131581Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Failed","customResourceName":"f4e0270f-9f91-4150-b6e9-bb6ac0d3783d","uuid":"f4e0270f-9f91-4150-b6e9-bb6ac0d3783d","vmId":"f4e0270f-9f91-4150-b6e9-bb6ac0d3783d","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network + adapter 1","macAddress":"00:50:56:93:56:85","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}]},"storageProfile":{"disks":[{"diskObjectId":"12201-2000","name":"disk_1","label":"Hard + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"","osType":"Linux","osName":"Ubuntu + Linux (64-bit)","toolsRunningStatus":"guestToolsNotRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11301"},"hardwareProfile":{"memorySizeMB":2048,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"f4e0270f-9f91-4150-b6e9-bb6ac0d3783d","moRefId":"vm-25216","moName":"stop-vm-test","folderPath":"SDDC-Datacenter","powerState":"poweredOff"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T08:04:18.1437613Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T08:05:40.7415117Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Succeeded","customResourceName":"7c45803e-848b-47c7-9cd8-5f2cdf90aeb3","uuid":"7c45803e-848b-47c7-9cd8-5f2cdf90aeb3","vmId":"7c45803e-848b-47c7-9cd8-5f2cdf90aeb3","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network + adapter 1","macAddress":"00:50:56:93:43:f8","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}]},"storageProfile":{"disks":[{"diskObjectId":"12573-2000","name":"disk_1","label":"Hard + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"","osType":"Linux","osName":"Ubuntu + Linux (64-bit)","toolsRunningStatus":"guestToolsRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"7c45803e-848b-47c7-9cd8-5f2cdf90aeb3","moRefId":"vm-25277","moName":"azcli-test-virtual-machine","folderPath":"SDDC-Datacenter","powerState":"poweredOn"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '15448' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 May 2021 08:05:56 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: '{"skipShutdown": false}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware vm stop + Connection: + - keep-alive + Content-Length: + - '23' + Content-Type: + - application/json + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine/stop?api-version=2020-10-01-preview + response: + body: + string: 'null' + headers: + api-supported-versions: + - 2019-12-20-privatepreview, 2020-10-01-preview + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 May 2021 08:05:57 GMT + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/279a9d20-16b3-41a7-8dec-9c4b436f403d?api-version=2020-10-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware vm stop + Connection: + - keep-alive + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/279a9d20-16b3-41a7-8dec-9c4b436f403d?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/279a9d20-16b3-41a7-8dec-9c4b436f403d","name":"279a9d20-16b3-41a7-8dec-9c4b436f403d","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Succeeded","startTime":"2021-05-19T08:05:58.3132487Z","endTime":"2021-05-19T08:06:12.8498955Z","properties":null}' headers: cache-control: - no-cache content-length: - - '13226' + - '480' content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:31:32 GMT + - Wed, 19 May 2021 08:06:29 GMT + etag: + - '"02002b69-0000-3400-0000-60a4c6f40000"' expires: - '-1' pragma: @@ -1431,8 +1353,102 @@ interactions: - Accept-Encoding x-content-type-options: - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware vm start + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine/start?api-version=2020-10-01-preview + response: + body: + string: 'null' + headers: + api-supported-versions: + - 2019-12-20-privatepreview, 2020-10-01-preview + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 May 2021 08:06:31 GMT + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/530ba403-be76-498e-83c5-078a43fedacd?api-version=2020-10-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff x-ms-providerhub-traffic: - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware vm start + Connection: + - keep-alive + ParameterSetName: + - -g --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/530ba403-be76-498e-83c5-078a43fedacd?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/530ba403-be76-498e-83c5-078a43fedacd","name":"530ba403-be76-498e-83c5-078a43fedacd","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Succeeded","startTime":"2021-05-19T08:06:31.174244Z","endTime":"2021-05-19T08:06:43.342666Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '478' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 May 2021 08:07:01 GMT + etag: + - '"02002f69-0000-3400-0000-60a4c7130000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff status: code: 200 message: OK @@ -1468,13 +1484,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:31:35 GMT + - Wed, 19 May 2021 08:07:04 GMT etag: - - '"01005a21-0000-3400-0000-60a416170000"' + - '"0100ec4d-0000-3400-0000-60a4c7280000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/5e064512-5619-4002-a393-1a00f124781f?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/145b1f0d-4895-4fe4-a619-be7063df4633?api-version=2020-10-01-preview pragma: - no-cache strict-transport-security: @@ -1484,7 +1500,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - - '14996' + - '14997' status: code: 202 message: Accepted @@ -1504,10 +1520,10 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/5e064512-5619-4002-a393-1a00f124781f?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/145b1f0d-4895-4fe4-a619-be7063df4633?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/5e064512-5619-4002-a393-1a00f124781f","name":"5e064512-5619-4002-a393-1a00f124781f","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Succeeded","startTime":"2021-05-18T19:31:35.7932289Z","endTime":"2021-05-18T19:31:48.1545555Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/145b1f0d-4895-4fe4-a619-be7063df4633","name":"145b1f0d-4895-4fe4-a619-be7063df4633","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Succeeded","startTime":"2021-05-19T08:07:04.6322359Z","endTime":"2021-05-19T08:07:26.3967968Z","properties":null}' headers: cache-control: - no-cache @@ -1516,9 +1532,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:32:06 GMT + - Wed, 19 May 2021 08:07:34 GMT etag: - - '"0200fe3d-0000-3400-0000-60a416240000"' + - '"02003969-0000-3400-0000-60a4c73e0000"' expires: - '-1' pragma: @@ -1566,13 +1582,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:32:08 GMT + - Wed, 19 May 2021 08:07:37 GMT etag: - - '"00008389-0000-3400-0000-60a416390000"' + - '"0000289e-0000-3400-0000-60a4c7490000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d643a3af-bdd7-47a2-9eae-9eeeca6cd267?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/e90f4a42-f214-475f-aa26-b52d5d28528e?api-version=2020-10-01-preview pragma: - no-cache strict-transport-security: @@ -1602,10 +1618,10 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d643a3af-bdd7-47a2-9eae-9eeeca6cd267?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/e90f4a42-f214-475f-aa26-b52d5d28528e?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d643a3af-bdd7-47a2-9eae-9eeeca6cd267","name":"d643a3af-bdd7-47a2-9eae-9eeeca6cd267","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","status":"Succeeded","startTime":"2021-05-18T19:32:09.0436292Z","endTime":"2021-05-18T19:32:09.9472992Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/e90f4a42-f214-475f-aa26-b52d5d28528e","name":"e90f4a42-f214-475f-aa26-b52d5d28528e","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","status":"Succeeded","startTime":"2021-05-19T08:07:37.6436665Z","endTime":"2021-05-19T08:07:38.3766812Z","properties":null}' headers: cache-control: - no-cache @@ -1614,9 +1630,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:32:39 GMT + - Wed, 19 May 2021 08:08:07 GMT etag: - - '"0200033e-0000-3400-0000-60a416390000"' + - '"02003c69-0000-3400-0000-60a4c74a0000"' expires: - '-1' pragma: @@ -1664,13 +1680,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:32:42 GMT + - Wed, 19 May 2021 08:08:10 GMT etag: - - '"02000606-0000-3400-0000-60a4165a0000"' + - '"0200e754-0000-3400-0000-60a4c76b0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/3b2982f6-04cc-40cf-94cf-42cff0c56693?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/940ea604-92a2-4220-a46d-15e9f80b9957?api-version=2020-10-01-preview pragma: - no-cache strict-transport-security: @@ -1700,10 +1716,10 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/3b2982f6-04cc-40cf-94cf-42cff0c56693?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/940ea604-92a2-4220-a46d-15e9f80b9957?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/3b2982f6-04cc-40cf-94cf-42cff0c56693","name":"3b2982f6-04cc-40cf-94cf-42cff0c56693","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","status":"Succeeded","startTime":"2021-05-18T19:32:42.5347627Z","endTime":"2021-05-18T19:32:43.1844139Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/940ea604-92a2-4220-a46d-15e9f80b9957","name":"940ea604-92a2-4220-a46d-15e9f80b9957","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","status":"Succeeded","startTime":"2021-05-19T08:08:11.1030317Z","endTime":"2021-05-19T08:08:12.0887242Z","properties":null}' headers: cache-control: - no-cache @@ -1712,9 +1728,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:33:13 GMT + - Wed, 19 May 2021 08:08:41 GMT etag: - - '"02002c3e-0000-3400-0000-60a4165b0000"' + - '"02004169-0000-3400-0000-60a4c76c0000"' expires: - '-1' pragma: @@ -1762,13 +1778,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:33:15 GMT + - Wed, 19 May 2021 08:08:44 GMT etag: - - '"00004a5e-0000-3400-0000-60a4167c0000"' + - '"00009169-0000-3400-0000-60a4c78c0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/a848ca77-6313-4c35-8c05-cb44dd21b3fd?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/55e046f6-0c30-403b-aa1b-bce4ebd2fe22?api-version=2020-10-01-preview pragma: - no-cache strict-transport-security: @@ -1778,7 +1794,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - - '14998' + - '14999' status: code: 202 message: Accepted @@ -1798,10 +1814,10 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/a848ca77-6313-4c35-8c05-cb44dd21b3fd?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/55e046f6-0c30-403b-aa1b-bce4ebd2fe22?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/a848ca77-6313-4c35-8c05-cb44dd21b3fd","name":"a848ca77-6313-4c35-8c05-cb44dd21b3fd","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","status":"Succeeded","startTime":"2021-05-18T19:33:16.3684672Z","endTime":"2021-05-18T19:33:17.3436288Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/55e046f6-0c30-403b-aa1b-bce4ebd2fe22","name":"55e046f6-0c30-403b-aa1b-bce4ebd2fe22","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","status":"Succeeded","startTime":"2021-05-19T08:08:44.1153987Z","endTime":"2021-05-19T08:08:45.6413068Z","properties":null}' headers: cache-control: - no-cache @@ -1810,9 +1826,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 18 May 2021 19:33:46 GMT + - Wed, 19 May 2021 08:09:14 GMT etag: - - '"02002f3e-0000-3400-0000-60a4167d0000"' + - '"02004669-0000-3400-0000-60a4c78d0000"' expires: - '-1' pragma: diff --git a/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py b/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py index be8dc227edb..8c39c488f18 100644 --- a/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py +++ b/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py @@ -93,12 +93,18 @@ def test_connectedvmware(self): self.check('name', '{vm_name}'), ]) - # List the vm resources in this resource group. + # List the VM resources in this resource group. resource_list = self.cmd('az connectedvmware vm list -g {rg}').get_output_in_json() # At this point there should be 1 vm resource. assert len(resource_list) >= 1 - # Delete the created vm. + # Stop VM. + self.cmd('az connectedvmware vm stop -g {rg} --name {vm_name}') + + # Start VM. + self.cmd('az connectedvmware vm start -g {rg} --name {vm_name}') + + # Delete the created VM. self.cmd('az connectedvmware vm delete -g {rg} --name {vm_name}') # Delete the created resource-pool. From 8be147d3fa29618d5949f57f6be2f2d9bd91cdd7 Mon Sep 17 00:00:00 2001 From: Santosh Mishra Date: Wed, 19 May 2021 18:16:48 +0530 Subject: [PATCH 11/13] Update README.md file and revert show command name. --- src/connectedvmware/README.md | 78 ++++- .../azext_connectedvmware/_help.py | 32 +- .../azext_connectedvmware/_params.py | 4 +- .../azext_connectedvmware/commands.py | 18 +- .../recordings/test_connectedvmware.yaml | 311 +++++++++--------- .../latest/test_connectedvmware_scenario.py | 12 +- 6 files changed, 258 insertions(+), 197 deletions(-) diff --git a/src/connectedvmware/README.md b/src/connectedvmware/README.md index a9e613aa3e1..be6d5b00bee 100644 --- a/src/connectedvmware/README.md +++ b/src/connectedvmware/README.md @@ -1,23 +1,87 @@ # Microsoft Azure CLI ConnectedVMware Extension # -The Azure CLI extension for [Azure Arc VMware Service](https://github.com/Azure/azure-arc-enabled-vmware-vsphere-preview/blob/main/docs/overview.md) is an extension for Azure CLI 2.0. +The Azure CLI extension for [Azure Arc for VMware PrivateCloud](https://github.com/Azure/azure-arc-enabled-vmware-vsphere-preview/blob/main/docs/overview.md) is an extension for Azure CLI 2.0. ## Install -``` sh +``` az extension add --name connectedvmware ``` ## Usage See the [extension reference documenation](https://github.com/Azure/azure-arc-enabled-vmware-vsphere-preview/blob/main/docs/overview.md). +*Examples:* + +##### Create Vcenter Resource + +``` +az connectedvmware vcenter connect \ + --subscription subscriptionId \ + --resource-group resourceGroupName \ + --location locationName \ + --custom-location customLocationName \ + --fqdn vcenterFqdn \ + --username userName \ + --password password \ + --name resourceName +``` + +##### Create Resource Pool Resource -``` sh -az connectedvmware --help -az connectedvmware vcenter list -g $resourcegroup -az connectedvmware vcenter connect -g $rg --location $location --custom-location $customLocation --fqdn $fqdn --username $username --password $pwd +``` +az connectedvmware resource-pool create \ + --subscription subscriptionId \ + --resource-group resourceGroupName \ + --location locationName \ + --custom-location customLocationName \ + --vcenter vcenterResourceName \ + --mo-ref-id morefId \ + --name resourceName +``` + +##### Create VM Template Resource + +``` +az connectedvmware vm-template create \ + --subscription subscriptionId \ + --resource-group resourceGroupName \ + --location locationName \ + --custom-location customLocationName \ + --vcenter vcenterResourceName \ + --mo-ref-id morefId \ + --name resourceName +``` + +##### Create Virtual Network Resource + +``` +az connectedvmware virtual-network create \ + --subscription subscriptionId \ + --resource-group resourceGroupName \ + --location locationName \ + --custom-location customLocationName \ + --vcenter vcenterResourceName \ + --mo-ref-id morefId \ + --name resourceName +``` + +##### Create Virtual Machine Resource + +``` +az connectedvmware vm create \ + --subscription subscriptionId \ + --resource-group resourceGroupName \ + --location locationName \ + --custom-location customLocationName \ + --vcenter vcenterResourceName \ + --resource-pool resourcePoolResourceName \ + --vm-template vmTemplateResourceName \ + --name resourceName ``` ## Uninstall You can see if the extension is installed by running `az --version` or `az extension list`. You can remove the extension by running: -``` sh +``` az extension remove --name connectedvmware ``` + +If you have issues, please give feedback by opening an issue at https://github.com/Azure/azure-cli-extensions/issues. diff --git a/src/connectedvmware/azext_connectedvmware/_help.py b/src/connectedvmware/azext_connectedvmware/_help.py index 14116636dd7..9daa9676d3e 100644 --- a/src/connectedvmware/azext_connectedvmware/_help.py +++ b/src/connectedvmware/azext_connectedvmware/_help.py @@ -59,14 +59,14 @@ """ helps[ - 'connectedvmware resource-pool show_command' + 'connectedvmware resource-pool show' ] = """ type: command short-summary: "Get details of a resource pool by id, resource-group, resource pool name, or subscription" examples: - name: Get details of a resource pool text: |- - az connectedvmware resource-pool show_command --ids "resource id" --name "resource pool name" \ + az connectedvmware resource-pool show --ids "resource id" --name "resource pool name" \ --resource-group "resource group name" --subscription "Name or ID of subscription" """ @@ -115,14 +115,14 @@ """ helps[ - 'connectedvmware vcenter show_command' + 'connectedvmware vcenter show' ] = """ type: command short-summary: "Get details of a vcenter resource by id, resource-group, vcenter name or subscription" examples: - name: Get details of a vcenter resource text: |- - az connectedvmware vcenter show_command --ids "resource id" --name "vcenter name" \ + az connectedvmware vcenter show --ids "resource id" --name "vcenter name" \ --resource-group "resource group name" --subscription "Name or ID of subscription" """ @@ -171,14 +171,14 @@ """ helps[ - 'connectedvmware virtual-network show_command' + 'connectedvmware virtual-network show' ] = """ type: command short-summary: "Get details of a virtual network by id, resource-group, reource pool name or subscription" examples: - name: Get details of a virtual-network text: |- - az connectedvmware virtual-network show_command --ids "resource id" --name "virtual network name" \ + az connectedvmware virtual-network show --ids "resource id" --name "virtual network name" \ --resource-group "resource group name" --subscription "Name or ID of subscription" """ @@ -238,14 +238,14 @@ """ helps[ - 'connectedvmware vm show_command' + 'connectedvmware vm show' ] = """ type: command short-summary: "Get details of a vm by id, resource-group, reource pool name or subscription" examples: - name: Get details of a vm resource text: |- - az connectedvmware vm show_command --ids "resource id" --name "vm template name" \ + az connectedvmware vm show --ids "resource id" --name "vm template name" \ --resource-group "resource group name" --subscription "Name or ID of subscription" """ @@ -331,14 +331,14 @@ """ helps[ - 'connectedvmware vm disk show_command' + 'connectedvmware vm disk show' ] = """ type: command short-summary: "Get details of a vm disk by it's name, resource-group and vm name" examples: - name: Get details of vm disk text: |- - az connectedvmware vm disk show_command --name "Name of the Disk" --resource-group \ + az connectedvmware vm disk show --name "Name of the Disk" --resource-group \ "resource group name" --vm-name "Name of the virtual machine" """ helps[ @@ -398,14 +398,14 @@ """ helps[ - 'connectedvmware vm nic show_command' + 'connectedvmware vm nic show' ] = """ type: command short-summary: "Get details of a vm nic by it's name, resource-group and vm name" examples: - name: Get details of vm nic text: |- - az connectedvmware vm nic show_command --name "Name of the NIC" --resource-group \ + az connectedvmware vm nic show --name "Name of the NIC" --resource-group \ "resource group name" --vm-name "Name of the virtual machine" """ @@ -454,14 +454,14 @@ """ helps[ - 'connectedvmware vm-template show_command' + 'connectedvmware vm-template show' ] = """ type: command short-summary: "Get details of a vm template by id, resource-group, reource pool name or subscription" examples: - name: Get details of a vm template text: |- - az connectedvmware vm-template show_command --ids "resource id" --name "vm template name" \ + az connectedvmware vm-template show --ids "resource id" --name "vm template name" \ --resource-group "resource group name" --subscription "Name or ID of subscription" """ @@ -485,13 +485,13 @@ """ helps[ - 'connectedvmware inventory-item show_command' + 'connectedvmware inventory-item show' ] = """ type: command short-summary: "Get details of a inventory item by inventory item name or id, resource-group and vcenter name." examples: - name: Get details of a vm template text: |- - az connectedvmware inventory-item show_command --inventory-item-name "inventory item name" \ + az connectedvmware inventory-item show --inventory-item-name "inventory item name" \ --resource-group "resource group name" --vcenter-name "name of the vcenter" """ diff --git a/src/connectedvmware/azext_connectedvmware/_params.py b/src/connectedvmware/azext_connectedvmware/_params.py index b28147d1b33..a8cb0ee11fb 100644 --- a/src/connectedvmware/azext_connectedvmware/_params.py +++ b/src/connectedvmware/azext_connectedvmware/_params.py @@ -321,7 +321,7 @@ def load_arguments(self, _): 'vm_name', options_list=['--vm-name'], help="Name of the virtual machine." ) - with self.argument_context('connectedvmware vm disk show_command') as c: + with self.argument_context('connectedvmware vm disk show') as c: c.argument('disk_name', options_list=['--name', '-n'], help="Name of the Disk.") c.argument( 'vm_name', options_list=['--vm-name'], help="Name of the virtual machine." @@ -365,7 +365,7 @@ def load_arguments(self, _): 'vcenter_name', options_list=['--vcenter-name'], help="Name of the vCenter." ) - with self.argument_context('connectedvmware inventory-item show_command') as c: + with self.argument_context('connectedvmware inventory-item show') as c: c.argument( 'inventory_item_name', options_list=['--inventory-item-name'], help="Name of the inventory item.", diff --git a/src/connectedvmware/azext_connectedvmware/commands.py b/src/connectedvmware/azext_connectedvmware/commands.py index c41777bbfcd..eb876e883f1 100644 --- a/src/connectedvmware/azext_connectedvmware/commands.py +++ b/src/connectedvmware/azext_connectedvmware/commands.py @@ -2,8 +2,8 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- - # pylint: disable=line-too-long + from ._client_factory import ( cf_vcenter, cf_resource_pool, @@ -19,7 +19,7 @@ def load_command_table(self, _): with self.command_group('connectedvmware vcenter', client_factory=cf_vcenter) as g: g.custom_command('connect', 'connect_vcenter', supports_no_wait=True) g.custom_command('delete', 'delete_vcenter', supports_no_wait=True) - g.custom_command('show_command', 'show_vcenter') + g.custom_show_command('show', 'show_vcenter') g.custom_command('list', 'list_vcenter') with self.command_group( @@ -27,7 +27,7 @@ def load_command_table(self, _): ) as g: g.custom_command('create', 'create_resource_pool', supports_no_wait=True) g.custom_command('delete', 'delete_resource_pool', supports_no_wait=True) - g.custom_command('show_command', 'show_resource_pool') + g.custom_show_command('show', 'show_resource_pool') g.custom_command('list', 'list_resource_pool') with self.command_group( @@ -35,7 +35,7 @@ def load_command_table(self, _): ) as g: g.custom_command('create', 'create_virtual_network', supports_no_wait=True) g.custom_command('delete', 'delete_virtual_network', supports_no_wait=True) - g.custom_command('show_command', 'show_virtual_network') + g.custom_show_command('show', 'show_virtual_network') g.custom_command('list', 'list_virtual_network') with self.command_group( @@ -43,7 +43,7 @@ def load_command_table(self, _): ) as g: g.custom_command('create', 'create_vm_template', supports_no_wait=True) g.custom_command('delete', 'delete_vm_template', supports_no_wait=True) - g.custom_command('show_command', 'show_vm_template') + g.custom_show_command('show', 'show_vm_template') g.custom_command('list', 'list_vm_template') with self.command_group( @@ -52,7 +52,7 @@ def load_command_table(self, _): g.custom_command('create', 'create_vm', supports_no_wait=True) g.custom_command('delete', 'delete_vm', supports_no_wait=True) g.custom_command('update', 'update_vm', supports_no_wait=True) - g.custom_command('show_command', 'show_vm') + g.custom_show_command('show', 'show_vm') g.custom_command('list', 'list_vm') g.custom_command('start', 'start_vm', supports_no_wait=True) g.custom_command('stop', 'stop_vm', supports_no_wait=True) @@ -64,7 +64,7 @@ def load_command_table(self, _): g.custom_command('add', 'add_nic', supports_no_wait=True) g.custom_command('update', 'update_nic', supports_no_wait=True) g.custom_command('delete', 'delete_nics', supports_no_wait=True) - g.custom_command('show_command', 'show_nic') + g.custom_show_command('show', 'show_nic') g.custom_command('list', 'list_nics') with self.command_group( @@ -73,13 +73,13 @@ def load_command_table(self, _): g.custom_command('add', 'add_disk', supports_no_wait=True) g.custom_command('update', 'update_disk', supports_no_wait=True) g.custom_command('delete', 'delete_disks', supports_no_wait=True) - g.custom_command('show_command', 'show_disk') + g.custom_show_command('show', 'show_disk') g.custom_command('list', 'list_disks') with self.command_group( 'connectedvmware inventory-item', client_factory=cf_inventory_item ) as g: - g.custom_command('show_command', 'show_inventory_item') + g.custom_show_command('show', 'show_inventory_item') g.custom_command('list', 'list_inventory_item') with self.command_group('connectedvmware', is_preview=False): diff --git a/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware.yaml b/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware.yaml index f5c2e988112..d7522a7b27a 100644 --- a/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware.yaml +++ b/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware.yaml @@ -7,7 +7,7 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - connectedvmware vcenter show_command + - connectedvmware vcenter show Connection: - keep-alive ParameterSetName: @@ -27,7 +27,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:02:12 GMT + - Wed, 19 May 2021 11:43:54 GMT etag: - '"03005e99-0000-3400-0000-60a255b90000"' expires: @@ -75,7 +75,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:02:14 GMT + - Wed, 19 May 2021 11:43:56 GMT expires: - '-1' pragma: @@ -119,22 +119,22 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T08:02:16.765789Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-19T08:02:16.765789Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Accepted"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:43:58.6415369Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-19T11:43:58.6415369Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Accepted"}}' headers: api-supported-versions: - 2019-12-20-privatepreview, 2020-10-01-preview azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/0a3d9ecd-ca1a-4290-b89c-3248e1e0e7a6?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/76d764e8-06fd-4243-9062-3aba283f26d5?api-version=2020-10-01-preview cache-control: - no-cache content-length: - - '970' + - '972' content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:02:19 GMT + - Wed, 19 May 2021 11:44:02 GMT etag: - - '"00000f9e-0000-3400-0000-60a4c60a0000"' + - '"0000eda0-0000-3400-0000-60a4fa020000"' expires: - '-1' location: @@ -148,7 +148,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1199' status: code: 201 message: Created @@ -168,21 +168,21 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/0a3d9ecd-ca1a-4290-b89c-3248e1e0e7a6?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/76d764e8-06fd-4243-9062-3aba283f26d5?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/0a3d9ecd-ca1a-4290-b89c-3248e1e0e7a6","name":"0a3d9ecd-ca1a-4290-b89c-3248e1e0e7a6","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","status":"Succeeded","startTime":"2021-05-19T08:02:18.591482Z","endTime":"2021-05-19T08:02:23.9870219Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/76d764e8-06fd-4243-9062-3aba283f26d5","name":"76d764e8-06fd-4243-9062-3aba283f26d5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","status":"Succeeded","startTime":"2021-05-19T11:44:01.7721804Z","endTime":"2021-05-19T11:44:08.4332259Z","properties":null}' headers: cache-control: - no-cache content-length: - - '475' + - '476' content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:02:49 GMT + - Wed, 19 May 2021 11:44:32 GMT etag: - - '"0200fd68-0000-3400-0000-60a4c60f0000"' + - '"0200b470-0000-3400-0000-60a4fa080000"' expires: - '-1' pragma: @@ -217,18 +217,18 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T08:02:16.765789Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T08:02:23.7243045Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Succeeded","customResourceName":"37931da9-67a0-412e-baac-04f81232a5ba","uuid":"37931da9-67a0-412e-baac-04f81232a5ba","moName":"SanmishraResourcePool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:43:58.6415369Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T11:44:08.0424233Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Succeeded","customResourceName":"58b376ab-76ac-480f-9b6f-629b7b339c18","uuid":"58b376ab-76ac-480f-9b6f-629b7b339c18","moName":"SanmishraResourcePool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}' headers: cache-control: - no-cache content-length: - - '1216' + - '1217' content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:02:49 GMT + - Wed, 19 May 2021 11:44:33 GMT etag: - - '"0000159e-0000-3400-0000-60a4c6100000"' + - '"0000f3a0-0000-3400-0000-60a4fa080000"' expires: - '-1' pragma: @@ -254,7 +254,7 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - connectedvmware resource-pool show_command + - connectedvmware resource-pool show Connection: - keep-alive ParameterSetName: @@ -265,18 +265,18 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T08:02:16.765789Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T08:02:23.7243045Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Succeeded","customResourceName":"37931da9-67a0-412e-baac-04f81232a5ba","uuid":"37931da9-67a0-412e-baac-04f81232a5ba","moName":"SanmishraResourcePool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:43:58.6415369Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T11:44:08.0424233Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Succeeded","customResourceName":"58b376ab-76ac-480f-9b6f-629b7b339c18","uuid":"58b376ab-76ac-480f-9b6f-629b7b339c18","moName":"SanmishraResourcePool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}' headers: cache-control: - no-cache content-length: - - '1216' + - '1217' content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:02:56 GMT + - Wed, 19 May 2021 11:44:35 GMT etag: - - '"0000159e-0000-3400-0000-60a4c6100000"' + - '"0000f3a0-0000-3400-0000-60a4fa080000"' expires: - '-1' pragma: @@ -313,16 +313,16 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools?api-version=2020-10-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T08:02:16.765789Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T08:02:23.7243045Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Succeeded","customResourceName":"37931da9-67a0-412e-baac-04f81232a5ba","uuid":"37931da9-67a0-412e-baac-04f81232a5ba","moName":"SanmishraResourcePool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}]}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:43:58.6415369Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T11:44:08.0424233Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Succeeded","customResourceName":"58b376ab-76ac-480f-9b6f-629b7b339c18","uuid":"58b376ab-76ac-480f-9b6f-629b7b339c18","moName":"SanmishraResourcePool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}]}' headers: cache-control: - no-cache content-length: - - '1228' + - '1229' content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:02:57 GMT + - Wed, 19 May 2021 11:44:36 GMT expires: - '-1' pragma: @@ -366,12 +366,12 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T08:03:00.8033039Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-19T08:03:00.8033039Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Accepted"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:44:38.7913062Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-19T11:44:38.7913062Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Accepted"}}' headers: api-supported-versions: - 2019-12-20-privatepreview, 2020-10-01-preview azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/ac55316a-f3d4-40da-b7b0-4d411d5be6de?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/3c860159-fd93-4a03-bb30-85bb419f52f9?api-version=2020-10-01-preview cache-control: - no-cache content-length: @@ -379,9 +379,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:03:02 GMT + - Wed, 19 May 2021 11:44:42 GMT etag: - - '"02008754-0000-3400-0000-60a4c6360000"' + - '"0200376f-0000-3400-0000-60a4fa2a0000"' expires: - '-1' location: @@ -415,21 +415,21 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/ac55316a-f3d4-40da-b7b0-4d411d5be6de?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/3c860159-fd93-4a03-bb30-85bb419f52f9?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/ac55316a-f3d4-40da-b7b0-4d411d5be6de","name":"ac55316a-f3d4-40da-b7b0-4d411d5be6de","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","status":"Succeeded","startTime":"2021-05-19T08:03:01.8890214Z","endTime":"2021-05-19T08:03:06.5763703Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/3c860159-fd93-4a03-bb30-85bb419f52f9","name":"3c860159-fd93-4a03-bb30-85bb419f52f9","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","status":"Succeeded","startTime":"2021-05-19T11:44:41.812391Z","endTime":"2021-05-19T11:44:46.3395966Z","properties":null}' headers: cache-control: - no-cache content-length: - - '480' + - '479' content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:03:32 GMT + - Wed, 19 May 2021 11:45:12 GMT etag: - - '"02001d69-0000-3400-0000-60a4c63a0000"' + - '"0200b770-0000-3400-0000-60a4fa2e0000"' expires: - '-1' pragma: @@ -464,18 +464,18 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T08:03:00.8033039Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T08:03:06.332101Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Succeeded","customResourceName":"c104cd42-5728-480b-87b3-6dd4624c133d","uuid":"c104cd42-5728-480b-87b3-6dd4624c133d","moName":"segment-2"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:44:38.7913062Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T11:44:46.1212673Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Succeeded","customResourceName":"6f79b65a-f4a1-4726-935c-6060f3a2ae52","uuid":"6f79b65a-f4a1-4726-935c-6060f3a2ae52","moName":"segment-2"}}' headers: cache-control: - no-cache content-length: - - '1126' + - '1127' content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:03:33 GMT + - Wed, 19 May 2021 11:45:13 GMT etag: - - '"0200b554-0000-3400-0000-60a4c63a0000"' + - '"02003d6f-0000-3400-0000-60a4fa2e0000"' expires: - '-1' pragma: @@ -501,7 +501,7 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - connectedvmware virtual-network show_command + - connectedvmware virtual-network show Connection: - keep-alive ParameterSetName: @@ -512,18 +512,18 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T08:03:00.8033039Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T08:03:06.332101Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Succeeded","customResourceName":"c104cd42-5728-480b-87b3-6dd4624c133d","uuid":"c104cd42-5728-480b-87b3-6dd4624c133d","moName":"segment-2"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:44:38.7913062Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T11:44:46.1212673Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Succeeded","customResourceName":"6f79b65a-f4a1-4726-935c-6060f3a2ae52","uuid":"6f79b65a-f4a1-4726-935c-6060f3a2ae52","moName":"segment-2"}}' headers: cache-control: - no-cache content-length: - - '1126' + - '1127' content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:03:34 GMT + - Wed, 19 May 2021 11:45:15 GMT etag: - - '"0200b554-0000-3400-0000-60a4c63a0000"' + - '"02003d6f-0000-3400-0000-60a4fa2e0000"' expires: - '-1' pragma: @@ -560,16 +560,16 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks?api-version=2020-10-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T08:03:00.8033039Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T08:03:06.332101Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Succeeded","customResourceName":"c104cd42-5728-480b-87b3-6dd4624c133d","uuid":"c104cd42-5728-480b-87b3-6dd4624c133d","moName":"segment-2"}}]}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:44:38.7913062Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T11:44:46.1212673Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Succeeded","customResourceName":"6f79b65a-f4a1-4726-935c-6060f3a2ae52","uuid":"6f79b65a-f4a1-4726-935c-6060f3a2ae52","moName":"segment-2"}}]}' headers: cache-control: - no-cache content-length: - - '1138' + - '1139' content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:03:36 GMT + - Wed, 19 May 2021 11:45:15 GMT expires: - '-1' pragma: @@ -613,25 +613,22 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T07:32:47.7931701Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T07:32:55.3327703Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","networkInterfaces":[{"name":"nic_1","label":"Network - adapter 1","macAddress":"00:50:56:93:fb:46","networkId":null,"networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}],"disks":[{"diskObjectId":"403-2000","name":"disk_1","label":"Hard - disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"customResourceName":"815156a3-2df3-4655-9cab-5c43eeb9804c","moRefId":"vm-55","moName":"azurevmwarecloudtestubuntu20.04","memorySizeMB":2048,"numCPUs":1,"numCoresPerSocket":1,"osName":"Ubuntu - Linux (64-bit)","folderPath":"SDDC-Datacenter/Templates","uuid":"815156a3-2df3-4655-9cab-5c43eeb9804c","provisioningState":"Accepted"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:45:18.1893368Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-19T11:45:18.1893368Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"vm-55","provisioningState":"Accepted"}}' headers: api-supported-versions: - 2019-12-20-privatepreview, 2020-10-01-preview azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/20e81ce8-9326-4af6-b560-91faa6c3516e?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/2688d4af-392d-41c3-8cdf-344cbab725c3?api-version=2020-10-01-preview cache-control: - no-cache content-length: - - '1725' + - '980' content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:03:39 GMT + - Wed, 19 May 2021 11:45:20 GMT etag: - - '"00007b69-0000-3400-0000-60a4c65c0000"' + - '"00003c6a-0000-3400-0000-60a4fa4f0000"' expires: - '-1' location: @@ -665,21 +662,21 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/20e81ce8-9326-4af6-b560-91faa6c3516e?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/2688d4af-392d-41c3-8cdf-344cbab725c3?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/20e81ce8-9326-4af6-b560-91faa6c3516e","name":"20e81ce8-9326-4af6-b560-91faa6c3516e","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","status":"Succeeded","startTime":"2021-05-19T08:03:40.3557665Z","endTime":"2021-05-19T08:03:43.7933698Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/2688d4af-392d-41c3-8cdf-344cbab725c3","name":"2688d4af-392d-41c3-8cdf-344cbab725c3","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","status":"Succeeded","startTime":"2021-05-19T11:45:19.374918Z","endTime":"2021-05-19T11:45:22.6949187Z","properties":null}' headers: cache-control: - no-cache content-length: - - '484' + - '483' content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:04:11 GMT + - Wed, 19 May 2021 11:45:50 GMT etag: - - '"02002369-0000-3400-0000-60a4c65f0000"' + - '"0200d070-0000-3400-0000-60a4fa520000"' expires: - '-1' pragma: @@ -714,10 +711,10 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T07:32:47.7931701Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T08:03:43.5788892Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","networkInterfaces":[{"name":"nic_1","label":"Network + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:45:18.1893368Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T11:45:22.4417906Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"vm-55","provisioningState":"Succeeded","customResourceName":"6bef5a0e-64c9-40ca-8abb-db0c442322c0","uuid":"6bef5a0e-64c9-40ca-8abb-db0c442322c0","networkInterfaces":[{"name":"nic_1","label":"Network adapter 1","macAddress":"00:50:56:93:2b:71","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}],"disks":[{"diskObjectId":"1816-2000","name":"disk_1","label":"Hard - disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"customResourceName":"815156a3-2df3-4655-9cab-5c43eeb9804c","moRefId":"vm-55","moName":"azurevmwarecloudtestubuntu","memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"osName":"Ubuntu - Linux (64-bit)","folderPath":"SDDC-Datacenter/Templates","uuid":"815156a3-2df3-4655-9cab-5c43eeb9804c","provisioningState":"Succeeded","osType":"Linux"}}' + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"moName":"azurevmwarecloudtestubuntu","memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"osType":"Linux","osName":"Ubuntu + Linux (64-bit)","folderPath":"SDDC-Datacenter/Templates"}}' headers: cache-control: - no-cache @@ -726,9 +723,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:04:11 GMT + - Wed, 19 May 2021 11:45:50 GMT etag: - - '"00008069-0000-3400-0000-60a4c65f0000"' + - '"0000426a-0000-3400-0000-60a4fa520000"' expires: - '-1' pragma: @@ -754,7 +751,7 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - connectedvmware vm-template show_command + - connectedvmware vm-template show Connection: - keep-alive ParameterSetName: @@ -765,10 +762,10 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T07:32:47.7931701Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T08:03:43.5788892Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","networkInterfaces":[{"name":"nic_1","label":"Network + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:45:18.1893368Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T11:45:22.4417906Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"vm-55","provisioningState":"Succeeded","customResourceName":"6bef5a0e-64c9-40ca-8abb-db0c442322c0","uuid":"6bef5a0e-64c9-40ca-8abb-db0c442322c0","networkInterfaces":[{"name":"nic_1","label":"Network adapter 1","macAddress":"00:50:56:93:2b:71","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}],"disks":[{"diskObjectId":"1816-2000","name":"disk_1","label":"Hard - disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"customResourceName":"815156a3-2df3-4655-9cab-5c43eeb9804c","moRefId":"vm-55","moName":"azurevmwarecloudtestubuntu","memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"osName":"Ubuntu - Linux (64-bit)","folderPath":"SDDC-Datacenter/Templates","uuid":"815156a3-2df3-4655-9cab-5c43eeb9804c","provisioningState":"Succeeded","osType":"Linux"}}' + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"moName":"azurevmwarecloudtestubuntu","memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"osType":"Linux","osName":"Ubuntu + Linux (64-bit)","folderPath":"SDDC-Datacenter/Templates"}}' headers: cache-control: - no-cache @@ -777,9 +774,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:04:12 GMT + - Wed, 19 May 2021 11:45:51 GMT etag: - - '"00008069-0000-3400-0000-60a4c65f0000"' + - '"0000426a-0000-3400-0000-60a4fa520000"' expires: - '-1' pragma: @@ -816,10 +813,10 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates?api-version=2020-10-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T07:32:47.7931701Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T08:03:43.5788892Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","networkInterfaces":[{"name":"nic_1","label":"Network + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:45:18.1893368Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T11:45:22.4417906Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"vm-55","provisioningState":"Succeeded","customResourceName":"6bef5a0e-64c9-40ca-8abb-db0c442322c0","uuid":"6bef5a0e-64c9-40ca-8abb-db0c442322c0","networkInterfaces":[{"name":"nic_1","label":"Network adapter 1","macAddress":"00:50:56:93:2b:71","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}],"disks":[{"diskObjectId":"1816-2000","name":"disk_1","label":"Hard - disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"customResourceName":"815156a3-2df3-4655-9cab-5c43eeb9804c","moRefId":"vm-55","moName":"azurevmwarecloudtestubuntu","memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"osName":"Ubuntu - Linux (64-bit)","folderPath":"SDDC-Datacenter/Templates","uuid":"815156a3-2df3-4655-9cab-5c43eeb9804c","provisioningState":"Succeeded","osType":"Linux"}}]}' + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"moName":"azurevmwarecloudtestubuntu","memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"osType":"Linux","osName":"Ubuntu + Linux (64-bit)","folderPath":"SDDC-Datacenter/Templates"}}]}' headers: cache-control: - no-cache @@ -828,7 +825,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:04:13 GMT + - Wed, 19 May 2021 11:45:53 GMT expires: - '-1' pragma: @@ -854,7 +851,7 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - connectedvmware inventory-item show_command + - connectedvmware inventory-item show Connection: - keep-alive ParameterSetName: @@ -865,18 +862,18 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/vcenters/azcli-test-vcenter-avs/inventoryItems/resgroup-5034?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/azcli-test-vcenter-avs/InventoryItems/resgroup-5034","name":"resgroup-5034","type":"microsoft.connectedvmwarevsphere/vcenters/inventoryitems","systemData":{"createdBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","createdByType":"Application","createdAt":"2021-05-17T11:38:31.7591468Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T07:30:22.0003802Z"},"properties":{"inventoryType":"ResourcePool","managedResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/ResourcePools/azcli-test-resource-pool","moRefId":"resgroup-5034","provisioningState":"Succeeded","parent":{"moName":"Resources","inventoryItemId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/azcli-test-vcenter-avs/InventoryItems/resgroup-8"},"moName":"SanmishraResourcePool"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/azcli-test-vcenter-avs/InventoryItems/resgroup-5034","name":"resgroup-5034","type":"microsoft.connectedvmwarevsphere/vcenters/inventoryitems","systemData":{"createdBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","createdByType":"Application","createdAt":"2021-05-17T11:38:31.7591468Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T08:09:34.4142677Z"},"properties":{"inventoryType":"ResourcePool","managedResourceId":"","moRefId":"resgroup-5034","provisioningState":"Succeeded","parent":{"moName":"Resources","inventoryItemId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/azcli-test-vcenter-avs/InventoryItems/resgroup-8"},"moName":"SanmishraResourcePool"}}' headers: cache-control: - no-cache content-length: - - '1116' + - '954' content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:04:15 GMT + - Wed, 19 May 2021 11:46:04 GMT etag: - - '"51006bb6-0000-3400-0000-60a4be8e0000"' + - '"5200d139-0000-3400-0000-60a4c7be0000"' expires: - '-1' pragma: @@ -921,12 +918,12 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T08:04:18.1437613Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-19T08:04:18.1437613Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Accepted"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:46:07.1277397Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-19T11:46:07.1277397Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Accepted"}}' headers: api-supported-versions: - 2019-12-20-privatepreview, 2020-10-01-preview azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/c34c048d-5b7a-4a8a-bfc1-ad8e75fd36ca?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d4b7f8b2-2a68-40f2-8d7a-0fe65c1393f5?api-version=2020-10-01-preview cache-control: - no-cache content-length: @@ -934,9 +931,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:04:19 GMT + - Wed, 19 May 2021 11:46:08 GMT etag: - - '"01009e4d-0000-3400-0000-60a4c6830000"' + - '"0100a45b-0000-3400-0000-60a4fa810000"' expires: - '-1' location: @@ -970,10 +967,10 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/c34c048d-5b7a-4a8a-bfc1-ad8e75fd36ca?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d4b7f8b2-2a68-40f2-8d7a-0fe65c1393f5?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/c34c048d-5b7a-4a8a-bfc1-ad8e75fd36ca","name":"c34c048d-5b7a-4a8a-bfc1-ad8e75fd36ca","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Accepted","startTime":"2021-05-19T08:04:19.3809311Z"}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d4b7f8b2-2a68-40f2-8d7a-0fe65c1393f5","name":"d4b7f8b2-2a68-40f2-8d7a-0fe65c1393f5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Accepted","startTime":"2021-05-19T11:46:08.8331842Z"}' headers: cache-control: - no-cache @@ -982,9 +979,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:04:49 GMT + - Wed, 19 May 2021 11:46:39 GMT etag: - - '"02002469-0000-3400-0000-60a4c6830000"' + - '"0200d270-0000-3400-0000-60a4fa800000"' expires: - '-1' pragma: @@ -1016,10 +1013,10 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/c34c048d-5b7a-4a8a-bfc1-ad8e75fd36ca?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d4b7f8b2-2a68-40f2-8d7a-0fe65c1393f5?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/c34c048d-5b7a-4a8a-bfc1-ad8e75fd36ca","name":"c34c048d-5b7a-4a8a-bfc1-ad8e75fd36ca","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Accepted","startTime":"2021-05-19T08:04:19.3809311Z"}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d4b7f8b2-2a68-40f2-8d7a-0fe65c1393f5","name":"d4b7f8b2-2a68-40f2-8d7a-0fe65c1393f5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Accepted","startTime":"2021-05-19T11:46:08.8331842Z"}' headers: cache-control: - no-cache @@ -1028,9 +1025,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:05:20 GMT + - Wed, 19 May 2021 11:47:10 GMT etag: - - '"02002469-0000-3400-0000-60a4c6830000"' + - '"0200d270-0000-3400-0000-60a4fa800000"' expires: - '-1' pragma: @@ -1062,10 +1059,10 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/c34c048d-5b7a-4a8a-bfc1-ad8e75fd36ca?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d4b7f8b2-2a68-40f2-8d7a-0fe65c1393f5?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/c34c048d-5b7a-4a8a-bfc1-ad8e75fd36ca","name":"c34c048d-5b7a-4a8a-bfc1-ad8e75fd36ca","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Succeeded","startTime":"2021-05-19T08:04:19.3809311Z","endTime":"2021-05-19T08:05:40.9702005Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d4b7f8b2-2a68-40f2-8d7a-0fe65c1393f5","name":"d4b7f8b2-2a68-40f2-8d7a-0fe65c1393f5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Succeeded","startTime":"2021-05-19T11:46:08.8331842Z","endTime":"2021-05-19T11:47:30.1606374Z","properties":null}' headers: cache-control: - no-cache @@ -1074,9 +1071,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:05:50 GMT + - Wed, 19 May 2021 11:47:40 GMT etag: - - '"02002769-0000-3400-0000-60a4c6d40000"' + - '"0200e170-0000-3400-0000-60a4fad20000"' expires: - '-1' pragma: @@ -1111,21 +1108,21 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T08:04:18.1437613Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T08:05:40.7415117Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Succeeded","customResourceName":"7c45803e-848b-47c7-9cd8-5f2cdf90aeb3","uuid":"7c45803e-848b-47c7-9cd8-5f2cdf90aeb3","vmId":"7c45803e-848b-47c7-9cd8-5f2cdf90aeb3","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network - adapter 1","macAddress":"00:50:56:93:43:f8","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}]},"storageProfile":{"disks":[{"diskObjectId":"12573-2000","name":"disk_1","label":"Hard + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:46:07.1277397Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T11:47:29.9091297Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Succeeded","customResourceName":"142f1eba-cbdf-46e5-9cf9-6608cc4cca91","uuid":"142f1eba-cbdf-46e5-9cf9-6608cc4cca91","vmId":"142f1eba-cbdf-46e5-9cf9-6608cc4cca91","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network + adapter 1","macAddress":"00:50:56:93:6d:5c","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}]},"storageProfile":{"disks":[{"diskObjectId":"12754-2000","name":"disk_1","label":"Hard disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"","osType":"Linux","osName":"Ubuntu - Linux (64-bit)","toolsRunningStatus":"guestToolsRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"7c45803e-848b-47c7-9cd8-5f2cdf90aeb3","moRefId":"vm-25277","moName":"azcli-test-virtual-machine","folderPath":"SDDC-Datacenter","powerState":"poweredOn"}}' + Linux (64-bit)","toolsRunningStatus":"guestToolsNotRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"142f1eba-cbdf-46e5-9cf9-6608cc4cca91","moRefId":"vm-25394","moName":"azcli-test-virtual-machine","folderPath":"SDDC-Datacenter","powerState":"poweredOn"}}' headers: cache-control: - no-cache content-length: - - '2599' + - '2602' content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:05:51 GMT + - Wed, 19 May 2021 11:47:41 GMT etag: - - '"0100de4d-0000-3400-0000-60a4c6d40000"' + - '"0100b15b-0000-3400-0000-60a4fad20000"' expires: - '-1' pragma: @@ -1151,7 +1148,7 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - connectedvmware vm show_command + - connectedvmware vm show Connection: - keep-alive ParameterSetName: @@ -1162,21 +1159,21 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T08:04:18.1437613Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T08:05:40.7415117Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Succeeded","customResourceName":"7c45803e-848b-47c7-9cd8-5f2cdf90aeb3","uuid":"7c45803e-848b-47c7-9cd8-5f2cdf90aeb3","vmId":"7c45803e-848b-47c7-9cd8-5f2cdf90aeb3","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network - adapter 1","macAddress":"00:50:56:93:43:f8","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}]},"storageProfile":{"disks":[{"diskObjectId":"12573-2000","name":"disk_1","label":"Hard + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:46:07.1277397Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T11:47:29.9091297Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Succeeded","customResourceName":"142f1eba-cbdf-46e5-9cf9-6608cc4cca91","uuid":"142f1eba-cbdf-46e5-9cf9-6608cc4cca91","vmId":"142f1eba-cbdf-46e5-9cf9-6608cc4cca91","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network + adapter 1","macAddress":"00:50:56:93:6d:5c","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}]},"storageProfile":{"disks":[{"diskObjectId":"12754-2000","name":"disk_1","label":"Hard disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"","osType":"Linux","osName":"Ubuntu - Linux (64-bit)","toolsRunningStatus":"guestToolsRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"7c45803e-848b-47c7-9cd8-5f2cdf90aeb3","moRefId":"vm-25277","moName":"azcli-test-virtual-machine","folderPath":"SDDC-Datacenter","powerState":"poweredOn"}}' + Linux (64-bit)","toolsRunningStatus":"guestToolsNotRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"142f1eba-cbdf-46e5-9cf9-6608cc4cca91","moRefId":"vm-25394","moName":"azcli-test-virtual-machine","folderPath":"SDDC-Datacenter","powerState":"poweredOn"}}' headers: cache-control: - no-cache content-length: - - '2599' + - '2602' content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:05:53 GMT + - Wed, 19 May 2021 11:47:42 GMT etag: - - '"0100de4d-0000-3400-0000-60a4c6d40000"' + - '"0100b15b-0000-3400-0000-60a4fad20000"' expires: - '-1' pragma: @@ -1228,19 +1225,19 @@ interactions: Linux (64-bit)","toolsRunningStatus":"guestToolsNotRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"b84184fc-8e13-4147-a58c-99ac11a82e03","moRefId":"vm-24993","moName":"azcli-test-vm6","folderPath":"SDDC-Datacenter","powerState":"poweredOff"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/stop-vm-test","name":"stop-vm-test","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T07:36:13.9786742Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T07:37:42.6131581Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Failed","customResourceName":"f4e0270f-9f91-4150-b6e9-bb6ac0d3783d","uuid":"f4e0270f-9f91-4150-b6e9-bb6ac0d3783d","vmId":"f4e0270f-9f91-4150-b6e9-bb6ac0d3783d","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network adapter 1","macAddress":"00:50:56:93:56:85","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}]},"storageProfile":{"disks":[{"diskObjectId":"12201-2000","name":"disk_1","label":"Hard disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"","osType":"Linux","osName":"Ubuntu - Linux (64-bit)","toolsRunningStatus":"guestToolsNotRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11301"},"hardwareProfile":{"memorySizeMB":2048,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"f4e0270f-9f91-4150-b6e9-bb6ac0d3783d","moRefId":"vm-25216","moName":"stop-vm-test","folderPath":"SDDC-Datacenter","powerState":"poweredOff"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T08:04:18.1437613Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T08:05:40.7415117Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Succeeded","customResourceName":"7c45803e-848b-47c7-9cd8-5f2cdf90aeb3","uuid":"7c45803e-848b-47c7-9cd8-5f2cdf90aeb3","vmId":"7c45803e-848b-47c7-9cd8-5f2cdf90aeb3","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network - adapter 1","macAddress":"00:50:56:93:43:f8","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}]},"storageProfile":{"disks":[{"diskObjectId":"12573-2000","name":"disk_1","label":"Hard + Linux (64-bit)","toolsRunningStatus":"guestToolsNotRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11301"},"hardwareProfile":{"memorySizeMB":2048,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"f4e0270f-9f91-4150-b6e9-bb6ac0d3783d","moRefId":"vm-25216","moName":"stop-vm-test","folderPath":"SDDC-Datacenter","powerState":"poweredOff"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:46:07.1277397Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T11:47:29.9091297Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Succeeded","customResourceName":"142f1eba-cbdf-46e5-9cf9-6608cc4cca91","uuid":"142f1eba-cbdf-46e5-9cf9-6608cc4cca91","vmId":"142f1eba-cbdf-46e5-9cf9-6608cc4cca91","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network + adapter 1","macAddress":"00:50:56:93:6d:5c","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}]},"storageProfile":{"disks":[{"diskObjectId":"12754-2000","name":"disk_1","label":"Hard disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"","osType":"Linux","osName":"Ubuntu - Linux (64-bit)","toolsRunningStatus":"guestToolsRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"7c45803e-848b-47c7-9cd8-5f2cdf90aeb3","moRefId":"vm-25277","moName":"azcli-test-virtual-machine","folderPath":"SDDC-Datacenter","powerState":"poweredOn"}}]}' + Linux (64-bit)","toolsRunningStatus":"guestToolsNotRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"142f1eba-cbdf-46e5-9cf9-6608cc4cca91","moRefId":"vm-25394","moName":"azcli-test-virtual-machine","folderPath":"SDDC-Datacenter","powerState":"poweredOn"}}]}' headers: cache-control: - no-cache content-length: - - '15448' + - '15451' content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:05:56 GMT + - Wed, 19 May 2021 11:47:43 GMT expires: - '-1' pragma: @@ -1292,11 +1289,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:05:57 GMT + - Wed, 19 May 2021 11:47:45 GMT expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/279a9d20-16b3-41a7-8dec-9c4b436f403d?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/4d8bed26-707d-48df-9279-b4443161eef4?api-version=2020-10-01-preview pragma: - no-cache strict-transport-security: @@ -1306,7 +1303,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 202 message: Accepted @@ -1326,10 +1323,10 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/279a9d20-16b3-41a7-8dec-9c4b436f403d?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/4d8bed26-707d-48df-9279-b4443161eef4?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/279a9d20-16b3-41a7-8dec-9c4b436f403d","name":"279a9d20-16b3-41a7-8dec-9c4b436f403d","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Succeeded","startTime":"2021-05-19T08:05:58.3132487Z","endTime":"2021-05-19T08:06:12.8498955Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/4d8bed26-707d-48df-9279-b4443161eef4","name":"4d8bed26-707d-48df-9279-b4443161eef4","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Succeeded","startTime":"2021-05-19T11:47:45.5277418Z","endTime":"2021-05-19T11:48:02.1689421Z","properties":null}' headers: cache-control: - no-cache @@ -1338,9 +1335,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:06:29 GMT + - Wed, 19 May 2021 11:48:15 GMT etag: - - '"02002b69-0000-3400-0000-60a4c6f40000"' + - '"0200e570-0000-3400-0000-60a4faf20000"' expires: - '-1' pragma: @@ -1388,11 +1385,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:06:31 GMT + - Wed, 19 May 2021 11:48:18 GMT expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/530ba403-be76-498e-83c5-078a43fedacd?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/9d384c4a-f5ef-4a4e-b5da-a4ed2e8c9e2e?api-version=2020-10-01-preview pragma: - no-cache strict-transport-security: @@ -1422,10 +1419,10 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/530ba403-be76-498e-83c5-078a43fedacd?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/9d384c4a-f5ef-4a4e-b5da-a4ed2e8c9e2e?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/530ba403-be76-498e-83c5-078a43fedacd","name":"530ba403-be76-498e-83c5-078a43fedacd","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Succeeded","startTime":"2021-05-19T08:06:31.174244Z","endTime":"2021-05-19T08:06:43.342666Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/9d384c4a-f5ef-4a4e-b5da-a4ed2e8c9e2e","name":"9d384c4a-f5ef-4a4e-b5da-a4ed2e8c9e2e","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Succeeded","startTime":"2021-05-19T11:48:18.64059Z","endTime":"2021-05-19T11:48:31.2379668Z","properties":null}' headers: cache-control: - no-cache @@ -1434,9 +1431,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:07:01 GMT + - Wed, 19 May 2021 11:48:49 GMT etag: - - '"02002f69-0000-3400-0000-60a4c7130000"' + - '"0200e970-0000-3400-0000-60a4fb0f0000"' expires: - '-1' pragma: @@ -1484,13 +1481,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:07:04 GMT + - Wed, 19 May 2021 11:48:51 GMT etag: - - '"0100ec4d-0000-3400-0000-60a4c7280000"' + - '"0100be5b-0000-3400-0000-60a4fb230000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/145b1f0d-4895-4fe4-a619-be7063df4633?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/94f4991a-7013-456c-8ba0-38071cf2bbb6?api-version=2020-10-01-preview pragma: - no-cache strict-transport-security: @@ -1500,7 +1497,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - - '14997' + - '14999' status: code: 202 message: Accepted @@ -1520,21 +1517,21 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/145b1f0d-4895-4fe4-a619-be7063df4633?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/94f4991a-7013-456c-8ba0-38071cf2bbb6?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/145b1f0d-4895-4fe4-a619-be7063df4633","name":"145b1f0d-4895-4fe4-a619-be7063df4633","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Succeeded","startTime":"2021-05-19T08:07:04.6322359Z","endTime":"2021-05-19T08:07:26.3967968Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/94f4991a-7013-456c-8ba0-38071cf2bbb6","name":"94f4991a-7013-456c-8ba0-38071cf2bbb6","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Succeeded","startTime":"2021-05-19T11:48:51.4608474Z","endTime":"2021-05-19T11:49:02.72904Z","properties":null}' headers: cache-control: - no-cache content-length: - - '480' + - '478' content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:07:34 GMT + - Wed, 19 May 2021 11:49:22 GMT etag: - - '"02003969-0000-3400-0000-60a4c73e0000"' + - '"0200ee70-0000-3400-0000-60a4fb2e0000"' expires: - '-1' pragma: @@ -1582,13 +1579,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:07:37 GMT + - Wed, 19 May 2021 11:49:24 GMT etag: - - '"0000289e-0000-3400-0000-60a4c7490000"' + - '"0000ffa0-0000-3400-0000-60a4fb450000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/e90f4a42-f214-475f-aa26-b52d5d28528e?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/4f036c7b-c3a7-49ac-852b-6d31f22c65c4?api-version=2020-10-01-preview pragma: - no-cache strict-transport-security: @@ -1618,10 +1615,10 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/e90f4a42-f214-475f-aa26-b52d5d28528e?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/4f036c7b-c3a7-49ac-852b-6d31f22c65c4?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/e90f4a42-f214-475f-aa26-b52d5d28528e","name":"e90f4a42-f214-475f-aa26-b52d5d28528e","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","status":"Succeeded","startTime":"2021-05-19T08:07:37.6436665Z","endTime":"2021-05-19T08:07:38.3766812Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/4f036c7b-c3a7-49ac-852b-6d31f22c65c4","name":"4f036c7b-c3a7-49ac-852b-6d31f22c65c4","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","status":"Succeeded","startTime":"2021-05-19T11:49:25.3483896Z","endTime":"2021-05-19T11:49:26.3619763Z","properties":null}' headers: cache-control: - no-cache @@ -1630,9 +1627,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:08:07 GMT + - Wed, 19 May 2021 11:49:55 GMT etag: - - '"02003c69-0000-3400-0000-60a4c74a0000"' + - '"0200f070-0000-3400-0000-60a4fb460000"' expires: - '-1' pragma: @@ -1680,13 +1677,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:08:10 GMT + - Wed, 19 May 2021 11:49:57 GMT etag: - - '"0200e754-0000-3400-0000-60a4c76b0000"' + - '"02008f6f-0000-3400-0000-60a4fb660000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/940ea604-92a2-4220-a46d-15e9f80b9957?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/db7f8ff8-2430-4735-874e-b52dca1fa654?api-version=2020-10-01-preview pragma: - no-cache strict-transport-security: @@ -1716,10 +1713,10 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/940ea604-92a2-4220-a46d-15e9f80b9957?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/db7f8ff8-2430-4735-874e-b52dca1fa654?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/940ea604-92a2-4220-a46d-15e9f80b9957","name":"940ea604-92a2-4220-a46d-15e9f80b9957","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","status":"Succeeded","startTime":"2021-05-19T08:08:11.1030317Z","endTime":"2021-05-19T08:08:12.0887242Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/db7f8ff8-2430-4735-874e-b52dca1fa654","name":"db7f8ff8-2430-4735-874e-b52dca1fa654","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","status":"Succeeded","startTime":"2021-05-19T11:49:58.5550855Z","endTime":"2021-05-19T11:49:59.4345216Z","properties":null}' headers: cache-control: - no-cache @@ -1728,9 +1725,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:08:41 GMT + - Wed, 19 May 2021 11:50:29 GMT etag: - - '"02004169-0000-3400-0000-60a4c76c0000"' + - '"0200f370-0000-3400-0000-60a4fb670000"' expires: - '-1' pragma: @@ -1778,13 +1775,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:08:44 GMT + - Wed, 19 May 2021 11:50:30 GMT etag: - - '"00009169-0000-3400-0000-60a4c78c0000"' + - '"0000436a-0000-3400-0000-60a4fb870000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/55e046f6-0c30-403b-aa1b-bce4ebd2fe22?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/8365f60c-b98b-401e-bf44-310414a38cfb?api-version=2020-10-01-preview pragma: - no-cache strict-transport-security: @@ -1814,10 +1811,10 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/55e046f6-0c30-403b-aa1b-bce4ebd2fe22?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/8365f60c-b98b-401e-bf44-310414a38cfb?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/55e046f6-0c30-403b-aa1b-bce4ebd2fe22","name":"55e046f6-0c30-403b-aa1b-bce4ebd2fe22","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","status":"Succeeded","startTime":"2021-05-19T08:08:44.1153987Z","endTime":"2021-05-19T08:08:45.6413068Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/8365f60c-b98b-401e-bf44-310414a38cfb","name":"8365f60c-b98b-401e-bf44-310414a38cfb","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","status":"Succeeded","startTime":"2021-05-19T11:50:31.4216484Z","endTime":"2021-05-19T11:50:32.6556239Z","properties":null}' headers: cache-control: - no-cache @@ -1826,9 +1823,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 08:09:14 GMT + - Wed, 19 May 2021 11:51:01 GMT etag: - - '"02004669-0000-3400-0000-60a4c78d0000"' + - '"0200f570-0000-3400-0000-60a4fb880000"' expires: - '-1' pragma: diff --git a/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py b/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py index 8c39c488f18..2bf88dbcc5c 100644 --- a/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py +++ b/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py @@ -32,7 +32,7 @@ def test_connectedvmware(self): }) # Validate the show command output with vcenter name. - self.cmd('az connectedvmware vcenter show_command -g {rg} --name {vc_name}', checks=[ + self.cmd('az connectedvmware vcenter show -g {rg} --name {vc_name}', checks=[ self.check('name', '{vc_name}'), ]) @@ -45,7 +45,7 @@ def test_connectedvmware(self): self.cmd('az connectedvmware resource-pool create -g {rg} -l {loc} --custom-location {cus_loc} --vcenter {vc_name} --mo-ref-id {rp_morefid} --name {rp_name}') # Validate the show command output with resource-pool name. - self.cmd('az connectedvmware resource-pool show_command -g {rg} --name {rp_name}', checks=[ + self.cmd('az connectedvmware resource-pool show -g {rg} --name {rp_name}', checks=[ self.check('name', '{rp_name}'), ]) @@ -58,7 +58,7 @@ def test_connectedvmware(self): self.cmd('az connectedvmware virtual-network create -g {rg} -l {loc} --custom-location {cus_loc} --vcenter {vc_name} --mo-ref-id {vnet_morefid} --name {vnet_name}') # Validate the show command output with virtual-network name. - self.cmd('az connectedvmware virtual-network show_command -g {rg} --name {vnet_name}', checks=[ + self.cmd('az connectedvmware virtual-network show -g {rg} --name {vnet_name}', checks=[ self.check('name', '{vnet_name}'), ]) @@ -71,7 +71,7 @@ def test_connectedvmware(self): self.cmd('az connectedvmware vm-template create -g {rg} -l {loc} --custom-location {cus_loc} --vcenter {vc_name} --mo-ref-id {vmtpl_morefid} --name {vmtpl_name}') # Validate the show command output with vm-template name. - self.cmd('az connectedvmware vm-template show_command -g {rg} --name {vmtpl_name}', checks=[ + self.cmd('az connectedvmware vm-template show -g {rg} --name {vmtpl_name}', checks=[ self.check('name', '{vmtpl_name}'), ]) @@ -81,7 +81,7 @@ def test_connectedvmware(self): assert len(resource_list) >= 1 # Validate the show command output with inventory-item name. - self.cmd('az connectedvmware inventory-item show_command -g {rg} --vcenter-name {vc_name} --inventory-item {rp_morefid}', checks=[ + self.cmd('az connectedvmware inventory-item show -g {rg} --vcenter-name {vc_name} --inventory-item {rp_morefid}', checks=[ self.check('name', '{rp_morefid}'), ]) @@ -89,7 +89,7 @@ def test_connectedvmware(self): self.cmd('az connectedvmware vm create -g {rg} -l {loc} --custom-location {cus_loc} --vcenter {vc_name} --resource-pool {rp_name} --vm-template {vmtpl_name} --name {vm_name}') # Validate the show command output with vm name. - self.cmd('az connectedvmware vm show_command -g {rg} --name {vm_name}', checks=[ + self.cmd('az connectedvmware vm show -g {rg} --name {vm_name}', checks=[ self.check('name', '{vm_name}'), ]) From e4b3bb6b8be1628558cfcc98be13637cee9c19c0 Mon Sep 17 00:00:00 2001 From: Santosh Mishra Date: Thu, 20 May 2021 14:16:11 +0530 Subject: [PATCH 12/13] Added vm nic and vm disk test. --- .../azext_connectedvmware/__init__.py | 5 +- .../azext_connectedvmware/_actions.py | 6 +- .../azext_connectedvmware/_help.py | 4 +- .../azext_connectedvmware/_params.py | 2 +- .../azext_connectedvmware/custom.py | 2 +- .../recordings/test_connectedvmware.yaml | 472 +++++++++++++----- .../latest/test_connectedvmware_scenario.py | 24 +- 7 files changed, 371 insertions(+), 144 deletions(-) diff --git a/src/connectedvmware/azext_connectedvmware/__init__.py b/src/connectedvmware/azext_connectedvmware/__init__.py index 5659b774d57..99694e62aa6 100644 --- a/src/connectedvmware/azext_connectedvmware/__init__.py +++ b/src/connectedvmware/azext_connectedvmware/__init__.py @@ -2,12 +2,12 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- +# pylint: disable= unused-import, import-outside-toplevel, super-with-arguments from azure.cli.core import AzCommandsLoader -from azext_connectedvmware._help import helps # pylint: disable=unused-import +from azext_connectedvmware._help import helps -# pylint: disable=C0415 class ConnectedvmwareCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType @@ -16,7 +16,6 @@ def __init__(self, cli_ctx=None): operations_tmpl='azext_connectedvmware.custom#{}', client_factory=cf_connectedvmware, ) - # pylint: disable=R1725 super(ConnectedvmwareCommandsLoader, self).__init__( cli_ctx=cli_ctx, custom_command_type=connectedvmware_custom ) diff --git a/src/connectedvmware/azext_connectedvmware/_actions.py b/src/connectedvmware/azext_connectedvmware/_actions.py index 3bd21bc3f1c..349c57ce96f 100644 --- a/src/connectedvmware/azext_connectedvmware/_actions.py +++ b/src/connectedvmware/azext_connectedvmware/_actions.py @@ -2,6 +2,8 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- +# pylint: disable= protected-access, too-few-public-methods + """ This file contains actions for parsing complex arguments. """ @@ -10,7 +12,7 @@ from azext_connectedvmware.vmware_utils import create_dictionary_from_arg_string -class VmNicAddAction(argparse._AppendAction): # pylint: disable=W0212, R0903 +class VmNicAddAction(argparse._AppendAction): """ Action for parsing the nic arguments. """ @@ -23,7 +25,7 @@ def __call__(self, parser, namespace, values, option_string=None): namespace.nics = [nic_params_dict] -class VmDiskAddAction(argparse._AppendAction): # pylint: disable=W0212, R0903 +class VmDiskAddAction(argparse._AppendAction): """ Action for parsing the disk arguments. """ diff --git a/src/connectedvmware/azext_connectedvmware/_help.py b/src/connectedvmware/azext_connectedvmware/_help.py index 9daa9676d3e..11b5ce14b54 100644 --- a/src/connectedvmware/azext_connectedvmware/_help.py +++ b/src/connectedvmware/azext_connectedvmware/_help.py @@ -3,9 +3,9 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -# pylint: disable=too-many-lines +# pylint: disable= too-many-lines, unused-import -from knack.help_files import helps # pylint: disable=unused-import +from knack.help_files import helps helps[ diff --git a/src/connectedvmware/azext_connectedvmware/_params.py b/src/connectedvmware/azext_connectedvmware/_params.py index a8cb0ee11fb..f9d881adfcc 100644 --- a/src/connectedvmware/azext_connectedvmware/_params.py +++ b/src/connectedvmware/azext_connectedvmware/_params.py @@ -2,6 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- +# pylint: disable= too-many-statements from knack.arguments import CLIArgumentType from azure.cli.core.commands.parameters import tags_type @@ -9,7 +10,6 @@ from ._actions import VmNicAddAction, VmDiskAddAction -# pylint: disable=R0915 def load_arguments(self, _): connectedvmware_name_type = CLIArgumentType( options_list='--resource-name', help='Name of the resource.', id_part='name' diff --git a/src/connectedvmware/azext_connectedvmware/custom.py b/src/connectedvmware/azext_connectedvmware/custom.py index 6fc383a9d9b..1debcddd0d4 100644 --- a/src/connectedvmware/azext_connectedvmware/custom.py +++ b/src/connectedvmware/azext_connectedvmware/custom.py @@ -2,8 +2,8 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- +# pylint: disable= too-many-lines -# pylint: disable=C0302 from knack.util import CLIError from azext_connectedvmware.vmware_utils import get_resource_id from azure.cli.core.util import sdk_no_wait diff --git a/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware.yaml b/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware.yaml index d7522a7b27a..6f77911a876 100644 --- a/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware.yaml +++ b/src/connectedvmware/azext_connectedvmware/tests/latest/recordings/test_connectedvmware.yaml @@ -27,7 +27,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:43:54 GMT + - Thu, 20 May 2021 08:37:50 GMT etag: - '"03005e99-0000-3400-0000-60a255b90000"' expires: @@ -75,7 +75,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:43:56 GMT + - Thu, 20 May 2021 08:37:52 GMT expires: - '-1' pragma: @@ -119,12 +119,12 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:43:58.6415369Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-19T11:43:58.6415369Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Accepted"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-20T08:37:55.6347759Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-20T08:37:55.6347759Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Accepted"}}' headers: api-supported-versions: - 2019-12-20-privatepreview, 2020-10-01-preview azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/76d764e8-06fd-4243-9062-3aba283f26d5?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/7a3ba638-76c1-462c-9eda-3ab3e685d8c6?api-version=2020-10-01-preview cache-control: - no-cache content-length: @@ -132,9 +132,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:44:02 GMT + - Thu, 20 May 2021 08:37:57 GMT etag: - - '"0000eda0-0000-3400-0000-60a4fa020000"' + - '"00006fb2-0000-3400-0000-60a61fe50000"' expires: - '-1' location: @@ -168,10 +168,10 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/76d764e8-06fd-4243-9062-3aba283f26d5?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/7a3ba638-76c1-462c-9eda-3ab3e685d8c6?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/76d764e8-06fd-4243-9062-3aba283f26d5","name":"76d764e8-06fd-4243-9062-3aba283f26d5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","status":"Succeeded","startTime":"2021-05-19T11:44:01.7721804Z","endTime":"2021-05-19T11:44:08.4332259Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/7a3ba638-76c1-462c-9eda-3ab3e685d8c6","name":"7a3ba638-76c1-462c-9eda-3ab3e685d8c6","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","status":"Succeeded","startTime":"2021-05-20T08:37:57.5788707Z","endTime":"2021-05-20T08:38:02.9907921Z","properties":null}' headers: cache-control: - no-cache @@ -180,9 +180,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:44:32 GMT + - Thu, 20 May 2021 08:38:28 GMT etag: - - '"0200b470-0000-3400-0000-60a4fa080000"' + - '"0300235b-0000-3400-0000-60a61fea0000"' expires: - '-1' pragma: @@ -217,7 +217,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:43:58.6415369Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T11:44:08.0424233Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Succeeded","customResourceName":"58b376ab-76ac-480f-9b6f-629b7b339c18","uuid":"58b376ab-76ac-480f-9b6f-629b7b339c18","moName":"SanmishraResourcePool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-20T08:37:55.6347759Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-20T08:38:02.7469224Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Succeeded","customResourceName":"4f76ae05-2004-4d3b-bcde-372ef167b680","uuid":"4f76ae05-2004-4d3b-bcde-372ef167b680","moName":"SanmishraResourcePool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}' headers: cache-control: - no-cache @@ -226,9 +226,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:44:33 GMT + - Thu, 20 May 2021 08:38:28 GMT etag: - - '"0000f3a0-0000-3400-0000-60a4fa080000"' + - '"000075b2-0000-3400-0000-60a61feb0000"' expires: - '-1' pragma: @@ -265,7 +265,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:43:58.6415369Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T11:44:08.0424233Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Succeeded","customResourceName":"58b376ab-76ac-480f-9b6f-629b7b339c18","uuid":"58b376ab-76ac-480f-9b6f-629b7b339c18","moName":"SanmishraResourcePool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-20T08:37:55.6347759Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-20T08:38:02.7469224Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Succeeded","customResourceName":"4f76ae05-2004-4d3b-bcde-372ef167b680","uuid":"4f76ae05-2004-4d3b-bcde-372ef167b680","moName":"SanmishraResourcePool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}' headers: cache-control: - no-cache @@ -274,9 +274,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:44:35 GMT + - Thu, 20 May 2021 08:38:30 GMT etag: - - '"0000f3a0-0000-3400-0000-60a4fa080000"' + - '"000075b2-0000-3400-0000-60a61feb0000"' expires: - '-1' pragma: @@ -313,7 +313,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools?api-version=2020-10-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:43:58.6415369Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T11:44:08.0424233Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Succeeded","customResourceName":"58b376ab-76ac-480f-9b6f-629b7b339c18","uuid":"58b376ab-76ac-480f-9b6f-629b7b339c18","moName":"SanmishraResourcePool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}]}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","name":"azcli-test-resource-pool","type":"microsoft.connectedvmwarevsphere/resourcepools","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-20T08:37:55.6347759Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-20T08:38:02.7469224Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"resgroup-5034","provisioningState":"Succeeded","customResourceName":"4f76ae05-2004-4d3b-bcde-372ef167b680","uuid":"4f76ae05-2004-4d3b-bcde-372ef167b680","moName":"SanmishraResourcePool","cpuSharesLevel":"normal","cpuLimitMHz":-1,"memSharesLevel":"normal","memLimitMB":-1}}]}' headers: cache-control: - no-cache @@ -322,7 +322,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:44:36 GMT + - Thu, 20 May 2021 08:38:31 GMT expires: - '-1' pragma: @@ -366,12 +366,12 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:44:38.7913062Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-19T11:44:38.7913062Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Accepted"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-20T08:38:34.5568052Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-20T08:38:34.5568052Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Accepted"}}' headers: api-supported-versions: - 2019-12-20-privatepreview, 2020-10-01-preview azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/3c860159-fd93-4a03-bb30-85bb419f52f9?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/6706dad8-f453-402e-91f8-d3cb5c8b8835?api-version=2020-10-01-preview cache-control: - no-cache content-length: @@ -379,9 +379,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:44:42 GMT + - Thu, 20 May 2021 08:38:36 GMT etag: - - '"0200376f-0000-3400-0000-60a4fa2a0000"' + - '"03003f3e-0000-3400-0000-60a6200c0000"' expires: - '-1' location: @@ -415,21 +415,21 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/3c860159-fd93-4a03-bb30-85bb419f52f9?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/6706dad8-f453-402e-91f8-d3cb5c8b8835?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/3c860159-fd93-4a03-bb30-85bb419f52f9","name":"3c860159-fd93-4a03-bb30-85bb419f52f9","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","status":"Succeeded","startTime":"2021-05-19T11:44:41.812391Z","endTime":"2021-05-19T11:44:46.3395966Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/6706dad8-f453-402e-91f8-d3cb5c8b8835","name":"6706dad8-f453-402e-91f8-d3cb5c8b8835","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","status":"Succeeded","startTime":"2021-05-20T08:38:36.2649736Z","endTime":"2021-05-20T08:38:40.8917984Z","properties":null}' headers: cache-control: - no-cache content-length: - - '479' + - '480' content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:45:12 GMT + - Thu, 20 May 2021 08:39:06 GMT etag: - - '"0200b770-0000-3400-0000-60a4fa2e0000"' + - '"0300285b-0000-3400-0000-60a620100000"' expires: - '-1' pragma: @@ -464,7 +464,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:44:38.7913062Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T11:44:46.1212673Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Succeeded","customResourceName":"6f79b65a-f4a1-4726-935c-6060f3a2ae52","uuid":"6f79b65a-f4a1-4726-935c-6060f3a2ae52","moName":"segment-2"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-20T08:38:34.5568052Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-20T08:38:40.6787229Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Succeeded","customResourceName":"cf74f72f-b211-4c33-9d71-436729f9b46e","uuid":"cf74f72f-b211-4c33-9d71-436729f9b46e","moName":"segment-2"}}' headers: cache-control: - no-cache @@ -473,9 +473,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:45:13 GMT + - Thu, 20 May 2021 08:39:07 GMT etag: - - '"02003d6f-0000-3400-0000-60a4fa2e0000"' + - '"0300453e-0000-3400-0000-60a620100000"' expires: - '-1' pragma: @@ -512,7 +512,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:44:38.7913062Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T11:44:46.1212673Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Succeeded","customResourceName":"6f79b65a-f4a1-4726-935c-6060f3a2ae52","uuid":"6f79b65a-f4a1-4726-935c-6060f3a2ae52","moName":"segment-2"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-20T08:38:34.5568052Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-20T08:38:40.6787229Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Succeeded","customResourceName":"cf74f72f-b211-4c33-9d71-436729f9b46e","uuid":"cf74f72f-b211-4c33-9d71-436729f9b46e","moName":"segment-2"}}' headers: cache-control: - no-cache @@ -521,9 +521,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:45:15 GMT + - Thu, 20 May 2021 08:39:09 GMT etag: - - '"02003d6f-0000-3400-0000-60a4fa2e0000"' + - '"0300453e-0000-3400-0000-60a620100000"' expires: - '-1' pragma: @@ -560,7 +560,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks?api-version=2020-10-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:44:38.7913062Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T11:44:46.1212673Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Succeeded","customResourceName":"6f79b65a-f4a1-4726-935c-6060f3a2ae52","uuid":"6f79b65a-f4a1-4726-935c-6060f3a2ae52","moName":"segment-2"}}]}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","name":"azcli-test-virtual-network","type":"microsoft.connectedvmwarevsphere/virtualnetworks","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-20T08:38:34.5568052Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-20T08:38:40.6787229Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"network-o761","provisioningState":"Succeeded","customResourceName":"cf74f72f-b211-4c33-9d71-436729f9b46e","uuid":"cf74f72f-b211-4c33-9d71-436729f9b46e","moName":"segment-2"}}]}' headers: cache-control: - no-cache @@ -569,7 +569,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:45:15 GMT + - Thu, 20 May 2021 08:39:10 GMT expires: - '-1' pragma: @@ -613,12 +613,12 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:45:18.1893368Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-19T11:45:18.1893368Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"vm-55","provisioningState":"Accepted"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-20T08:39:12.5881165Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-20T08:39:12.5881165Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"vm-55","provisioningState":"Accepted"}}' headers: api-supported-versions: - 2019-12-20-privatepreview, 2020-10-01-preview azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/2688d4af-392d-41c3-8cdf-344cbab725c3?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/6adcef3a-863d-4f9b-affd-c8ceb7a5d4e6?api-version=2020-10-01-preview cache-control: - no-cache content-length: @@ -626,9 +626,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:45:20 GMT + - Thu, 20 May 2021 08:39:14 GMT etag: - - '"00003c6a-0000-3400-0000-60a4fa4f0000"' + - '"00003985-0000-3400-0000-60a620320000"' expires: - '-1' location: @@ -642,7 +642,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 201 message: Created @@ -662,21 +662,21 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/2688d4af-392d-41c3-8cdf-344cbab725c3?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/6adcef3a-863d-4f9b-affd-c8ceb7a5d4e6?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/2688d4af-392d-41c3-8cdf-344cbab725c3","name":"2688d4af-392d-41c3-8cdf-344cbab725c3","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","status":"Succeeded","startTime":"2021-05-19T11:45:19.374918Z","endTime":"2021-05-19T11:45:22.6949187Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/6adcef3a-863d-4f9b-affd-c8ceb7a5d4e6","name":"6adcef3a-863d-4f9b-affd-c8ceb7a5d4e6","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","status":"Succeeded","startTime":"2021-05-20T08:39:14.1707703Z","endTime":"2021-05-20T08:39:17.3225485Z","properties":null}' headers: cache-control: - no-cache content-length: - - '483' + - '484' content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:45:50 GMT + - Thu, 20 May 2021 08:39:44 GMT etag: - - '"0200d070-0000-3400-0000-60a4fa520000"' + - '"03002c5b-0000-3400-0000-60a620350000"' expires: - '-1' pragma: @@ -711,7 +711,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:45:18.1893368Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T11:45:22.4417906Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"vm-55","provisioningState":"Succeeded","customResourceName":"6bef5a0e-64c9-40ca-8abb-db0c442322c0","uuid":"6bef5a0e-64c9-40ca-8abb-db0c442322c0","networkInterfaces":[{"name":"nic_1","label":"Network + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-20T08:39:12.5881165Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-20T08:39:17.0717431Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"vm-55","provisioningState":"Succeeded","customResourceName":"7eeb56cf-13e8-48e6-b209-534a82e21b45","uuid":"7eeb56cf-13e8-48e6-b209-534a82e21b45","networkInterfaces":[{"name":"nic_1","label":"Network adapter 1","macAddress":"00:50:56:93:2b:71","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}],"disks":[{"diskObjectId":"1816-2000","name":"disk_1","label":"Hard disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"moName":"azurevmwarecloudtestubuntu","memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"osType":"Linux","osName":"Ubuntu Linux (64-bit)","folderPath":"SDDC-Datacenter/Templates"}}' @@ -723,9 +723,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:45:50 GMT + - Thu, 20 May 2021 08:39:45 GMT etag: - - '"0000426a-0000-3400-0000-60a4fa520000"' + - '"00003f85-0000-3400-0000-60a620350000"' expires: - '-1' pragma: @@ -762,7 +762,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:45:18.1893368Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T11:45:22.4417906Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"vm-55","provisioningState":"Succeeded","customResourceName":"6bef5a0e-64c9-40ca-8abb-db0c442322c0","uuid":"6bef5a0e-64c9-40ca-8abb-db0c442322c0","networkInterfaces":[{"name":"nic_1","label":"Network + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-20T08:39:12.5881165Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-20T08:39:17.0717431Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"vm-55","provisioningState":"Succeeded","customResourceName":"7eeb56cf-13e8-48e6-b209-534a82e21b45","uuid":"7eeb56cf-13e8-48e6-b209-534a82e21b45","networkInterfaces":[{"name":"nic_1","label":"Network adapter 1","macAddress":"00:50:56:93:2b:71","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}],"disks":[{"diskObjectId":"1816-2000","name":"disk_1","label":"Hard disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"moName":"azurevmwarecloudtestubuntu","memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"osType":"Linux","osName":"Ubuntu Linux (64-bit)","folderPath":"SDDC-Datacenter/Templates"}}' @@ -774,9 +774,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:45:51 GMT + - Thu, 20 May 2021 08:39:52 GMT etag: - - '"0000426a-0000-3400-0000-60a4fa520000"' + - '"00003f85-0000-3400-0000-60a620350000"' expires: - '-1' pragma: @@ -813,7 +813,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates?api-version=2020-10-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:45:18.1893368Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T11:45:22.4417906Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"vm-55","provisioningState":"Succeeded","customResourceName":"6bef5a0e-64c9-40ca-8abb-db0c442322c0","uuid":"6bef5a0e-64c9-40ca-8abb-db0c442322c0","networkInterfaces":[{"name":"nic_1","label":"Network + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","name":"azcli-test-vm-template","type":"microsoft.connectedvmwarevsphere/virtualmachinetemplates","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-20T08:39:12.5881165Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-20T08:39:17.0717431Z"},"properties":{"vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","moRefId":"vm-55","provisioningState":"Succeeded","customResourceName":"7eeb56cf-13e8-48e6-b209-534a82e21b45","uuid":"7eeb56cf-13e8-48e6-b209-534a82e21b45","networkInterfaces":[{"name":"nic_1","label":"Network adapter 1","macAddress":"00:50:56:93:2b:71","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}],"disks":[{"diskObjectId":"1816-2000","name":"disk_1","label":"Hard disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"moName":"azurevmwarecloudtestubuntu","memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"osType":"Linux","osName":"Ubuntu Linux (64-bit)","folderPath":"SDDC-Datacenter/Templates"}}]}' @@ -825,7 +825,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:45:53 GMT + - Thu, 20 May 2021 08:39:54 GMT expires: - '-1' pragma: @@ -862,7 +862,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/vcenters/azcli-test-vcenter-avs/inventoryItems/resgroup-5034?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/azcli-test-vcenter-avs/InventoryItems/resgroup-5034","name":"resgroup-5034","type":"microsoft.connectedvmwarevsphere/vcenters/inventoryitems","systemData":{"createdBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","createdByType":"Application","createdAt":"2021-05-17T11:38:31.7591468Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T08:09:34.4142677Z"},"properties":{"inventoryType":"ResourcePool","managedResourceId":"","moRefId":"resgroup-5034","provisioningState":"Succeeded","parent":{"moName":"Resources","inventoryItemId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/azcli-test-vcenter-avs/InventoryItems/resgroup-8"},"moName":"SanmishraResourcePool"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/azcli-test-vcenter-avs/InventoryItems/resgroup-5034","name":"resgroup-5034","type":"microsoft.connectedvmwarevsphere/vcenters/inventoryitems","systemData":{"createdBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","createdByType":"Application","createdAt":"2021-05-17T11:38:31.7591468Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-20T08:37:53.6705422Z"},"properties":{"inventoryType":"ResourcePool","managedResourceId":"","moRefId":"resgroup-5034","provisioningState":"Succeeded","parent":{"moName":"Resources","inventoryItemId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/azcli-test-vcenter-avs/InventoryItems/resgroup-8"},"moName":"SanmishraResourcePool"}}' headers: cache-control: - no-cache @@ -871,9 +871,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:46:04 GMT + - Thu, 20 May 2021 08:39:55 GMT etag: - - '"5200d139-0000-3400-0000-60a4c7be0000"' + - '"63003b0a-0000-3400-0000-60a61fe10000"' expires: - '-1' pragma: @@ -918,12 +918,12 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:46:07.1277397Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-19T11:46:07.1277397Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Accepted"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-20T08:39:58.8473016Z","lastModifiedBy":"sanmishra@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2021-05-20T08:39:58.8473016Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Accepted"}}' headers: api-supported-versions: - 2019-12-20-privatepreview, 2020-10-01-preview azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d4b7f8b2-2a68-40f2-8d7a-0fe65c1393f5?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/f2445eee-835c-4a92-bca5-58282a394fe0?api-version=2020-10-01-preview cache-control: - no-cache content-length: @@ -931,9 +931,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:46:08 GMT + - Thu, 20 May 2021 08:39:59 GMT etag: - - '"0100a45b-0000-3400-0000-60a4fa810000"' + - '"0f00e332-0000-3400-0000-60a6205f0000"' expires: - '-1' location: @@ -947,7 +947,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 201 message: Created @@ -967,10 +967,10 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d4b7f8b2-2a68-40f2-8d7a-0fe65c1393f5?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/f2445eee-835c-4a92-bca5-58282a394fe0?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d4b7f8b2-2a68-40f2-8d7a-0fe65c1393f5","name":"d4b7f8b2-2a68-40f2-8d7a-0fe65c1393f5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Accepted","startTime":"2021-05-19T11:46:08.8331842Z"}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/f2445eee-835c-4a92-bca5-58282a394fe0","name":"f2445eee-835c-4a92-bca5-58282a394fe0","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Accepted","startTime":"2021-05-20T08:39:59.3521231Z"}' headers: cache-control: - no-cache @@ -979,9 +979,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:46:39 GMT + - Thu, 20 May 2021 08:40:29 GMT etag: - - '"0200d270-0000-3400-0000-60a4fa800000"' + - '"03002d5b-0000-3400-0000-60a6205f0000"' expires: - '-1' pragma: @@ -1013,10 +1013,10 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d4b7f8b2-2a68-40f2-8d7a-0fe65c1393f5?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/f2445eee-835c-4a92-bca5-58282a394fe0?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d4b7f8b2-2a68-40f2-8d7a-0fe65c1393f5","name":"d4b7f8b2-2a68-40f2-8d7a-0fe65c1393f5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Accepted","startTime":"2021-05-19T11:46:08.8331842Z"}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/f2445eee-835c-4a92-bca5-58282a394fe0","name":"f2445eee-835c-4a92-bca5-58282a394fe0","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Accepted","startTime":"2021-05-20T08:39:59.3521231Z"}' headers: cache-control: - no-cache @@ -1025,9 +1025,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:47:10 GMT + - Thu, 20 May 2021 08:41:01 GMT etag: - - '"0200d270-0000-3400-0000-60a4fa800000"' + - '"03002d5b-0000-3400-0000-60a6205f0000"' expires: - '-1' pragma: @@ -1059,10 +1059,10 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d4b7f8b2-2a68-40f2-8d7a-0fe65c1393f5?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/f2445eee-835c-4a92-bca5-58282a394fe0?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/d4b7f8b2-2a68-40f2-8d7a-0fe65c1393f5","name":"d4b7f8b2-2a68-40f2-8d7a-0fe65c1393f5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Succeeded","startTime":"2021-05-19T11:46:08.8331842Z","endTime":"2021-05-19T11:47:30.1606374Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/f2445eee-835c-4a92-bca5-58282a394fe0","name":"f2445eee-835c-4a92-bca5-58282a394fe0","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Succeeded","startTime":"2021-05-20T08:39:59.3521231Z","endTime":"2021-05-20T08:41:24.1383683Z","properties":null}' headers: cache-control: - no-cache @@ -1071,9 +1071,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:47:40 GMT + - Thu, 20 May 2021 08:41:31 GMT etag: - - '"0200e170-0000-3400-0000-60a4fad20000"' + - '"0300315b-0000-3400-0000-60a620b40000"' expires: - '-1' pragma: @@ -1108,21 +1108,21 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:46:07.1277397Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T11:47:29.9091297Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Succeeded","customResourceName":"142f1eba-cbdf-46e5-9cf9-6608cc4cca91","uuid":"142f1eba-cbdf-46e5-9cf9-6608cc4cca91","vmId":"142f1eba-cbdf-46e5-9cf9-6608cc4cca91","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network - adapter 1","macAddress":"00:50:56:93:6d:5c","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}]},"storageProfile":{"disks":[{"diskObjectId":"12754-2000","name":"disk_1","label":"Hard + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-20T08:39:58.8473016Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-20T08:41:23.9017897Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Succeeded","customResourceName":"57ab57b6-9697-4302-b6dc-25bd98e56fd3","uuid":"57ab57b6-9697-4302-b6dc-25bd98e56fd3","vmId":"57ab57b6-9697-4302-b6dc-25bd98e56fd3","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network + adapter 1","macAddress":"00:50:56:93:c1:59","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}]},"storageProfile":{"disks":[{"diskObjectId":"13007-2000","name":"disk_1","label":"Hard disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"","osType":"Linux","osName":"Ubuntu - Linux (64-bit)","toolsRunningStatus":"guestToolsNotRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"142f1eba-cbdf-46e5-9cf9-6608cc4cca91","moRefId":"vm-25394","moName":"azcli-test-virtual-machine","folderPath":"SDDC-Datacenter","powerState":"poweredOn"}}' + Linux (64-bit)","toolsRunningStatus":"guestToolsRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"57ab57b6-9697-4302-b6dc-25bd98e56fd3","moRefId":"vm-25875","moName":"azcli-test-virtual-machine","folderPath":"SDDC-Datacenter","powerState":"poweredOn"}}' headers: cache-control: - no-cache content-length: - - '2602' + - '2599' content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:47:41 GMT + - Thu, 20 May 2021 08:41:31 GMT etag: - - '"0100b15b-0000-3400-0000-60a4fad20000"' + - '"0f000e33-0000-3400-0000-60a620b40000"' expires: - '-1' pragma: @@ -1159,21 +1159,21 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine?api-version=2020-10-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:46:07.1277397Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T11:47:29.9091297Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Succeeded","customResourceName":"142f1eba-cbdf-46e5-9cf9-6608cc4cca91","uuid":"142f1eba-cbdf-46e5-9cf9-6608cc4cca91","vmId":"142f1eba-cbdf-46e5-9cf9-6608cc4cca91","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network - adapter 1","macAddress":"00:50:56:93:6d:5c","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}]},"storageProfile":{"disks":[{"diskObjectId":"12754-2000","name":"disk_1","label":"Hard + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-20T08:39:58.8473016Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-20T08:41:23.9017897Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Succeeded","customResourceName":"57ab57b6-9697-4302-b6dc-25bd98e56fd3","uuid":"57ab57b6-9697-4302-b6dc-25bd98e56fd3","vmId":"57ab57b6-9697-4302-b6dc-25bd98e56fd3","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network + adapter 1","macAddress":"00:50:56:93:c1:59","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}]},"storageProfile":{"disks":[{"diskObjectId":"13007-2000","name":"disk_1","label":"Hard disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"","osType":"Linux","osName":"Ubuntu - Linux (64-bit)","toolsRunningStatus":"guestToolsNotRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"142f1eba-cbdf-46e5-9cf9-6608cc4cca91","moRefId":"vm-25394","moName":"azcli-test-virtual-machine","folderPath":"SDDC-Datacenter","powerState":"poweredOn"}}' + Linux (64-bit)","toolsRunningStatus":"guestToolsRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"57ab57b6-9697-4302-b6dc-25bd98e56fd3","moRefId":"vm-25875","moName":"azcli-test-virtual-machine","folderPath":"SDDC-Datacenter","powerState":"poweredOn"}}' headers: cache-control: - no-cache content-length: - - '2602' + - '2599' content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:47:42 GMT + - Thu, 20 May 2021 08:41:33 GMT etag: - - '"0100b15b-0000-3400-0000-60a4fad20000"' + - '"0f000e33-0000-3400-0000-60a620b40000"' expires: - '-1' pragma: @@ -1225,19 +1225,223 @@ interactions: Linux (64-bit)","toolsRunningStatus":"guestToolsNotRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"b84184fc-8e13-4147-a58c-99ac11a82e03","moRefId":"vm-24993","moName":"azcli-test-vm6","folderPath":"SDDC-Datacenter","powerState":"poweredOff"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/stop-vm-test","name":"stop-vm-test","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T07:36:13.9786742Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T07:37:42.6131581Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Failed","customResourceName":"f4e0270f-9f91-4150-b6e9-bb6ac0d3783d","uuid":"f4e0270f-9f91-4150-b6e9-bb6ac0d3783d","vmId":"f4e0270f-9f91-4150-b6e9-bb6ac0d3783d","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network adapter 1","macAddress":"00:50:56:93:56:85","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}]},"storageProfile":{"disks":[{"diskObjectId":"12201-2000","name":"disk_1","label":"Hard disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"","osType":"Linux","osName":"Ubuntu - Linux (64-bit)","toolsRunningStatus":"guestToolsNotRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11301"},"hardwareProfile":{"memorySizeMB":2048,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"f4e0270f-9f91-4150-b6e9-bb6ac0d3783d","moRefId":"vm-25216","moName":"stop-vm-test","folderPath":"SDDC-Datacenter","powerState":"poweredOff"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-19T11:46:07.1277397Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-19T11:47:29.9091297Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Succeeded","customResourceName":"142f1eba-cbdf-46e5-9cf9-6608cc4cca91","uuid":"142f1eba-cbdf-46e5-9cf9-6608cc4cca91","vmId":"142f1eba-cbdf-46e5-9cf9-6608cc4cca91","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network - adapter 1","macAddress":"00:50:56:93:6d:5c","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}]},"storageProfile":{"disks":[{"diskObjectId":"12754-2000","name":"disk_1","label":"Hard + Linux (64-bit)","toolsRunningStatus":"guestToolsNotRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11301"},"hardwareProfile":{"memorySizeMB":2048,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"f4e0270f-9f91-4150-b6e9-bb6ac0d3783d","moRefId":"vm-25216","moName":"stop-vm-test","folderPath":"SDDC-Datacenter","powerState":"poweredOff"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-20T08:39:58.8473016Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-20T08:41:23.9017897Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Succeeded","customResourceName":"57ab57b6-9697-4302-b6dc-25bd98e56fd3","uuid":"57ab57b6-9697-4302-b6dc-25bd98e56fd3","vmId":"57ab57b6-9697-4302-b6dc-25bd98e56fd3","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network + adapter 1","macAddress":"00:50:56:93:c1:59","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}]},"storageProfile":{"disks":[{"diskObjectId":"13007-2000","name":"disk_1","label":"Hard + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"","osType":"Linux","osName":"Ubuntu + Linux (64-bit)","toolsRunningStatus":"guestToolsRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"57ab57b6-9697-4302-b6dc-25bd98e56fd3","moRefId":"vm-25875","moName":"azcli-test-virtual-machine","folderPath":"SDDC-Datacenter","powerState":"poweredOn"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '15448' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 May 2021 08:41:35 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware vm nic show + Connection: + - keep-alive + ParameterSetName: + - -g --vm-name --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-20T08:39:58.8473016Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-20T08:41:23.9017897Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Succeeded","customResourceName":"57ab57b6-9697-4302-b6dc-25bd98e56fd3","uuid":"57ab57b6-9697-4302-b6dc-25bd98e56fd3","vmId":"57ab57b6-9697-4302-b6dc-25bd98e56fd3","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network + adapter 1","macAddress":"00:50:56:93:c1:59","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}]},"storageProfile":{"disks":[{"diskObjectId":"13007-2000","name":"disk_1","label":"Hard + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"","osType":"Linux","osName":"Ubuntu + Linux (64-bit)","toolsRunningStatus":"guestToolsRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"57ab57b6-9697-4302-b6dc-25bd98e56fd3","moRefId":"vm-25875","moName":"azcli-test-virtual-machine","folderPath":"SDDC-Datacenter","powerState":"poweredOn"}}' + headers: + cache-control: + - no-cache + content-length: + - '2599' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 May 2021 08:41:36 GMT + etag: + - '"0f000e33-0000-3400-0000-60a620b40000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware vm nic list + Connection: + - keep-alive + ParameterSetName: + - -g --vm-name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-20T08:39:58.8473016Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-20T08:41:23.9017897Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Succeeded","customResourceName":"57ab57b6-9697-4302-b6dc-25bd98e56fd3","uuid":"57ab57b6-9697-4302-b6dc-25bd98e56fd3","vmId":"57ab57b6-9697-4302-b6dc-25bd98e56fd3","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network + adapter 1","macAddress":"00:50:56:93:c1:59","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}]},"storageProfile":{"disks":[{"diskObjectId":"13007-2000","name":"disk_1","label":"Hard + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"","osType":"Linux","osName":"Ubuntu + Linux (64-bit)","toolsRunningStatus":"guestToolsRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"57ab57b6-9697-4302-b6dc-25bd98e56fd3","moRefId":"vm-25875","moName":"azcli-test-virtual-machine","folderPath":"SDDC-Datacenter","powerState":"poweredOn"}}' + headers: + cache-control: + - no-cache + content-length: + - '2599' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 May 2021 08:41:38 GMT + etag: + - '"0f000e33-0000-3400-0000-60a620b40000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware vm disk show + Connection: + - keep-alive + ParameterSetName: + - -g --vm-name --name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-20T08:39:58.8473016Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-20T08:41:23.9017897Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Succeeded","customResourceName":"57ab57b6-9697-4302-b6dc-25bd98e56fd3","uuid":"57ab57b6-9697-4302-b6dc-25bd98e56fd3","vmId":"57ab57b6-9697-4302-b6dc-25bd98e56fd3","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network + adapter 1","macAddress":"00:50:56:93:c1:59","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}]},"storageProfile":{"disks":[{"diskObjectId":"13007-2000","name":"disk_1","label":"Hard + disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"","osType":"Linux","osName":"Ubuntu + Linux (64-bit)","toolsRunningStatus":"guestToolsRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"57ab57b6-9697-4302-b6dc-25bd98e56fd3","moRefId":"vm-25875","moName":"azcli-test-virtual-machine","folderPath":"SDDC-Datacenter","powerState":"poweredOn"}}' + headers: + cache-control: + - no-cache + content-length: + - '2599' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 20 May 2021 08:41:39 GMT + etag: + - '"0f000e33-0000-3400-0000-60a620b40000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - connectedvmware vm disk list + Connection: + - keep-alive + ParameterSetName: + - -g --vm-name + User-Agent: + - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine?api-version=2020-10-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","name":"azcli-test-virtual-machine","type":"microsoft.connectedvmwarevsphere/virtualmachines","kind":"VMware","location":"eastus2euap","extendedLocation":{"type":"CustomLocation","name":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ExtendedLocation/CustomLocations/azcli-test-cl-avs"},"systemData":{"createdBy":"sanmishra@microsoft.com","createdByType":"User","createdAt":"2021-05-20T08:39:58.8473016Z","lastModifiedBy":"ac9dc5fe-b644-4832-9d03-d9f1ab70c5f7","lastModifiedByType":"Application","lastModifiedAt":"2021-05-20T08:41:23.9017897Z"},"properties":{"resourcePoolId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/resourcepools/azcli-test-resource-pool","templateId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/virtualmachinetemplates/azcli-test-vm-template","vCenterId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVmwarevSphere/VCenters/azcli-test-vcenter-avs","provisioningState":"Succeeded","customResourceName":"57ab57b6-9697-4302-b6dc-25bd98e56fd3","uuid":"57ab57b6-9697-4302-b6dc-25bd98e56fd3","vmId":"57ab57b6-9697-4302-b6dc-25bd98e56fd3","networkProfile":{"networkInterfaces":[{"name":"nic_1","label":"Network + adapter 1","macAddress":"00:50:56:93:c1:59","networkMoRefId":"network-o50","networkMoName":"segment-1","nicType":"vmxnet3","deviceKey":4000,"powerOnBoot":"enabled","ipSettings":{"allocationMethod":"unset"}}]},"storageProfile":{"disks":[{"diskObjectId":"13007-2000","name":"disk_1","label":"Hard disk 1","diskSizeGB":10,"deviceKey":2000,"diskMode":"persistent","controllerKey":1000,"unitNumber":0}],"scsiControllers":[{"type":"lsilogic","controllerKey":1000,"scsiCtlrUnitNumber":7,"sharing":"noSharing"}]},"osProfile":{"computerName":"","osType":"Linux","osName":"Ubuntu - Linux (64-bit)","toolsRunningStatus":"guestToolsNotRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"142f1eba-cbdf-46e5-9cf9-6608cc4cca91","moRefId":"vm-25394","moName":"azcli-test-virtual-machine","folderPath":"SDDC-Datacenter","powerState":"poweredOn"}}]}' + Linux (64-bit)","toolsRunningStatus":"guestToolsRunning","toolsVersionStatus":"guestToolsUnmanaged","toolsVersion":"11269"},"hardwareProfile":{"memorySizeMB":1024,"numCPUs":1,"numCoresPerSocket":1,"cpuHotAddEnabled":true,"cpuHotRemoveEnabled":false,"memoryHotAddEnabled":true},"instanceUuid":"57ab57b6-9697-4302-b6dc-25bd98e56fd3","moRefId":"vm-25875","moName":"azcli-test-virtual-machine","folderPath":"SDDC-Datacenter","powerState":"poweredOn"}}' headers: cache-control: - no-cache content-length: - - '15451' + - '2599' content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:47:43 GMT + - Thu, 20 May 2021 08:41:41 GMT + etag: + - '"0f000e33-0000-3400-0000-60a620b40000"' expires: - '-1' pragma: @@ -1289,11 +1493,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:47:45 GMT + - Thu, 20 May 2021 08:41:43 GMT expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/4d8bed26-707d-48df-9279-b4443161eef4?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/b257f025-d0d9-4bd7-8eba-d164ee205e7c?api-version=2020-10-01-preview pragma: - no-cache strict-transport-security: @@ -1323,10 +1527,10 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/4d8bed26-707d-48df-9279-b4443161eef4?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/b257f025-d0d9-4bd7-8eba-d164ee205e7c?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/4d8bed26-707d-48df-9279-b4443161eef4","name":"4d8bed26-707d-48df-9279-b4443161eef4","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Succeeded","startTime":"2021-05-19T11:47:45.5277418Z","endTime":"2021-05-19T11:48:02.1689421Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/b257f025-d0d9-4bd7-8eba-d164ee205e7c","name":"b257f025-d0d9-4bd7-8eba-d164ee205e7c","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Succeeded","startTime":"2021-05-20T08:41:43.9752131Z","endTime":"2021-05-20T08:41:53.7301189Z","properties":null}' headers: cache-control: - no-cache @@ -1335,9 +1539,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:48:15 GMT + - Thu, 20 May 2021 08:42:14 GMT etag: - - '"0200e570-0000-3400-0000-60a4faf20000"' + - '"0300415b-0000-3400-0000-60a620d10000"' expires: - '-1' pragma: @@ -1385,11 +1589,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:48:18 GMT + - Thu, 20 May 2021 08:42:16 GMT expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/9d384c4a-f5ef-4a4e-b5da-a4ed2e8c9e2e?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/0686e107-b82d-4402-ab9e-eca47c059855?api-version=2020-10-01-preview pragma: - no-cache strict-transport-security: @@ -1419,21 +1623,21 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/9d384c4a-f5ef-4a4e-b5da-a4ed2e8c9e2e?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/0686e107-b82d-4402-ab9e-eca47c059855?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/9d384c4a-f5ef-4a4e-b5da-a4ed2e8c9e2e","name":"9d384c4a-f5ef-4a4e-b5da-a4ed2e8c9e2e","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Succeeded","startTime":"2021-05-19T11:48:18.64059Z","endTime":"2021-05-19T11:48:31.2379668Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/0686e107-b82d-4402-ab9e-eca47c059855","name":"0686e107-b82d-4402-ab9e-eca47c059855","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Succeeded","startTime":"2021-05-20T08:42:16.8589057Z","endTime":"2021-05-20T08:42:24.9984698Z","properties":null}' headers: cache-control: - no-cache content-length: - - '478' + - '480' content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:48:49 GMT + - Thu, 20 May 2021 08:42:47 GMT etag: - - '"0200e970-0000-3400-0000-60a4fb0f0000"' + - '"03004d5b-0000-3400-0000-60a620f10000"' expires: - '-1' pragma: @@ -1481,13 +1685,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:48:51 GMT + - Thu, 20 May 2021 08:42:49 GMT etag: - - '"0100be5b-0000-3400-0000-60a4fb230000"' + - '"0f002833-0000-3400-0000-60a6210a0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/94f4991a-7013-456c-8ba0-38071cf2bbb6?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/ecabc3f1-87b2-44a6-83bf-688e7e5f93df?api-version=2020-10-01-preview pragma: - no-cache strict-transport-security: @@ -1497,7 +1701,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - - '14999' + - '14998' status: code: 202 message: Accepted @@ -1517,21 +1721,21 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/94f4991a-7013-456c-8ba0-38071cf2bbb6?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/ecabc3f1-87b2-44a6-83bf-688e7e5f93df?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/94f4991a-7013-456c-8ba0-38071cf2bbb6","name":"94f4991a-7013-456c-8ba0-38071cf2bbb6","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Succeeded","startTime":"2021-05-19T11:48:51.4608474Z","endTime":"2021-05-19T11:49:02.72904Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/ecabc3f1-87b2-44a6-83bf-688e7e5f93df","name":"ecabc3f1-87b2-44a6-83bf-688e7e5f93df","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/azcli-test-virtual-machine","status":"Succeeded","startTime":"2021-05-20T08:42:50.4087278Z","endTime":"2021-05-20T08:43:12.2600329Z","properties":null}' headers: cache-control: - no-cache content-length: - - '478' + - '480' content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:49:22 GMT + - Thu, 20 May 2021 08:43:20 GMT etag: - - '"0200ee70-0000-3400-0000-60a4fb2e0000"' + - '"0300865b-0000-3400-0000-60a621200000"' expires: - '-1' pragma: @@ -1579,13 +1783,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:49:24 GMT + - Thu, 20 May 2021 08:43:24 GMT etag: - - '"0000ffa0-0000-3400-0000-60a4fb450000"' + - '"000096b2-0000-3400-0000-60a6212c0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/4f036c7b-c3a7-49ac-852b-6d31f22c65c4?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/50f428d4-efb7-4036-a275-b922ac9b1719?api-version=2020-10-01-preview pragma: - no-cache strict-transport-security: @@ -1615,10 +1819,10 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/4f036c7b-c3a7-49ac-852b-6d31f22c65c4?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/50f428d4-efb7-4036-a275-b922ac9b1719?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/4f036c7b-c3a7-49ac-852b-6d31f22c65c4","name":"4f036c7b-c3a7-49ac-852b-6d31f22c65c4","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","status":"Succeeded","startTime":"2021-05-19T11:49:25.3483896Z","endTime":"2021-05-19T11:49:26.3619763Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/50f428d4-efb7-4036-a275-b922ac9b1719","name":"50f428d4-efb7-4036-a275-b922ac9b1719","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/azcli-test-resource-pool","status":"Succeeded","startTime":"2021-05-20T08:43:24.1912596Z","endTime":"2021-05-20T08:43:26.7923187Z","properties":null}' headers: cache-control: - no-cache @@ -1627,9 +1831,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:49:55 GMT + - Thu, 20 May 2021 08:43:54 GMT etag: - - '"0200f070-0000-3400-0000-60a4fb460000"' + - '"03008a5b-0000-3400-0000-60a6212e0000"' expires: - '-1' pragma: @@ -1677,13 +1881,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:49:57 GMT + - Thu, 20 May 2021 08:43:56 GMT etag: - - '"02008f6f-0000-3400-0000-60a4fb660000"' + - '"0300733e-0000-3400-0000-60a6214d0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/db7f8ff8-2430-4735-874e-b52dca1fa654?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/be7feab0-a07b-4580-965f-ef7fc6248ff7?api-version=2020-10-01-preview pragma: - no-cache strict-transport-security: @@ -1713,10 +1917,10 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/db7f8ff8-2430-4735-874e-b52dca1fa654?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/be7feab0-a07b-4580-965f-ef7fc6248ff7?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/db7f8ff8-2430-4735-874e-b52dca1fa654","name":"db7f8ff8-2430-4735-874e-b52dca1fa654","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","status":"Succeeded","startTime":"2021-05-19T11:49:58.5550855Z","endTime":"2021-05-19T11:49:59.4345216Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/be7feab0-a07b-4580-965f-ef7fc6248ff7","name":"be7feab0-a07b-4580-965f-ef7fc6248ff7","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/azcli-test-virtual-network","status":"Succeeded","startTime":"2021-05-20T08:43:57.4834252Z","endTime":"2021-05-20T08:43:58.4731169Z","properties":null}' headers: cache-control: - no-cache @@ -1725,9 +1929,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:50:29 GMT + - Thu, 20 May 2021 08:44:27 GMT etag: - - '"0200f370-0000-3400-0000-60a4fb670000"' + - '"03008f5b-0000-3400-0000-60a6214e0000"' expires: - '-1' pragma: @@ -1775,13 +1979,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:50:30 GMT + - Thu, 20 May 2021 08:44:31 GMT etag: - - '"0000436a-0000-3400-0000-60a4fb870000"' + - '"00005185-0000-3400-0000-60a6216f0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/8365f60c-b98b-401e-bf44-310414a38cfb?api-version=2020-10-01-preview + - https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/8c693734-7fab-4d32-b9f2-c7a1d37c5163?api-version=2020-10-01-preview pragma: - no-cache strict-transport-security: @@ -1811,21 +2015,21 @@ interactions: User-Agent: - AZURECLI/2.23.0 azsdk-python-mgmt-connectedvmware/1.0.0b1 Python/3.8.5 (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/8365f60c-b98b-401e-bf44-310414a38cfb?api-version=2020-10-01-preview + uri: https://management.azure.com/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/8c693734-7fab-4d32-b9f2-c7a1d37c5163?api-version=2020-10-01-preview response: body: - string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/8365f60c-b98b-401e-bf44-310414a38cfb","name":"8365f60c-b98b-401e-bf44-310414a38cfb","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","status":"Succeeded","startTime":"2021-05-19T11:50:31.4216484Z","endTime":"2021-05-19T11:50:32.6556239Z","properties":null}' + string: '{"id":"/providers/Microsoft.ConnectedVMwarevSphere/locations/EASTUS2EUAP/operationStatuses/8c693734-7fab-4d32-b9f2-c7a1d37c5163","name":"8c693734-7fab-4d32-b9f2-c7a1d37c5163","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azcli-test-rg/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/azcli-test-vm-template","status":"Succeeded","startTime":"2021-05-20T08:44:31.107236Z","endTime":"2021-05-20T08:44:32.2300551Z","properties":null}' headers: cache-control: - no-cache content-length: - - '484' + - '483' content-type: - application/json; charset=utf-8 date: - - Wed, 19 May 2021 11:51:01 GMT + - Thu, 20 May 2021 08:45:01 GMT etag: - - '"0200f570-0000-3400-0000-60a4fb880000"' + - '"0300925b-0000-3400-0000-60a621700000"' expires: - '-1' pragma: diff --git a/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py b/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py index 2bf88dbcc5c..038aa3d59b9 100644 --- a/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py +++ b/src/connectedvmware/azext_connectedvmware/tests/latest/test_connectedvmware_scenario.py @@ -28,7 +28,9 @@ def test_connectedvmware(self): 'vnet_name': 'azcli-test-virtual-network', 'vmtpl_morefid': 'vm-55', 'vmtpl_name': 'azcli-test-vm-template', - 'vm_name': 'azcli-test-virtual-machine' + 'vm_name': 'azcli-test-virtual-machine', + 'nic_name': 'nic_1', + 'disk_name': 'disk_1' }) # Validate the show command output with vcenter name. @@ -98,6 +100,26 @@ def test_connectedvmware(self): # At this point there should be 1 vm resource. assert len(resource_list) >= 1 + # Validate vm nic name. + self.cmd('az connectedvmware vm nic show -g {rg} --vm-name {vm_name} --name {nic_name}', checks=[ + self.check('name', '{nic_name}'), + ]) + + # List the nic for the vm. + resource_list = self.cmd('az connectedvmware vm nic list -g {rg} --vm-name {vm_name}').get_output_in_json() + # At least 1 nic should be there for the vm resource. + assert len(resource_list) >= 1 + + # Validate vm disk name. + self.cmd('az connectedvmware vm disk show -g {rg} --vm-name {vm_name} --name {disk_name}', checks=[ + self.check('name', '{disk_name}'), + ]) + + # List the disk for the vm. + resource_list = self.cmd('az connectedvmware vm disk list -g {rg} --vm-name {vm_name}').get_output_in_json() + # At least 1 disk should be there for the vm resource. + assert len(resource_list) >= 1 + # Stop VM. self.cmd('az connectedvmware vm stop -g {rg} --name {vm_name}') From 9a5b410ab9202aeab422db3d69ae703ca500a9ef Mon Sep 17 00:00:00 2001 From: Santosh Mishra Date: Thu, 20 May 2021 23:33:46 +0530 Subject: [PATCH 13/13] Ignore Unused argument 'tags' warning. --- src/connectedvmware/azext_connectedvmware/_help.py | 4 ++-- src/connectedvmware/azext_connectedvmware/custom.py | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/connectedvmware/azext_connectedvmware/_help.py b/src/connectedvmware/azext_connectedvmware/_help.py index 11b5ce14b54..82755dac5d8 100644 --- a/src/connectedvmware/azext_connectedvmware/_help.py +++ b/src/connectedvmware/azext_connectedvmware/_help.py @@ -143,8 +143,8 @@ text: |- az connectedvmware virtual-network create --custom-location "custom location name" \ --location "region name" --mo-ref-id "mo-ref id of the resource in vc" --name \ - "virtual network name" --resource-group "resource group name" --vcenter \ - "name or id of the vcenter" --inventory-item "inventory item name or id" + "virtual network name" --resource-group "resource group name" --vcenter "name or id of \ + the vcenter" --inventory-item "inventory item name or id" """ helps[ diff --git a/src/connectedvmware/azext_connectedvmware/custom.py b/src/connectedvmware/azext_connectedvmware/custom.py index 1debcddd0d4..dcebfed6571 100644 --- a/src/connectedvmware/azext_connectedvmware/custom.py +++ b/src/connectedvmware/azext_connectedvmware/custom.py @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -# pylint: disable= too-many-lines +# pylint: disable= too-many-lines, too-many-locals, unused-argument from knack.util import CLIError from azext_connectedvmware.vmware_utils import get_resource_id @@ -86,6 +86,7 @@ def connect_vcenter( username=None, password=None, port=DEFAULT_VCENTER_PORT, + tags=None, no_wait=False, ): @@ -159,6 +160,7 @@ def create_resource_pool( vcenter=None, mo_ref_id=None, inventory_item=None, + tags=None, no_wait=False, ): @@ -261,6 +263,7 @@ def create_virtual_network( vcenter=None, mo_ref_id=None, inventory_item=None, + tags=None, no_wait=False, ): @@ -369,6 +372,7 @@ def create_vm_template( vcenter=None, mo_ref_id=None, inventory_item=None, + tags=None, no_wait=True, ): @@ -462,7 +466,6 @@ def list_vm_template( # region VirtualMachines -# pylint: disable=R0914 def create_vm( cmd, client: VirtualMachinesOperations, @@ -481,6 +484,7 @@ def create_vm( memory_size=None, nics=None, disks=None, + tags=None, no_wait=False, ): @@ -1244,3 +1248,6 @@ def list_inventory_item( ): return client.list_by_v_center(resource_group_name, vcenter_name) + + +# endregion