From 3beef870b61221e246f87f0c3924cd451d12ac8e Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 17 Nov 2020 03:31:21 +0000 Subject: [PATCH] CodeGen from PR 11697 in Azure/azure-rest-api-specs Merge 9c65433d1cce65fe87ac6316738a21353b2911e3 into acefbba01f5c2011ea849f781d8742b181a0d43b --- .../compute/_compute_management_client.py | 96 +- .../compute/aio/_compute_management_client.py | 96 +- .../azure/mgmt/compute/models.py | 2 +- .../v2015_06_15/_compute_management_client.py | 1 - .../mgmt/compute/v2015_06_15/_metadata.json | 15 +- .../aio/_compute_management_client.py | 1 - .../_availability_sets_operations.py | 26 +- .../aio/operations/_usage_operations.py | 8 +- ...ual_machine_extension_images_operations.py | 16 +- .../_virtual_machine_extensions_operations.py | 67 +- .../_virtual_machine_images_operations.py | 24 +- ...irtual_machine_scale_set_vms_operations.py | 118 +- .../_virtual_machine_scale_sets_operations.py | 196 +- .../_virtual_machine_sizes_operations.py | 8 +- .../_virtual_machines_operations.py | 160 +- .../_availability_sets_operations.py | 26 +- .../operations/_usage_operations.py | 8 +- ...ual_machine_extension_images_operations.py | 16 +- .../_virtual_machine_extensions_operations.py | 67 +- .../_virtual_machine_images_operations.py | 24 +- ...irtual_machine_scale_set_vms_operations.py | 118 +- .../_virtual_machine_scale_sets_operations.py | 196 +- .../_virtual_machine_sizes_operations.py | 8 +- .../_virtual_machines_operations.py | 160 +- .../v2016_03_30/_compute_management_client.py | 1 - .../mgmt/compute/v2016_03_30/_metadata.json | 15 +- .../aio/_compute_management_client.py | 1 - .../_availability_sets_operations.py | 30 +- .../aio/operations/_usage_operations.py | 8 +- ...ual_machine_extension_images_operations.py | 16 +- .../_virtual_machine_extensions_operations.py | 67 +- .../_virtual_machine_images_operations.py | 24 +- ...irtual_machine_scale_set_vms_operations.py | 118 +- .../_virtual_machine_scale_sets_operations.py | 196 +- .../_virtual_machine_sizes_operations.py | 8 +- .../_virtual_machines_operations.py | 164 +- .../_availability_sets_operations.py | 30 +- .../operations/_usage_operations.py | 8 +- ...ual_machine_extension_images_operations.py | 16 +- .../_virtual_machine_extensions_operations.py | 67 +- .../_virtual_machine_images_operations.py | 24 +- ...irtual_machine_scale_set_vms_operations.py | 118 +- .../_virtual_machine_scale_sets_operations.py | 196 +- .../_virtual_machine_sizes_operations.py | 8 +- .../_virtual_machines_operations.py | 164 +- .../_compute_management_client.py | 1 - .../v2016_04_30_preview/_metadata.json | 15 +- .../aio/_compute_management_client.py | 1 - .../_availability_sets_operations.py | 30 +- .../aio/operations/_disks_operations.py | 108 +- .../aio/operations/_images_operations.py | 52 +- .../aio/operations/_snapshots_operations.py | 108 +- .../aio/operations/_usage_operations.py | 8 +- ...ual_machine_extension_images_operations.py | 16 +- .../_virtual_machine_extensions_operations.py | 67 +- .../_virtual_machine_images_operations.py | 24 +- ...irtual_machine_scale_set_vms_operations.py | 135 +- .../_virtual_machine_scale_sets_operations.py | 212 +- .../_virtual_machine_sizes_operations.py | 8 +- .../_virtual_machines_operations.py | 180 +- .../_availability_sets_operations.py | 30 +- .../operations/_disks_operations.py | 108 +- .../operations/_images_operations.py | 52 +- .../operations/_snapshots_operations.py | 108 +- .../operations/_usage_operations.py | 8 +- ...ual_machine_extension_images_operations.py | 16 +- .../_virtual_machine_extensions_operations.py | 67 +- .../_virtual_machine_images_operations.py | 24 +- ...irtual_machine_scale_set_vms_operations.py | 135 +- .../_virtual_machine_scale_sets_operations.py | 212 +- .../_virtual_machine_sizes_operations.py | 8 +- .../_virtual_machines_operations.py | 180 +- .../v2017_03_30/_compute_management_client.py | 1 - .../mgmt/compute/v2017_03_30/_metadata.json | 15 +- .../aio/_compute_management_client.py | 1 - .../_availability_sets_operations.py | 30 +- .../aio/operations/_disks_operations.py | 108 +- .../aio/operations/_images_operations.py | 52 +- .../operations/_resource_skus_operations.py | 8 +- .../aio/operations/_snapshots_operations.py | 108 +- .../aio/operations/_usage_operations.py | 8 +- ...ual_machine_extension_images_operations.py | 16 +- .../_virtual_machine_extensions_operations.py | 67 +- .../_virtual_machine_images_operations.py | 24 +- ...virtual_machine_run_commands_operations.py | 12 +- ...machine_scale_set_extensions_operations.py | 50 +- ...e_scale_set_rolling_upgrades_operations.py | 40 +- ...irtual_machine_scale_set_vms_operations.py | 135 +- .../_virtual_machine_scale_sets_operations.py | 240 +- .../_virtual_machine_sizes_operations.py | 8 +- .../_virtual_machines_operations.py | 224 +- .../_availability_sets_operations.py | 30 +- .../operations/_disks_operations.py | 108 +- .../operations/_images_operations.py | 52 +- .../operations/_resource_skus_operations.py | 8 +- .../operations/_snapshots_operations.py | 108 +- .../operations/_usage_operations.py | 8 +- ...ual_machine_extension_images_operations.py | 16 +- .../_virtual_machine_extensions_operations.py | 67 +- .../_virtual_machine_images_operations.py | 24 +- ...virtual_machine_run_commands_operations.py | 12 +- ...machine_scale_set_extensions_operations.py | 50 +- ...e_scale_set_rolling_upgrades_operations.py | 40 +- ...irtual_machine_scale_set_vms_operations.py | 135 +- .../_virtual_machine_scale_sets_operations.py | 240 +- .../_virtual_machine_sizes_operations.py | 8 +- .../_virtual_machines_operations.py | 224 +- .../v2017_09_01/_compute_management_client.py | 1 - .../mgmt/compute/v2017_09_01/_metadata.json | 15 +- .../aio/_compute_management_client.py | 1 - .../operations/_resource_skus_operations.py | 8 +- .../operations/_resource_skus_operations.py | 8 +- .../v2017_12_01/_compute_management_client.py | 1 - .../mgmt/compute/v2017_12_01/_metadata.json | 15 +- .../aio/_compute_management_client.py | 1 - .../_availability_sets_operations.py | 36 +- .../aio/operations/_images_operations.py | 72 +- .../operations/_log_analytics_operations.py | 42 +- .../v2017_12_01/aio/operations/_operations.py | 8 +- .../aio/operations/_usage_operations.py | 8 +- ...ual_machine_extension_images_operations.py | 16 +- .../_virtual_machine_extensions_operations.py | 67 +- .../_virtual_machine_images_operations.py | 24 +- ...virtual_machine_run_commands_operations.py | 12 +- ...machine_scale_set_extensions_operations.py | 50 +- ...e_scale_set_rolling_upgrades_operations.py | 40 +- ...irtual_machine_scale_set_vms_operations.py | 190 +- .../_virtual_machine_scale_sets_operations.py | 288 +- .../_virtual_machine_sizes_operations.py | 8 +- .../_virtual_machines_operations.py | 244 +- .../_availability_sets_operations.py | 36 +- .../operations/_images_operations.py | 72 +- .../operations/_log_analytics_operations.py | 42 +- .../v2017_12_01/operations/_operations.py | 8 +- .../operations/_usage_operations.py | 8 +- ...ual_machine_extension_images_operations.py | 16 +- .../_virtual_machine_extensions_operations.py | 67 +- .../_virtual_machine_images_operations.py | 24 +- ...virtual_machine_run_commands_operations.py | 12 +- ...machine_scale_set_extensions_operations.py | 50 +- ...e_scale_set_rolling_upgrades_operations.py | 40 +- ...irtual_machine_scale_set_vms_operations.py | 190 +- .../_virtual_machine_scale_sets_operations.py | 288 +- .../_virtual_machine_sizes_operations.py | 8 +- .../_virtual_machines_operations.py | 244 +- .../v2018_04_01/_compute_management_client.py | 1 - .../mgmt/compute/v2018_04_01/_metadata.json | 15 +- .../aio/_compute_management_client.py | 1 - .../_availability_sets_operations.py | 32 +- .../aio/operations/_disks_operations.py | 92 +- .../aio/operations/_images_operations.py | 64 +- .../operations/_log_analytics_operations.py | 42 +- .../v2018_04_01/aio/operations/_operations.py | 8 +- .../_proximity_placement_groups_operations.py | 28 +- .../aio/operations/_snapshots_operations.py | 92 +- .../aio/operations/_usage_operations.py | 8 +- ...ual_machine_extension_images_operations.py | 16 +- .../_virtual_machine_extensions_operations.py | 63 +- .../_virtual_machine_images_operations.py | 24 +- ...virtual_machine_run_commands_operations.py | 12 +- ...machine_scale_set_extensions_operations.py | 42 +- ...e_scale_set_rolling_upgrades_operations.py | 24 +- ...irtual_machine_scale_set_vms_operations.py | 139 +- .../_virtual_machine_scale_sets_operations.py | 200 +- .../_virtual_machine_sizes_operations.py | 8 +- .../_virtual_machines_operations.py | 172 +- .../_availability_sets_operations.py | 32 +- .../operations/_disks_operations.py | 92 +- .../operations/_images_operations.py | 64 +- .../operations/_log_analytics_operations.py | 42 +- .../v2018_04_01/operations/_operations.py | 8 +- .../_proximity_placement_groups_operations.py | 28 +- .../operations/_snapshots_operations.py | 92 +- .../operations/_usage_operations.py | 8 +- ...ual_machine_extension_images_operations.py | 16 +- .../_virtual_machine_extensions_operations.py | 63 +- .../_virtual_machine_images_operations.py | 24 +- ...virtual_machine_run_commands_operations.py | 12 +- ...machine_scale_set_extensions_operations.py | 42 +- ...e_scale_set_rolling_upgrades_operations.py | 24 +- ...irtual_machine_scale_set_vms_operations.py | 139 +- .../_virtual_machine_scale_sets_operations.py | 200 +- .../_virtual_machine_sizes_operations.py | 8 +- .../_virtual_machines_operations.py | 172 +- .../v2018_06_01/_compute_management_client.py | 1 - .../mgmt/compute/v2018_06_01/_metadata.json | 15 +- .../aio/_compute_management_client.py | 1 - .../_availability_sets_operations.py | 32 +- .../aio/operations/_disks_operations.py | 92 +- .../aio/operations/_galleries_operations.py | 44 +- .../_gallery_image_versions_operations.py | 46 +- .../operations/_gallery_images_operations.py | 42 +- .../aio/operations/_images_operations.py | 64 +- .../operations/_log_analytics_operations.py | 42 +- .../v2018_06_01/aio/operations/_operations.py | 8 +- .../_proximity_placement_groups_operations.py | 28 +- .../aio/operations/_snapshots_operations.py | 92 +- .../aio/operations/_usage_operations.py | 8 +- ...ual_machine_extension_images_operations.py | 16 +- .../_virtual_machine_extensions_operations.py | 63 +- .../_virtual_machine_images_operations.py | 24 +- ...virtual_machine_run_commands_operations.py | 12 +- ...machine_scale_set_extensions_operations.py | 42 +- ...e_scale_set_rolling_upgrades_operations.py | 32 +- ...irtual_machine_scale_set_vms_operations.py | 143 +- .../_virtual_machine_scale_sets_operations.py | 200 +- .../_virtual_machine_sizes_operations.py | 8 +- .../_virtual_machines_operations.py | 184 +- .../compute/v2018_06_01/models/__init__.py | 12 +- .../compute/v2018_06_01/models/_models.py | 128 +- .../compute/v2018_06_01/models/_models_py3.py | 132 +- .../_availability_sets_operations.py | 32 +- .../operations/_disks_operations.py | 92 +- .../operations/_galleries_operations.py | 44 +- .../_gallery_image_versions_operations.py | 46 +- .../operations/_gallery_images_operations.py | 42 +- .../operations/_images_operations.py | 64 +- .../operations/_log_analytics_operations.py | 42 +- .../v2018_06_01/operations/_operations.py | 8 +- .../_proximity_placement_groups_operations.py | 28 +- .../operations/_snapshots_operations.py | 92 +- .../operations/_usage_operations.py | 8 +- ...ual_machine_extension_images_operations.py | 16 +- .../_virtual_machine_extensions_operations.py | 63 +- .../_virtual_machine_images_operations.py | 24 +- ...virtual_machine_run_commands_operations.py | 12 +- ...machine_scale_set_extensions_operations.py | 42 +- ...e_scale_set_rolling_upgrades_operations.py | 32 +- ...irtual_machine_scale_set_vms_operations.py | 143 +- .../_virtual_machine_scale_sets_operations.py | 200 +- .../_virtual_machine_sizes_operations.py | 8 +- .../_virtual_machines_operations.py | 184 +- .../v2018_09_30/_compute_management_client.py | 1 - .../mgmt/compute/v2018_09_30/_metadata.json | 15 +- .../aio/_compute_management_client.py | 1 - .../aio/operations/_disks_operations.py | 92 +- .../aio/operations/_snapshots_operations.py | 92 +- .../operations/_disks_operations.py | 92 +- .../operations/_snapshots_operations.py | 92 +- .../v2018_10_01/_compute_management_client.py | 1 - .../mgmt/compute/v2018_10_01/_metadata.json | 15 +- .../aio/_compute_management_client.py | 1 - .../_availability_sets_operations.py | 32 +- .../aio/operations/_images_operations.py | 64 +- .../operations/_log_analytics_operations.py | 42 +- .../v2018_10_01/aio/operations/_operations.py | 8 +- .../_proximity_placement_groups_operations.py | 28 +- .../aio/operations/_usage_operations.py | 8 +- ...ual_machine_extension_images_operations.py | 16 +- .../_virtual_machine_extensions_operations.py | 63 +- .../_virtual_machine_images_operations.py | 24 +- ...virtual_machine_run_commands_operations.py | 12 +- ...machine_scale_set_extensions_operations.py | 42 +- ...e_scale_set_rolling_upgrades_operations.py | 32 +- ...irtual_machine_scale_set_vms_operations.py | 143 +- .../_virtual_machine_scale_sets_operations.py | 200 +- .../_virtual_machine_sizes_operations.py | 8 +- .../_virtual_machines_operations.py | 184 +- .../compute/v2018_10_01/models/__init__.py | 12 +- .../compute/v2018_10_01/models/_models.py | 128 +- .../compute/v2018_10_01/models/_models_py3.py | 132 +- .../_availability_sets_operations.py | 32 +- .../operations/_images_operations.py | 64 +- .../operations/_log_analytics_operations.py | 42 +- .../v2018_10_01/operations/_operations.py | 8 +- .../_proximity_placement_groups_operations.py | 28 +- .../operations/_usage_operations.py | 8 +- ...ual_machine_extension_images_operations.py | 16 +- .../_virtual_machine_extensions_operations.py | 63 +- .../_virtual_machine_images_operations.py | 24 +- ...virtual_machine_run_commands_operations.py | 12 +- ...machine_scale_set_extensions_operations.py | 42 +- ...e_scale_set_rolling_upgrades_operations.py | 32 +- ...irtual_machine_scale_set_vms_operations.py | 143 +- .../_virtual_machine_scale_sets_operations.py | 200 +- .../_virtual_machine_sizes_operations.py | 8 +- .../_virtual_machines_operations.py | 184 +- .../v2019_03_01/_compute_management_client.py | 1 - .../mgmt/compute/v2019_03_01/_metadata.json | 15 +- .../aio/_compute_management_client.py | 1 - .../_availability_sets_operations.py | 32 +- .../_dedicated_host_groups_operations.py | 28 +- .../operations/_dedicated_hosts_operations.py | 63 +- .../aio/operations/_disks_operations.py | 92 +- .../aio/operations/_galleries_operations.py | 44 +- ...gallery_application_versions_operations.py | 46 +- .../_gallery_applications_operations.py | 42 +- .../_gallery_image_versions_operations.py | 46 +- .../operations/_gallery_images_operations.py | 42 +- .../aio/operations/_images_operations.py | 64 +- .../operations/_log_analytics_operations.py | 42 +- .../v2019_03_01/aio/operations/_operations.py | 8 +- .../_proximity_placement_groups_operations.py | 28 +- .../aio/operations/_snapshots_operations.py | 92 +- .../aio/operations/_usage_operations.py | 8 +- ...ual_machine_extension_images_operations.py | 16 +- .../_virtual_machine_extensions_operations.py | 63 +- .../_virtual_machine_images_operations.py | 24 +- ...virtual_machine_run_commands_operations.py | 12 +- ...machine_scale_set_extensions_operations.py | 42 +- ...e_scale_set_rolling_upgrades_operations.py | 32 +- ...irtual_machine_scale_set_vms_operations.py | 143 +- .../_virtual_machine_scale_sets_operations.py | 204 +- .../_virtual_machine_sizes_operations.py | 8 +- .../_virtual_machines_operations.py | 184 +- .../compute/v2019_03_01/models/__init__.py | 12 +- .../compute/v2019_03_01/models/_models.py | 128 +- .../compute/v2019_03_01/models/_models_py3.py | 132 +- .../_availability_sets_operations.py | 32 +- .../_dedicated_host_groups_operations.py | 28 +- .../operations/_dedicated_hosts_operations.py | 63 +- .../operations/_disks_operations.py | 92 +- .../operations/_galleries_operations.py | 44 +- ...gallery_application_versions_operations.py | 46 +- .../_gallery_applications_operations.py | 42 +- .../_gallery_image_versions_operations.py | 46 +- .../operations/_gallery_images_operations.py | 42 +- .../operations/_images_operations.py | 64 +- .../operations/_log_analytics_operations.py | 42 +- .../v2019_03_01/operations/_operations.py | 8 +- .../_proximity_placement_groups_operations.py | 28 +- .../operations/_snapshots_operations.py | 92 +- .../operations/_usage_operations.py | 8 +- ...ual_machine_extension_images_operations.py | 16 +- .../_virtual_machine_extensions_operations.py | 63 +- .../_virtual_machine_images_operations.py | 24 +- ...virtual_machine_run_commands_operations.py | 12 +- ...machine_scale_set_extensions_operations.py | 42 +- ...e_scale_set_rolling_upgrades_operations.py | 32 +- ...irtual_machine_scale_set_vms_operations.py | 143 +- .../_virtual_machine_scale_sets_operations.py | 204 +- .../_virtual_machine_sizes_operations.py | 8 +- .../_virtual_machines_operations.py | 184 +- .../v2019_04_01/_compute_management_client.py | 1 - .../mgmt/compute/v2019_04_01/_metadata.json | 15 +- .../aio/_compute_management_client.py | 1 - .../operations/_resource_skus_operations.py | 8 +- .../operations/_resource_skus_operations.py | 8 +- .../v2019_07_01/_compute_management_client.py | 1 - .../mgmt/compute/v2019_07_01/_metadata.json | 15 +- .../aio/_compute_management_client.py | 1 - .../_availability_sets_operations.py | 32 +- .../_dedicated_host_groups_operations.py | 28 +- .../operations/_dedicated_hosts_operations.py | 63 +- .../_disk_encryption_sets_operations.py | 64 +- .../aio/operations/_disks_operations.py | 92 +- .../aio/operations/_galleries_operations.py | 64 +- ...gallery_application_versions_operations.py | 68 +- .../_gallery_applications_operations.py | 63 +- .../_gallery_image_versions_operations.py | 68 +- .../operations/_gallery_images_operations.py | 63 +- .../aio/operations/_images_operations.py | 64 +- .../operations/_log_analytics_operations.py | 42 +- .../v2019_07_01/aio/operations/_operations.py | 8 +- .../_proximity_placement_groups_operations.py | 28 +- .../aio/operations/_snapshots_operations.py | 92 +- .../aio/operations/_usage_operations.py | 8 +- ...ual_machine_extension_images_operations.py | 16 +- .../_virtual_machine_extensions_operations.py | 63 +- .../_virtual_machine_images_operations.py | 24 +- ...virtual_machine_run_commands_operations.py | 12 +- ...machine_scale_set_extensions_operations.py | 63 +- ...e_scale_set_rolling_upgrades_operations.py | 32 +- ...hine_scale_set_vm_extensions_operations.py | 66 +- ...irtual_machine_scale_set_vms_operations.py | 146 +- .../_virtual_machine_scale_sets_operations.py | 204 +- .../_virtual_machine_sizes_operations.py | 8 +- .../_virtual_machines_operations.py | 202 +- .../compute/v2019_07_01/models/__init__.py | 12 +- .../compute/v2019_07_01/models/_models.py | 128 +- .../compute/v2019_07_01/models/_models_py3.py | 132 +- .../_availability_sets_operations.py | 32 +- .../_dedicated_host_groups_operations.py | 28 +- .../operations/_dedicated_hosts_operations.py | 63 +- .../_disk_encryption_sets_operations.py | 64 +- .../operations/_disks_operations.py | 92 +- .../operations/_galleries_operations.py | 64 +- ...gallery_application_versions_operations.py | 68 +- .../_gallery_applications_operations.py | 63 +- .../_gallery_image_versions_operations.py | 68 +- .../operations/_gallery_images_operations.py | 63 +- .../operations/_images_operations.py | 64 +- .../operations/_log_analytics_operations.py | 42 +- .../v2019_07_01/operations/_operations.py | 8 +- .../_proximity_placement_groups_operations.py | 28 +- .../operations/_snapshots_operations.py | 92 +- .../operations/_usage_operations.py | 8 +- ...ual_machine_extension_images_operations.py | 16 +- .../_virtual_machine_extensions_operations.py | 63 +- .../_virtual_machine_images_operations.py | 24 +- ...virtual_machine_run_commands_operations.py | 12 +- ...machine_scale_set_extensions_operations.py | 63 +- ...e_scale_set_rolling_upgrades_operations.py | 32 +- ...hine_scale_set_vm_extensions_operations.py | 66 +- ...irtual_machine_scale_set_vms_operations.py | 146 +- .../_virtual_machine_scale_sets_operations.py | 204 +- .../_virtual_machine_sizes_operations.py | 8 +- .../_virtual_machines_operations.py | 202 +- .../v2019_11_01/_compute_management_client.py | 1 - .../mgmt/compute/v2019_11_01/_metadata.json | 15 +- .../aio/_compute_management_client.py | 1 - .../_disk_encryption_sets_operations.py | 64 +- .../aio/operations/_disks_operations.py | 92 +- .../aio/operations/_snapshots_operations.py | 92 +- .../_disk_encryption_sets_operations.py | 64 +- .../operations/_disks_operations.py | 92 +- .../operations/_snapshots_operations.py | 92 +- .../v2019_12_01/_compute_management_client.py | 1 - .../mgmt/compute/v2019_12_01/_metadata.json | 15 +- .../aio/_compute_management_client.py | 1 - .../_availability_sets_operations.py | 32 +- .../_dedicated_host_groups_operations.py | 28 +- .../operations/_dedicated_hosts_operations.py | 63 +- .../aio/operations/_galleries_operations.py | 64 +- ...gallery_application_versions_operations.py | 68 +- .../_gallery_applications_operations.py | 63 +- .../_gallery_image_versions_operations.py | 68 +- .../operations/_gallery_images_operations.py | 63 +- .../aio/operations/_images_operations.py | 64 +- .../operations/_log_analytics_operations.py | 42 +- .../v2019_12_01/aio/operations/_operations.py | 8 +- .../_proximity_placement_groups_operations.py | 28 +- .../operations/_ssh_public_keys_operations.py | 32 +- .../aio/operations/_usage_operations.py | 8 +- ...ual_machine_extension_images_operations.py | 16 +- .../_virtual_machine_extensions_operations.py | 63 +- .../_virtual_machine_images_operations.py | 24 +- ...virtual_machine_run_commands_operations.py | 12 +- ...machine_scale_set_extensions_operations.py | 63 +- ...e_scale_set_rolling_upgrades_operations.py | 32 +- ...hine_scale_set_vm_extensions_operations.py | 66 +- ...irtual_machine_scale_set_vms_operations.py | 146 +- .../_virtual_machine_scale_sets_operations.py | 216 +- .../_virtual_machine_sizes_operations.py | 8 +- .../_virtual_machines_operations.py | 202 +- .../compute/v2019_12_01/models/__init__.py | 12 +- .../compute/v2019_12_01/models/_models.py | 128 +- .../compute/v2019_12_01/models/_models_py3.py | 132 +- .../_availability_sets_operations.py | 32 +- .../_dedicated_host_groups_operations.py | 28 +- .../operations/_dedicated_hosts_operations.py | 63 +- .../operations/_galleries_operations.py | 64 +- ...gallery_application_versions_operations.py | 68 +- .../_gallery_applications_operations.py | 63 +- .../_gallery_image_versions_operations.py | 68 +- .../operations/_gallery_images_operations.py | 63 +- .../operations/_images_operations.py | 64 +- .../operations/_log_analytics_operations.py | 42 +- .../v2019_12_01/operations/_operations.py | 8 +- .../_proximity_placement_groups_operations.py | 28 +- .../operations/_ssh_public_keys_operations.py | 32 +- .../operations/_usage_operations.py | 8 +- ...ual_machine_extension_images_operations.py | 16 +- .../_virtual_machine_extensions_operations.py | 63 +- .../_virtual_machine_images_operations.py | 24 +- ...virtual_machine_run_commands_operations.py | 12 +- ...machine_scale_set_extensions_operations.py | 63 +- ...e_scale_set_rolling_upgrades_operations.py | 32 +- ...hine_scale_set_vm_extensions_operations.py | 66 +- ...irtual_machine_scale_set_vms_operations.py | 146 +- .../_virtual_machine_scale_sets_operations.py | 216 +- .../_virtual_machine_sizes_operations.py | 8 +- .../_virtual_machines_operations.py | 202 +- .../v2020_05_01/_compute_management_client.py | 1 - .../mgmt/compute/v2020_05_01/_metadata.json | 15 +- .../aio/_compute_management_client.py | 1 - .../operations/_disk_accesses_operations.py | 68 +- .../_disk_encryption_sets_operations.py | 64 +- .../aio/operations/_disks_operations.py | 92 +- .../aio/operations/_snapshots_operations.py | 92 +- .../operations/_disk_accesses_operations.py | 68 +- .../_disk_encryption_sets_operations.py | 64 +- .../operations/_disks_operations.py | 92 +- .../operations/_snapshots_operations.py | 92 +- .../v2020_06_01/_compute_management_client.py | 6 +- .../mgmt/compute/v2020_06_01/_metadata.json | 18 +- .../aio/_compute_management_client.py | 6 +- .../v2020_06_01/aio/operations/__init__.py | 2 + .../_availability_sets_operations.py | 32 +- .../_dedicated_host_groups_operations.py | 28 +- .../operations/_dedicated_hosts_operations.py | 63 +- .../aio/operations/_images_operations.py | 64 +- .../operations/_log_analytics_operations.py | 42 +- .../v2020_06_01/aio/operations/_operations.py | 8 +- .../_proximity_placement_groups_operations.py | 28 +- .../operations/_ssh_public_keys_operations.py | 32 +- .../aio/operations/_usage_operations.py | 8 +- ...ual_machine_extension_images_operations.py | 16 +- .../_virtual_machine_extensions_operations.py | 63 +- .../_virtual_machine_images_operations.py | 24 +- ...virtual_machine_run_commands_operations.py | 544 +++- ...machine_scale_set_extensions_operations.py | 63 +- ...e_scale_set_rolling_upgrades_operations.py | 32 +- ...hine_scale_set_vm_extensions_operations.py | 104 +- ...ne_scale_set_vm_run_commands_operations.py | 600 ++++ ...irtual_machine_scale_set_vms_operations.py | 147 +- .../_virtual_machine_scale_sets_operations.py | 214 +- .../_virtual_machine_sizes_operations.py | 8 +- .../_virtual_machines_operations.py | 219 +- .../compute/v2020_06_01/models/__init__.py | 38 +- .../_compute_management_client_enums.py | 12 + .../compute/v2020_06_01/models/_models.py | 648 ++++- .../compute/v2020_06_01/models/_models_py3.py | 712 ++++- .../v2020_06_01/operations/__init__.py | 2 + .../_availability_sets_operations.py | 32 +- .../_dedicated_host_groups_operations.py | 28 +- .../operations/_dedicated_hosts_operations.py | 63 +- .../operations/_images_operations.py | 64 +- .../operations/_log_analytics_operations.py | 42 +- .../v2020_06_01/operations/_operations.py | 8 +- .../_proximity_placement_groups_operations.py | 28 +- .../operations/_ssh_public_keys_operations.py | 32 +- .../operations/_usage_operations.py | 8 +- ...ual_machine_extension_images_operations.py | 16 +- .../_virtual_machine_extensions_operations.py | 63 +- .../_virtual_machine_images_operations.py | 24 +- ...virtual_machine_run_commands_operations.py | 552 +++- ...machine_scale_set_extensions_operations.py | 63 +- ...e_scale_set_rolling_upgrades_operations.py | 32 +- ...hine_scale_set_vm_extensions_operations.py | 104 +- ...ne_scale_set_vm_run_commands_operations.py | 612 ++++ ...irtual_machine_scale_set_vms_operations.py | 147 +- .../_virtual_machine_scale_sets_operations.py | 214 +- .../_virtual_machine_sizes_operations.py | 8 +- .../_virtual_machines_operations.py | 219 +- .../v2020_06_30/_compute_management_client.py | 1 - .../mgmt/compute/v2020_06_30/_metadata.json | 15 +- .../aio/_compute_management_client.py | 1 - .../operations/_disk_accesses_operations.py | 68 +- .../_disk_encryption_sets_operations.py | 68 +- .../aio/operations/_disks_operations.py | 92 +- .../aio/operations/_snapshots_operations.py | 92 +- .../operations/_disk_accesses_operations.py | 68 +- .../_disk_encryption_sets_operations.py | 68 +- .../operations/_disks_operations.py | 92 +- .../operations/_snapshots_operations.py | 92 +- .../mgmt/compute/v2020_09_30/__init__.py | 16 + .../v2020_09_30/_compute_management_client.py | 109 + .../compute/v2020_09_30/_configuration.py | 70 + .../mgmt/compute/v2020_09_30/_metadata.json | 69 + .../mgmt/compute/v2020_09_30/aio/__init__.py | 10 + .../aio/_compute_management_client.py | 103 + .../compute/v2020_09_30/aio/_configuration.py | 66 + .../v2020_09_30/aio/operations/__init__.py | 29 + .../aio/operations/_galleries_operations.py | 608 ++++ ...gallery_application_versions_operations.py | 618 +++++ .../_gallery_applications_operations.py | 575 ++++ .../_gallery_image_versions_operations.py | 616 +++++ .../operations/_gallery_images_operations.py | 573 ++++ .../_gallery_sharing_profile_operations.py | 171 ++ .../_shared_galleries_operations.py | 176 ++ ...hared_gallery_image_versions_operations.py | 197 ++ .../_shared_gallery_images_operations.py | 185 ++ .../compute/v2020_09_30/models/__init__.py | 221 ++ .../_compute_management_client_enums.py | 169 ++ .../compute/v2020_09_30/models/_models.py | 2229 +++++++++++++++ .../compute/v2020_09_30/models/_models_py3.py | 2461 +++++++++++++++++ .../v2020_09_30/operations/__init__.py | 29 + .../operations/_galleries_operations.py | 621 +++++ ...gallery_application_versions_operations.py | 630 +++++ .../_gallery_applications_operations.py | 587 ++++ .../_gallery_image_versions_operations.py | 628 +++++ .../operations/_gallery_images_operations.py | 585 ++++ .../_gallery_sharing_profile_operations.py | 177 ++ .../_shared_galleries_operations.py | 182 ++ ...hared_gallery_image_versions_operations.py | 203 ++ .../_shared_gallery_images_operations.py | 191 ++ .../azure/mgmt/compute/v2020_09_30/py.typed | 1 + 568 files changed, 36618 insertions(+), 11036 deletions(-) create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/__init__.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_compute_management_client.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_configuration.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_metadata.json create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/__init__.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/_compute_management_client.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/_configuration.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/__init__.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_galleries_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_application_versions_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_applications_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_image_versions_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_images_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_sharing_profile_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_galleries_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_gallery_image_versions_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_gallery_images_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/__init__.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/_compute_management_client_enums.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/_models.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/_models_py3.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/__init__.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_galleries_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_application_versions_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_applications_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_image_versions_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_images_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_sharing_profile_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_galleries_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_gallery_image_versions_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_gallery_images_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/py.typed diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_compute_management_client.py index fee8b630091a..f629708b1e47 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_compute_management_client.py @@ -46,7 +46,7 @@ class ComputeManagementClient(MultiApiClientMixin, _SDKClient): :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2020-06-30' + DEFAULT_API_VERSION = '2020-09-30' _PROFILE_TAG = "azure.mgmt.compute.ComputeManagementClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -54,16 +54,15 @@ class ComputeManagementClient(MultiApiClientMixin, _SDKClient): 'availability_sets': '2020-06-01', 'dedicated_host_groups': '2020-06-01', 'dedicated_hosts': '2020-06-01', - 'galleries': '2019-12-01', - 'gallery_application_versions': '2019-12-01', - 'gallery_applications': '2019-12-01', - 'gallery_image_versions': '2019-12-01', - 'gallery_images': '2019-12-01', + 'disk_accesses': '2020-06-30', + 'disk_encryption_sets': '2020-06-30', + 'disks': '2020-06-30', 'images': '2020-06-01', 'log_analytics': '2020-06-01', 'operations': '2020-06-01', 'proximity_placement_groups': '2020-06-01', 'resource_skus': '2019-04-01', + 'snapshots': '2020-06-30', 'ssh_public_keys': '2020-06-01', 'usage': '2020-06-01', 'virtual_machine_extension_images': '2020-06-01', @@ -73,6 +72,7 @@ class ComputeManagementClient(MultiApiClientMixin, _SDKClient): 'virtual_machine_scale_set_extensions': '2020-06-01', 'virtual_machine_scale_set_rolling_upgrades': '2020-06-01', 'virtual_machine_scale_set_vm_extensions': '2020-06-01', + 'virtual_machine_scale_set_vm_run_commands': '2020-06-01', 'virtual_machine_scale_set_vms': '2020-06-01', 'virtual_machine_scale_sets': '2020-06-01', 'virtual_machine_sizes': '2020-06-01', @@ -125,6 +125,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2020-05-01: :mod:`v2020_05_01.models` * 2020-06-01: :mod:`v2020_06_01.models` * 2020-06-30: :mod:`v2020_06_30.models` + * 2020-09-30: :mod:`v2020_09_30.models` """ if api_version == '2015-06-15': from .v2015_06_15 import models @@ -180,6 +181,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2020-06-30': from .v2020_06_30 import models return models + elif api_version == '2020-09-30': + from .v2020_09_30 import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -358,6 +362,7 @@ def galleries(self): * 2019-03-01: :class:`GalleriesOperations` * 2019-07-01: :class:`GalleriesOperations` * 2019-12-01: :class:`GalleriesOperations` + * 2020-09-30: :class:`GalleriesOperations` """ api_version = self._get_api_version('galleries') if api_version == '2018-06-01': @@ -368,6 +373,8 @@ def galleries(self): from .v2019_07_01.operations import GalleriesOperations as OperationClass elif api_version == '2019-12-01': from .v2019_12_01.operations import GalleriesOperations as OperationClass + elif api_version == '2020-09-30': + from .v2020_09_30.operations import GalleriesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'galleries'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -379,6 +386,7 @@ def gallery_application_versions(self): * 2019-03-01: :class:`GalleryApplicationVersionsOperations` * 2019-07-01: :class:`GalleryApplicationVersionsOperations` * 2019-12-01: :class:`GalleryApplicationVersionsOperations` + * 2020-09-30: :class:`GalleryApplicationVersionsOperations` """ api_version = self._get_api_version('gallery_application_versions') if api_version == '2019-03-01': @@ -387,6 +395,8 @@ def gallery_application_versions(self): from .v2019_07_01.operations import GalleryApplicationVersionsOperations as OperationClass elif api_version == '2019-12-01': from .v2019_12_01.operations import GalleryApplicationVersionsOperations as OperationClass + elif api_version == '2020-09-30': + from .v2020_09_30.operations import GalleryApplicationVersionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'gallery_application_versions'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -398,6 +408,7 @@ def gallery_applications(self): * 2019-03-01: :class:`GalleryApplicationsOperations` * 2019-07-01: :class:`GalleryApplicationsOperations` * 2019-12-01: :class:`GalleryApplicationsOperations` + * 2020-09-30: :class:`GalleryApplicationsOperations` """ api_version = self._get_api_version('gallery_applications') if api_version == '2019-03-01': @@ -406,6 +417,8 @@ def gallery_applications(self): from .v2019_07_01.operations import GalleryApplicationsOperations as OperationClass elif api_version == '2019-12-01': from .v2019_12_01.operations import GalleryApplicationsOperations as OperationClass + elif api_version == '2020-09-30': + from .v2020_09_30.operations import GalleryApplicationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'gallery_applications'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -418,6 +431,7 @@ def gallery_image_versions(self): * 2019-03-01: :class:`GalleryImageVersionsOperations` * 2019-07-01: :class:`GalleryImageVersionsOperations` * 2019-12-01: :class:`GalleryImageVersionsOperations` + * 2020-09-30: :class:`GalleryImageVersionsOperations` """ api_version = self._get_api_version('gallery_image_versions') if api_version == '2018-06-01': @@ -428,6 +442,8 @@ def gallery_image_versions(self): from .v2019_07_01.operations import GalleryImageVersionsOperations as OperationClass elif api_version == '2019-12-01': from .v2019_12_01.operations import GalleryImageVersionsOperations as OperationClass + elif api_version == '2020-09-30': + from .v2020_09_30.operations import GalleryImageVersionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'gallery_image_versions'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -440,6 +456,7 @@ def gallery_images(self): * 2019-03-01: :class:`GalleryImagesOperations` * 2019-07-01: :class:`GalleryImagesOperations` * 2019-12-01: :class:`GalleryImagesOperations` + * 2020-09-30: :class:`GalleryImagesOperations` """ api_version = self._get_api_version('gallery_images') if api_version == '2018-06-01': @@ -450,10 +467,25 @@ def gallery_images(self): from .v2019_07_01.operations import GalleryImagesOperations as OperationClass elif api_version == '2019-12-01': from .v2019_12_01.operations import GalleryImagesOperations as OperationClass + elif api_version == '2020-09-30': + from .v2020_09_30.operations import GalleryImagesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'gallery_images'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def gallery_sharing_profile(self): + """Instance depends on the API version: + + * 2020-09-30: :class:`GallerySharingProfileOperations` + """ + api_version = self._get_api_version('gallery_sharing_profile') + if api_version == '2020-09-30': + from .v2020_09_30.operations import GallerySharingProfileOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'gallery_sharing_profile'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def images(self): """Instance depends on the API version: @@ -612,6 +644,45 @@ def resource_skus(self): raise ValueError("API version {} does not have operation group 'resource_skus'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def shared_galleries(self): + """Instance depends on the API version: + + * 2020-09-30: :class:`SharedGalleriesOperations` + """ + api_version = self._get_api_version('shared_galleries') + if api_version == '2020-09-30': + from .v2020_09_30.operations import SharedGalleriesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'shared_galleries'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def shared_gallery_image_versions(self): + """Instance depends on the API version: + + * 2020-09-30: :class:`SharedGalleryImageVersionsOperations` + """ + api_version = self._get_api_version('shared_gallery_image_versions') + if api_version == '2020-09-30': + from .v2020_09_30.operations import SharedGalleryImageVersionsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'shared_gallery_image_versions'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def shared_gallery_images(self): + """Instance depends on the API version: + + * 2020-09-30: :class:`SharedGalleryImagesOperations` + """ + api_version = self._get_api_version('shared_gallery_images') + if api_version == '2020-09-30': + from .v2020_09_30.operations import SharedGalleryImagesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'shared_gallery_images'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def snapshots(self): """Instance depends on the API version: @@ -982,6 +1053,19 @@ def virtual_machine_scale_set_vm_extensions(self): raise ValueError("API version {} does not have operation group 'virtual_machine_scale_set_vm_extensions'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def virtual_machine_scale_set_vm_run_commands(self): + """Instance depends on the API version: + + * 2020-06-01: :class:`VirtualMachineScaleSetVMRunCommandsOperations` + """ + api_version = self._get_api_version('virtual_machine_scale_set_vm_run_commands') + if api_version == '2020-06-01': + from .v2020_06_01.operations import VirtualMachineScaleSetVMRunCommandsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'virtual_machine_scale_set_vm_run_commands'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def virtual_machine_scale_set_vms(self): """Instance depends on the API version: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/_compute_management_client.py index 92bed291f49f..20cf0a6c3c31 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/_compute_management_client.py @@ -46,7 +46,7 @@ class ComputeManagementClient(MultiApiClientMixin, _SDKClient): :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2020-06-30' + DEFAULT_API_VERSION = '2020-09-30' _PROFILE_TAG = "azure.mgmt.compute.ComputeManagementClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -54,16 +54,15 @@ class ComputeManagementClient(MultiApiClientMixin, _SDKClient): 'availability_sets': '2020-06-01', 'dedicated_host_groups': '2020-06-01', 'dedicated_hosts': '2020-06-01', - 'galleries': '2019-12-01', - 'gallery_application_versions': '2019-12-01', - 'gallery_applications': '2019-12-01', - 'gallery_image_versions': '2019-12-01', - 'gallery_images': '2019-12-01', + 'disk_accesses': '2020-06-30', + 'disk_encryption_sets': '2020-06-30', + 'disks': '2020-06-30', 'images': '2020-06-01', 'log_analytics': '2020-06-01', 'operations': '2020-06-01', 'proximity_placement_groups': '2020-06-01', 'resource_skus': '2019-04-01', + 'snapshots': '2020-06-30', 'ssh_public_keys': '2020-06-01', 'usage': '2020-06-01', 'virtual_machine_extension_images': '2020-06-01', @@ -73,6 +72,7 @@ class ComputeManagementClient(MultiApiClientMixin, _SDKClient): 'virtual_machine_scale_set_extensions': '2020-06-01', 'virtual_machine_scale_set_rolling_upgrades': '2020-06-01', 'virtual_machine_scale_set_vm_extensions': '2020-06-01', + 'virtual_machine_scale_set_vm_run_commands': '2020-06-01', 'virtual_machine_scale_set_vms': '2020-06-01', 'virtual_machine_scale_sets': '2020-06-01', 'virtual_machine_sizes': '2020-06-01', @@ -125,6 +125,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2020-05-01: :mod:`v2020_05_01.models` * 2020-06-01: :mod:`v2020_06_01.models` * 2020-06-30: :mod:`v2020_06_30.models` + * 2020-09-30: :mod:`v2020_09_30.models` """ if api_version == '2015-06-15': from ..v2015_06_15 import models @@ -180,6 +181,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2020-06-30': from ..v2020_06_30 import models return models + elif api_version == '2020-09-30': + from ..v2020_09_30 import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -358,6 +362,7 @@ def galleries(self): * 2019-03-01: :class:`GalleriesOperations` * 2019-07-01: :class:`GalleriesOperations` * 2019-12-01: :class:`GalleriesOperations` + * 2020-09-30: :class:`GalleriesOperations` """ api_version = self._get_api_version('galleries') if api_version == '2018-06-01': @@ -368,6 +373,8 @@ def galleries(self): from ..v2019_07_01.aio.operations import GalleriesOperations as OperationClass elif api_version == '2019-12-01': from ..v2019_12_01.aio.operations import GalleriesOperations as OperationClass + elif api_version == '2020-09-30': + from ..v2020_09_30.aio.operations import GalleriesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'galleries'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -379,6 +386,7 @@ def gallery_application_versions(self): * 2019-03-01: :class:`GalleryApplicationVersionsOperations` * 2019-07-01: :class:`GalleryApplicationVersionsOperations` * 2019-12-01: :class:`GalleryApplicationVersionsOperations` + * 2020-09-30: :class:`GalleryApplicationVersionsOperations` """ api_version = self._get_api_version('gallery_application_versions') if api_version == '2019-03-01': @@ -387,6 +395,8 @@ def gallery_application_versions(self): from ..v2019_07_01.aio.operations import GalleryApplicationVersionsOperations as OperationClass elif api_version == '2019-12-01': from ..v2019_12_01.aio.operations import GalleryApplicationVersionsOperations as OperationClass + elif api_version == '2020-09-30': + from ..v2020_09_30.aio.operations import GalleryApplicationVersionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'gallery_application_versions'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -398,6 +408,7 @@ def gallery_applications(self): * 2019-03-01: :class:`GalleryApplicationsOperations` * 2019-07-01: :class:`GalleryApplicationsOperations` * 2019-12-01: :class:`GalleryApplicationsOperations` + * 2020-09-30: :class:`GalleryApplicationsOperations` """ api_version = self._get_api_version('gallery_applications') if api_version == '2019-03-01': @@ -406,6 +417,8 @@ def gallery_applications(self): from ..v2019_07_01.aio.operations import GalleryApplicationsOperations as OperationClass elif api_version == '2019-12-01': from ..v2019_12_01.aio.operations import GalleryApplicationsOperations as OperationClass + elif api_version == '2020-09-30': + from ..v2020_09_30.aio.operations import GalleryApplicationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'gallery_applications'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -418,6 +431,7 @@ def gallery_image_versions(self): * 2019-03-01: :class:`GalleryImageVersionsOperations` * 2019-07-01: :class:`GalleryImageVersionsOperations` * 2019-12-01: :class:`GalleryImageVersionsOperations` + * 2020-09-30: :class:`GalleryImageVersionsOperations` """ api_version = self._get_api_version('gallery_image_versions') if api_version == '2018-06-01': @@ -428,6 +442,8 @@ def gallery_image_versions(self): from ..v2019_07_01.aio.operations import GalleryImageVersionsOperations as OperationClass elif api_version == '2019-12-01': from ..v2019_12_01.aio.operations import GalleryImageVersionsOperations as OperationClass + elif api_version == '2020-09-30': + from ..v2020_09_30.aio.operations import GalleryImageVersionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'gallery_image_versions'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -440,6 +456,7 @@ def gallery_images(self): * 2019-03-01: :class:`GalleryImagesOperations` * 2019-07-01: :class:`GalleryImagesOperations` * 2019-12-01: :class:`GalleryImagesOperations` + * 2020-09-30: :class:`GalleryImagesOperations` """ api_version = self._get_api_version('gallery_images') if api_version == '2018-06-01': @@ -450,10 +467,25 @@ def gallery_images(self): from ..v2019_07_01.aio.operations import GalleryImagesOperations as OperationClass elif api_version == '2019-12-01': from ..v2019_12_01.aio.operations import GalleryImagesOperations as OperationClass + elif api_version == '2020-09-30': + from ..v2020_09_30.aio.operations import GalleryImagesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'gallery_images'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def gallery_sharing_profile(self): + """Instance depends on the API version: + + * 2020-09-30: :class:`GallerySharingProfileOperations` + """ + api_version = self._get_api_version('gallery_sharing_profile') + if api_version == '2020-09-30': + from ..v2020_09_30.aio.operations import GallerySharingProfileOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'gallery_sharing_profile'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def images(self): """Instance depends on the API version: @@ -612,6 +644,45 @@ def resource_skus(self): raise ValueError("API version {} does not have operation group 'resource_skus'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def shared_galleries(self): + """Instance depends on the API version: + + * 2020-09-30: :class:`SharedGalleriesOperations` + """ + api_version = self._get_api_version('shared_galleries') + if api_version == '2020-09-30': + from ..v2020_09_30.aio.operations import SharedGalleriesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'shared_galleries'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def shared_gallery_image_versions(self): + """Instance depends on the API version: + + * 2020-09-30: :class:`SharedGalleryImageVersionsOperations` + """ + api_version = self._get_api_version('shared_gallery_image_versions') + if api_version == '2020-09-30': + from ..v2020_09_30.aio.operations import SharedGalleryImageVersionsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'shared_gallery_image_versions'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def shared_gallery_images(self): + """Instance depends on the API version: + + * 2020-09-30: :class:`SharedGalleryImagesOperations` + """ + api_version = self._get_api_version('shared_gallery_images') + if api_version == '2020-09-30': + from ..v2020_09_30.aio.operations import SharedGalleryImagesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'shared_gallery_images'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def snapshots(self): """Instance depends on the API version: @@ -982,6 +1053,19 @@ def virtual_machine_scale_set_vm_extensions(self): raise ValueError("API version {} does not have operation group 'virtual_machine_scale_set_vm_extensions'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def virtual_machine_scale_set_vm_run_commands(self): + """Instance depends on the API version: + + * 2020-06-01: :class:`VirtualMachineScaleSetVMRunCommandsOperations` + """ + api_version = self._get_api_version('virtual_machine_scale_set_vm_run_commands') + if api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import VirtualMachineScaleSetVMRunCommandsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'virtual_machine_scale_set_vm_run_commands'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def virtual_machine_scale_set_vms(self): """Instance depends on the API version: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/models.py index 5d376ed3e899..2200c7842cfa 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/models.py @@ -5,6 +5,6 @@ # license information. # -------------------------------------------------------------------------- from .v2019_04_01.models import * -from .v2019_12_01.models import * from .v2020_06_01.models import * from .v2020_06_30.models import * +from .v2020_09_30.models import * diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_compute_management_client.py index c94784b71eac..a273916fd4e8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_compute_management_client.py @@ -74,7 +74,6 @@ def __init__( 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.availability_sets = AvailabilitySetsOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_metadata.json index 6cdd633ceb24..c5ae18910e14 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/_compute_management_client.py index e31ce000b06c..f81704a44e6d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/_compute_management_client.py @@ -71,7 +71,6 @@ def __init__( 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.availability_sets = AvailabilitySetsOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_availability_sets_operations.py index f66689e449bc..ab37f2dd0810 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_availability_sets_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailabilitySetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, name: str, - parameters: "models.AvailabilitySet", + parameters: "_models.AvailabilitySet", **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Create or update an availability set. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~azure.mgmt.compute.v2015_06_15.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,7 +112,7 @@ async def delete( resource_group_name: str, availability_set_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: + ) -> Optional["_models.OperationStatusResponse"]: """Delete an availability set. :param resource_group_name: The name of the resource group. @@ -124,7 +124,7 @@ async def delete( :rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -172,7 +172,7 @@ async def get( resource_group_name: str, availability_set_name: str, **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Retrieves information about an availability set. :param resource_group_name: The name of the resource group. @@ -184,7 +184,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2015_06_15.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -229,7 +229,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailabilitySetListResult"]: + ) -> AsyncIterable["_models.AvailabilitySetListResult"]: """Lists all availability sets in a resource group. :param resource_group_name: The name of the resource group. @@ -239,7 +239,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2015_06_15.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -300,7 +300,7 @@ def list_available_sizes( resource_group_name: str, availability_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. @@ -313,7 +313,7 @@ def list_available_sizes( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_usage_operations.py index 57e8006a4a68..f44d7d136605 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsageOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.ListUsagesResult"]: + ) -> AsyncIterable["_models.ListUsagesResult"]: """Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2015_06_15.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extension_images_operations.py index cbb893f5a2f4..f5754a48eaed 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extension_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VirtualMachineExtensionImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( type: str, version: str, **kwargs - ) -> "models.VirtualMachineExtensionImage": + ) -> "_models.VirtualMachineExtensionImage": """Gets a virtual machine extension image. :param location: The name of a supported Azure region. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtensionImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,7 +111,7 @@ async def list_types( location: str, publisher_name: str, **kwargs - ) -> List["models.VirtualMachineExtensionImage"]: + ) -> List["_models.VirtualMachineExtensionImage"]: """Gets a list of virtual machine extension image types. :param location: The name of a supported Azure region. @@ -123,7 +123,7 @@ async def list_types( :rtype: list[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -173,7 +173,7 @@ async def list_versions( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> List["models.VirtualMachineExtensionImage"]: + ) -> List["_models.VirtualMachineExtensionImage"]: """Gets a list of virtual machine extension image versions. :param location: The name of a supported Azure region. @@ -193,7 +193,7 @@ async def list_versions( :rtype: list[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extensions_operations.py index b6db7a613cdb..b5b409dced91 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VirtualMachineExtensionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineExtension", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineExtension", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineExtension"]: """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -177,10 +184,10 @@ async def _update_initial( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineExtensionUpdate", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -232,9 +239,9 @@ async def begin_update( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineExtensionUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineExtension"]: """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -257,7 +264,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -283,7 +290,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -303,8 +317,8 @@ async def _delete_initial( vm_name: str, vm_extension_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,7 +368,7 @@ async def begin_delete( vm_name: str, vm_extension_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -374,7 +388,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -399,7 +413,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -420,7 +441,7 @@ async def get( vm_extension_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtension": + ) -> "_models.VirtualMachineExtension": """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -436,7 +457,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_images_operations.py index a4dd4ea86a6a..5c241a4da6a4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VirtualMachineImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( skus: str, version: str, **kwargs - ) -> "models.VirtualMachineImage": + ) -> "_models.VirtualMachineImage": """Gets a virtual machine image. :param location: The name of a supported Azure region. @@ -66,7 +66,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,7 +120,7 @@ async def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. @@ -143,7 +143,7 @@ async def list( :rtype: list[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -197,7 +197,7 @@ async def list_offers( location: str, publisher_name: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image offers for the specified location and publisher. :param location: The name of a supported Azure region. @@ -209,7 +209,7 @@ async def list_offers( :rtype: list[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -254,7 +254,7 @@ async def list_publishers( self, location: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image publishers for the specified Azure location. :param location: The name of a supported Azure region. @@ -264,7 +264,7 @@ async def list_publishers( :rtype: list[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -310,7 +310,7 @@ async def list_skus( publisher_name: str, offer: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. :param location: The name of a supported Azure region. @@ -324,7 +324,7 @@ async def list_skus( :rtype: list[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_set_vms_operations.py index 29c09ac2d052..82baaea69158 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetVMsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,8 +49,8 @@ async def _reimage_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ async def begin_reimage( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -120,7 +120,7 @@ async def begin_reimage( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -145,7 +145,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -165,8 +172,8 @@ async def _deallocate_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +223,7 @@ async def begin_deallocate( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. @@ -238,7 +245,7 @@ async def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -263,7 +270,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -283,8 +297,8 @@ async def _delete_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -334,7 +348,7 @@ async def begin_delete( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -354,7 +368,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -379,7 +393,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -399,7 +420,7 @@ async def get( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.VirtualMachineScaleSetVM": + ) -> "_models.VirtualMachineScaleSetVM": """Gets a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -413,7 +434,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSetVM :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -461,7 +482,7 @@ async def get_instance_view( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.VirtualMachineScaleSetVMInstanceView": + ) -> "_models.VirtualMachineScaleSetVMInstanceView": """Gets the status of a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -475,7 +496,7 @@ async def get_instance_view( :rtype: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSetVMInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -525,7 +546,7 @@ def list( select: Optional[str] = None, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetVMListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetVMListResult"]: """Gets a list of all virtual machines in a VM scale sets. :param resource_group_name: The name of the resource group. @@ -546,7 +567,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSetVMListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -615,8 +636,8 @@ async def _power_off_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -666,7 +687,7 @@ async def begin_power_off( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. @@ -688,7 +709,7 @@ async def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -713,7 +734,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -733,8 +761,8 @@ async def _restart_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -784,7 +812,7 @@ async def begin_restart( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -804,7 +832,7 @@ async def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -829,7 +857,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -849,8 +884,8 @@ async def _start_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -900,7 +935,7 @@ async def begin_start( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -920,7 +955,7 @@ async def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -945,7 +980,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_sets_operations.py index 09c17b45d643..ce36892a16c5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, name: str, - parameters: "models.VirtualMachineScaleSet", + parameters: "_models.VirtualMachineScaleSet", **kwargs - ) -> "models.VirtualMachineScaleSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + ) -> "_models.VirtualMachineScaleSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, name: str, - parameters: "models.VirtualMachineScaleSet", + parameters: "_models.VirtualMachineScaleSet", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSet"]: """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -170,8 +176,8 @@ async def _delete_initial( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,7 +225,7 @@ async def begin_delete( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -237,7 +243,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -261,7 +267,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -280,7 +292,7 @@ async def get( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> "_models.VirtualMachineScaleSet": """Display information about a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -292,7 +304,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -337,10 +349,10 @@ async def _deallocate_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,9 +407,9 @@ async def begin_deallocate( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. @@ -419,7 +431,7 @@ async def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -462,10 +480,10 @@ async def _delete_instances_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,9 +535,9 @@ async def begin_delete_instances( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ async def begin_delete_instances( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -564,7 +582,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -583,7 +607,7 @@ async def get_instance_view( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.VirtualMachineScaleSetInstanceView": + ) -> "_models.VirtualMachineScaleSetInstanceView": """Gets the status of a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -595,7 +619,7 @@ async def get_instance_view( :rtype: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSetInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -640,7 +664,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListResult"]: """Gets a list of all VM scale sets under a resource group. :param resource_group_name: The name of the resource group. @@ -650,7 +674,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -709,7 +733,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListWithLinkResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListWithLinkResult"]: """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. @@ -719,7 +743,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSetListWithLinkResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListWithLinkResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -779,7 +803,7 @@ def list_skus( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListSkusResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListSkusResult"]: """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. @@ -792,7 +816,7 @@ def list_skus( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSetListSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -853,10 +877,10 @@ async def _power_off_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -911,9 +935,9 @@ async def begin_power_off( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. @@ -935,7 +959,7 @@ async def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -960,7 +984,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -978,10 +1008,10 @@ async def _restart_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1036,9 +1066,9 @@ async def begin_restart( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1058,7 +1088,7 @@ async def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1083,7 +1113,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1101,10 +1137,10 @@ async def _start_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1159,9 +1195,9 @@ async def begin_start( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1181,7 +1217,7 @@ async def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1206,7 +1242,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1224,10 +1266,10 @@ async def _update_instances_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1279,9 +1321,9 @@ async def begin_update_instances( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1301,7 +1343,7 @@ async def begin_update_instances( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1326,7 +1368,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1345,8 +1393,8 @@ async def _reimage_initial( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1394,7 +1442,7 @@ async def begin_reimage( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1412,7 +1460,7 @@ async def begin_reimage( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1436,7 +1484,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_sizes_operations.py index 267401a2f3d6..2c88c09a7060 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_sizes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VirtualMachineSizesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes for a subscription in a location. :param location: The location upon which virtual-machine-sizes is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machines_operations.py index a149f9380a26..c1435e80bccd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machines_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachinesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _capture_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineCaptureParameters", + parameters: "_models.VirtualMachineCaptureParameters", **kwargs - ) -> Optional["models.VirtualMachineCaptureResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + ) -> Optional["_models.VirtualMachineCaptureResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualMachineCaptureResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,9 +102,9 @@ async def begin_capture( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineCaptureParameters", + parameters: "_models.VirtualMachineCaptureParameters", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineCaptureResult"]: + ) -> AsyncLROPoller["_models.VirtualMachineCaptureResult"]: """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -125,7 +125,7 @@ async def begin_capture( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -150,7 +150,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -168,10 +174,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachine", + parameters: "_models.VirtualMachine", **kwargs - ) -> "models.VirtualMachine": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + ) -> "_models.VirtualMachine": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -225,9 +231,9 @@ async def begin_create_or_update( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachine", + parameters: "_models.VirtualMachine", **kwargs - ) -> AsyncLROPoller["models.VirtualMachine"]: + ) -> AsyncLROPoller["_models.VirtualMachine"]: """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -247,7 +253,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -272,7 +278,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -291,8 +303,8 @@ async def _delete_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -340,7 +352,7 @@ async def begin_delete( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -358,7 +370,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -382,7 +394,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -402,7 +420,7 @@ async def get( vm_name: str, expand: Optional[str] = "instanceView", **kwargs - ) -> "models.VirtualMachine": + ) -> "_models.VirtualMachine": """Retrieves information about the model view or the instance view of a virtual machine. :param resource_group_name: The name of the resource group. @@ -416,7 +434,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachine :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,8 +482,8 @@ async def _deallocate_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -513,7 +531,7 @@ async def begin_deallocate( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. @@ -532,7 +550,7 @@ async def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -556,7 +574,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -575,7 +599,7 @@ async def generalize( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> "_models.OperationStatusResponse": """Sets the state of the virtual machine to generalized. :param resource_group_name: The name of the resource group. @@ -587,7 +611,7 @@ async def generalize( :rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -632,7 +656,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. @@ -643,7 +667,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -702,7 +726,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. @@ -711,7 +735,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -771,7 +795,7 @@ def list_available_sizes( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes to which the specified virtual machine can be resized. @@ -784,7 +808,7 @@ def list_available_sizes( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -846,8 +870,8 @@ async def _power_off_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -895,7 +919,7 @@ async def begin_power_off( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. @@ -914,7 +938,7 @@ async def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -938,7 +962,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -957,8 +987,8 @@ async def _restart_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1006,7 +1036,7 @@ async def begin_restart( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1024,7 +1054,7 @@ async def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1048,7 +1078,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1067,8 +1103,8 @@ async def _start_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1116,7 +1152,7 @@ async def begin_start( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1134,7 +1170,7 @@ async def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1158,7 +1194,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1177,8 +1219,8 @@ async def _redeploy_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1226,7 +1268,7 @@ async def begin_redeploy( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1244,7 +1286,7 @@ async def begin_redeploy( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1268,7 +1310,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_availability_sets_operations.py index 7770838844af..d80e75617c5c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_availability_sets_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailabilitySetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str name, # type: str - parameters, # type: "models.AvailabilitySet" + parameters, # type: "_models.AvailabilitySet" **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Create or update an availability set. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~azure.mgmt.compute.v2015_06_15.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,7 +118,7 @@ def delete( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] + # type: (...) -> Optional["_models.OperationStatusResponse"] """Delete an availability set. :param resource_group_name: The name of the resource group. @@ -130,7 +130,7 @@ def delete( :rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -179,7 +179,7 @@ def get( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Retrieves information about an availability set. :param resource_group_name: The name of the resource group. @@ -191,7 +191,7 @@ def get( :rtype: ~azure.mgmt.compute.v2015_06_15.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -237,7 +237,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailabilitySetListResult"] + # type: (...) -> Iterable["_models.AvailabilitySetListResult"] """Lists all availability sets in a resource group. :param resource_group_name: The name of the resource group. @@ -247,7 +247,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2015_06_15.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +309,7 @@ def list_available_sizes( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. @@ -322,7 +322,7 @@ def list_available_sizes( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_usage_operations.py index 30c808333082..027c9f1825a8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsageOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListUsagesResult"] + # type: (...) -> Iterable["_models.ListUsagesResult"] """Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2015_06_15.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extension_images_operations.py index 23bad4e68d51..72e92f6bd499 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extension_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VirtualMachineExtensionImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( version, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtensionImage" + # type: (...) -> "_models.VirtualMachineExtensionImage" """Gets a virtual machine extension image. :param location: The name of a supported Azure region. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtensionImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def list_types( publisher_name, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineExtensionImage"] + # type: (...) -> List["_models.VirtualMachineExtensionImage"] """Gets a list of virtual machine extension image types. :param location: The name of a supported Azure region. @@ -129,7 +129,7 @@ def list_types( :rtype: list[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -180,7 +180,7 @@ def list_versions( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineExtensionImage"] + # type: (...) -> List["_models.VirtualMachineExtensionImage"] """Gets a list of virtual machine extension image versions. :param location: The name of a supported Azure region. @@ -200,7 +200,7 @@ def list_versions( :rtype: list[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extensions_operations.py index 0c84661fabd0..1b816f0519f8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VirtualMachineExtensionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineExtension"] """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -183,11 +190,11 @@ def _update_initial( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -239,10 +246,10 @@ def begin_update( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineExtension"] """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -265,7 +272,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -291,7 +298,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -312,8 +326,8 @@ def _delete_initial( vm_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -364,7 +378,7 @@ def begin_delete( vm_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -384,7 +398,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -409,7 +423,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -431,7 +452,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" + # type: (...) -> "_models.VirtualMachineExtension" """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -447,7 +468,7 @@ def get( :rtype: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_images_operations.py index 9842bfb00836..057569bb7363 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VirtualMachineImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( version, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineImage" + # type: (...) -> "_models.VirtualMachineImage" """Gets a virtual machine image. :param location: The name of a supported Azure region. @@ -71,7 +71,7 @@ def get( :rtype: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -126,7 +126,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. @@ -149,7 +149,7 @@ def list( :rtype: list[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -204,7 +204,7 @@ def list_offers( publisher_name, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image offers for the specified location and publisher. :param location: The name of a supported Azure region. @@ -216,7 +216,7 @@ def list_offers( :rtype: list[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,7 +262,7 @@ def list_publishers( location, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image publishers for the specified Azure location. :param location: The name of a supported Azure region. @@ -272,7 +272,7 @@ def list_publishers( :rtype: list[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -319,7 +319,7 @@ def list_skus( offer, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. :param location: The name of a supported Azure region. @@ -333,7 +333,7 @@ def list_skus( :rtype: list[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_set_vms_operations.py index d20a8607ac48..36b117edfd83 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_set_vms_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetVMsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,8 +54,8 @@ def _reimage_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,7 +106,7 @@ def begin_reimage( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ def begin_reimage( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -172,8 +179,8 @@ def _deallocate_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -224,7 +231,7 @@ def begin_deallocate( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. @@ -246,7 +253,7 @@ def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -271,7 +278,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -292,8 +306,8 @@ def _delete_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -344,7 +358,7 @@ def begin_delete( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -364,7 +378,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -389,7 +403,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -410,7 +431,7 @@ def get( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVM" + # type: (...) -> "_models.VirtualMachineScaleSetVM" """Gets a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -424,7 +445,7 @@ def get( :rtype: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSetVM :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -473,7 +494,7 @@ def get_instance_view( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVMInstanceView" + # type: (...) -> "_models.VirtualMachineScaleSetVMInstanceView" """Gets the status of a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -487,7 +508,7 @@ def get_instance_view( :rtype: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSetVMInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -538,7 +559,7 @@ def list( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetVMListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetVMListResult"] """Gets a list of all virtual machines in a VM scale sets. :param resource_group_name: The name of the resource group. @@ -559,7 +580,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSetVMListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -629,8 +650,8 @@ def _power_off_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -681,7 +702,7 @@ def begin_power_off( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. @@ -703,7 +724,7 @@ def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -728,7 +749,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -749,8 +777,8 @@ def _restart_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -801,7 +829,7 @@ def begin_restart( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -821,7 +849,7 @@ def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -846,7 +874,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -867,8 +902,8 @@ def _start_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -919,7 +954,7 @@ def begin_start( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -939,7 +974,7 @@ def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -964,7 +999,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_sets_operations.py index b66c03dd4203..c15f9d11ad60 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str name, # type: str - parameters, # type: "models.VirtualMachineScaleSet" + parameters, # type: "_models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + # type: (...) -> "_models.VirtualMachineScaleSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str name, # type: str - parameters, # type: "models.VirtualMachineScaleSet" + parameters, # type: "_models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSet"] """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -177,8 +183,8 @@ def _delete_initial( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,7 +233,7 @@ def begin_delete( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -245,7 +251,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -269,7 +275,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -289,7 +301,7 @@ def get( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" + # type: (...) -> "_models.VirtualMachineScaleSet" """Display information about a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -301,7 +313,7 @@ def get( :rtype: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -346,11 +358,11 @@ def _deallocate_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,10 +417,10 @@ def begin_deallocate( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. @@ -430,7 +442,7 @@ def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -455,7 +467,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -473,11 +491,11 @@ def _delete_instances_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,10 +547,10 @@ def begin_delete_instances( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -552,7 +570,7 @@ def begin_delete_instances( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -577,7 +595,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -597,7 +621,7 @@ def get_instance_view( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetInstanceView" + # type: (...) -> "_models.VirtualMachineScaleSetInstanceView" """Gets the status of a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -609,7 +633,7 @@ def get_instance_view( :rtype: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSetInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -655,7 +679,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListResult"] """Gets a list of all VM scale sets under a resource group. :param resource_group_name: The name of the resource group. @@ -665,7 +689,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -725,7 +749,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListWithLinkResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListWithLinkResult"] """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. @@ -735,7 +759,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSetListWithLinkResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListWithLinkResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -796,7 +820,7 @@ def list_skus( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListSkusResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListSkusResult"] """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. @@ -809,7 +833,7 @@ def list_skus( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineScaleSetListSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -870,11 +894,11 @@ def _power_off_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -929,10 +953,10 @@ def begin_power_off( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. @@ -954,7 +978,7 @@ def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -979,7 +1003,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -997,11 +1027,11 @@ def _restart_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1056,10 +1086,10 @@ def begin_restart( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1079,7 +1109,7 @@ def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1104,7 +1134,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1122,11 +1158,11 @@ def _start_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1181,10 +1217,10 @@ def begin_start( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1204,7 +1240,7 @@ def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1229,7 +1265,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1247,11 +1289,11 @@ def _update_instances_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1303,10 +1345,10 @@ def begin_update_instances( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1326,7 +1368,7 @@ def begin_update_instances( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1351,7 +1393,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1371,8 +1419,8 @@ def _reimage_initial( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1421,7 +1469,7 @@ def begin_reimage( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1439,7 +1487,7 @@ def begin_reimage( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1463,7 +1511,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_sizes_operations.py index 1eabae8491b1..52df216dd8f8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_sizes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VirtualMachineSizesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes for a subscription in a location. :param location: The location upon which virtual-machine-sizes is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machines_operations.py index facff4823b7f..156cad43d047 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machines_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachinesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _capture_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineCaptureParameters" + parameters, # type: "_models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualMachineCaptureResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + # type: (...) -> Optional["_models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualMachineCaptureResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,10 +107,10 @@ def begin_capture( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineCaptureParameters" + parameters, # type: "_models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineCaptureResult"] + # type: (...) -> LROPoller["_models.VirtualMachineCaptureResult"] """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -131,7 +131,7 @@ def begin_capture( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -156,7 +156,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -174,11 +180,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachine" + parameters, # type: "_models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + # type: (...) -> "_models.VirtualMachine" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -232,10 +238,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachine" + parameters, # type: "_models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachine"] + # type: (...) -> LROPoller["_models.VirtualMachine"] """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -255,7 +261,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -280,7 +286,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -300,8 +312,8 @@ def _delete_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -350,7 +362,7 @@ def begin_delete( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -368,7 +380,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -392,7 +404,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -413,7 +431,7 @@ def get( expand="instanceView", # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" + # type: (...) -> "_models.VirtualMachine" """Retrieves information about the model view or the instance view of a virtual machine. :param resource_group_name: The name of the resource group. @@ -427,7 +445,7 @@ def get( :rtype: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachine :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,8 +494,8 @@ def _deallocate_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -526,7 +544,7 @@ def begin_deallocate( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. @@ -545,7 +563,7 @@ def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -569,7 +587,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -589,7 +613,7 @@ def generalize( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" + # type: (...) -> "_models.OperationStatusResponse" """Sets the state of the virtual machine to generalized. :param resource_group_name: The name of the resource group. @@ -601,7 +625,7 @@ def generalize( :rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -647,7 +671,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. @@ -658,7 +682,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -718,7 +742,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. @@ -727,7 +751,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -788,7 +812,7 @@ def list_available_sizes( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes to which the specified virtual machine can be resized. @@ -801,7 +825,7 @@ def list_available_sizes( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -864,8 +888,8 @@ def _power_off_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -914,7 +938,7 @@ def begin_power_off( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. @@ -933,7 +957,7 @@ def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -957,7 +981,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -977,8 +1007,8 @@ def _restart_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1027,7 +1057,7 @@ def begin_restart( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1045,7 +1075,7 @@ def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1069,7 +1099,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1089,8 +1125,8 @@ def _start_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1139,7 +1175,7 @@ def begin_start( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1157,7 +1193,7 @@ def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1181,7 +1217,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1201,8 +1243,8 @@ def _redeploy_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1251,7 +1293,7 @@ def begin_redeploy( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1269,7 +1311,7 @@ def begin_redeploy( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1293,7 +1335,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_compute_management_client.py index 8e306e622dbd..7edb8482424a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_compute_management_client.py @@ -74,7 +74,6 @@ def __init__( 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.availability_sets = AvailabilitySetsOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_metadata.json index 93672d359ba3..37f9b3996590 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/_compute_management_client.py index ad94a530b8f9..46dd3529656f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/_compute_management_client.py @@ -71,7 +71,6 @@ def __init__( 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.availability_sets = AvailabilitySetsOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_availability_sets_operations.py index 58fbbf8daefb..6c32d5c62bb4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_availability_sets_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailabilitySetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, name: str, - parameters: "models.AvailabilitySet", + parameters: "_models.AvailabilitySet", **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Create or update an availability set. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~azure.mgmt.compute.v2016_03_30.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,7 +112,7 @@ async def delete( resource_group_name: str, availability_set_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: + ) -> Optional["_models.OperationStatusResponse"]: """Delete an availability set. :param resource_group_name: The name of the resource group. @@ -124,7 +124,7 @@ async def delete( :rtype: ~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -172,7 +172,7 @@ async def get( resource_group_name: str, availability_set_name: str, **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Retrieves information about an availability set. :param resource_group_name: The name of the resource group. @@ -184,7 +184,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2016_03_30.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -229,7 +229,7 @@ def list_by_subscription( self, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.AvailabilitySetListResult"]: + ) -> AsyncIterable["_models.AvailabilitySetListResult"]: """Lists all availability sets in a subscription. :param expand: The expand expression to apply to the operation. Allowed values are @@ -240,7 +240,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_03_30.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -301,7 +301,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailabilitySetListResult"]: + ) -> AsyncIterable["_models.AvailabilitySetListResult"]: """Lists all availability sets in a resource group. :param resource_group_name: The name of the resource group. @@ -311,7 +311,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_03_30.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -372,7 +372,7 @@ def list_available_sizes( resource_group_name: str, availability_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. @@ -385,7 +385,7 @@ def list_available_sizes( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_usage_operations.py index d360c6a31a02..d54775c6d70e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsageOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.ListUsagesResult"]: + ) -> AsyncIterable["_models.ListUsagesResult"]: """Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_03_30.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extension_images_operations.py index f979271dd839..ca5049882b36 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extension_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VirtualMachineExtensionImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( type: str, version: str, **kwargs - ) -> "models.VirtualMachineExtensionImage": + ) -> "_models.VirtualMachineExtensionImage": """Gets a virtual machine extension image. :param location: The name of a supported Azure region. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineExtensionImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,7 +111,7 @@ async def list_types( location: str, publisher_name: str, **kwargs - ) -> List["models.VirtualMachineExtensionImage"]: + ) -> List["_models.VirtualMachineExtensionImage"]: """Gets a list of virtual machine extension image types. :param location: The name of a supported Azure region. @@ -123,7 +123,7 @@ async def list_types( :rtype: list[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -173,7 +173,7 @@ async def list_versions( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> List["models.VirtualMachineExtensionImage"]: + ) -> List["_models.VirtualMachineExtensionImage"]: """Gets a list of virtual machine extension image versions. :param location: The name of a supported Azure region. @@ -193,7 +193,7 @@ async def list_versions( :rtype: list[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extensions_operations.py index 8db4c2ff89aa..9f0801740c42 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VirtualMachineExtensionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineExtension", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineExtension", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineExtension"]: """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -177,10 +184,10 @@ async def _update_initial( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineExtensionUpdate", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -232,9 +239,9 @@ async def begin_update( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineExtensionUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineExtension"]: """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -257,7 +264,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -283,7 +290,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -303,8 +317,8 @@ async def _delete_initial( vm_name: str, vm_extension_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,7 +368,7 @@ async def begin_delete( vm_name: str, vm_extension_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -374,7 +388,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -399,7 +413,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -420,7 +441,7 @@ async def get( vm_extension_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtension": + ) -> "_models.VirtualMachineExtension": """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -436,7 +457,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_images_operations.py index b39be7154394..d702ee23bb7d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VirtualMachineImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( skus: str, version: str, **kwargs - ) -> "models.VirtualMachineImage": + ) -> "_models.VirtualMachineImage": """Gets a virtual machine image. :param location: The name of a supported Azure region. @@ -66,7 +66,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,7 +120,7 @@ async def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. @@ -143,7 +143,7 @@ async def list( :rtype: list[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -197,7 +197,7 @@ async def list_offers( location: str, publisher_name: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image offers for the specified location and publisher. :param location: The name of a supported Azure region. @@ -209,7 +209,7 @@ async def list_offers( :rtype: list[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -254,7 +254,7 @@ async def list_publishers( self, location: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image publishers for the specified Azure location. :param location: The name of a supported Azure region. @@ -264,7 +264,7 @@ async def list_publishers( :rtype: list[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -310,7 +310,7 @@ async def list_skus( publisher_name: str, offer: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. :param location: The name of a supported Azure region. @@ -324,7 +324,7 @@ async def list_skus( :rtype: list[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py index 2c647d58eca4..26ae2f552550 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetVMsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,8 +49,8 @@ async def _reimage_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ async def begin_reimage( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -120,7 +120,7 @@ async def begin_reimage( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -145,7 +145,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -165,8 +172,8 @@ async def _deallocate_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +223,7 @@ async def begin_deallocate( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. @@ -238,7 +245,7 @@ async def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -263,7 +270,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -283,8 +297,8 @@ async def _delete_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -334,7 +348,7 @@ async def begin_delete( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -354,7 +368,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -379,7 +393,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -399,7 +420,7 @@ async def get( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.VirtualMachineScaleSetVM": + ) -> "_models.VirtualMachineScaleSetVM": """Gets a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -413,7 +434,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetVM :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -461,7 +482,7 @@ async def get_instance_view( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.VirtualMachineScaleSetVMInstanceView": + ) -> "_models.VirtualMachineScaleSetVMInstanceView": """Gets the status of a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -475,7 +496,7 @@ async def get_instance_view( :rtype: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetVMInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -525,7 +546,7 @@ def list( select: Optional[str] = None, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetVMListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetVMListResult"]: """Gets a list of all virtual machines in a VM scale sets. :param resource_group_name: The name of the resource group. @@ -546,7 +567,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetVMListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -615,8 +636,8 @@ async def _power_off_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -666,7 +687,7 @@ async def begin_power_off( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. @@ -688,7 +709,7 @@ async def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -713,7 +734,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -733,8 +761,8 @@ async def _restart_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -784,7 +812,7 @@ async def begin_restart( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -804,7 +832,7 @@ async def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -829,7 +857,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -849,8 +884,8 @@ async def _start_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -900,7 +935,7 @@ async def begin_start( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -920,7 +955,7 @@ async def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -945,7 +980,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_sets_operations.py index bd93f7c61df2..bf8b6b5bcc12 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, name: str, - parameters: "models.VirtualMachineScaleSet", + parameters: "_models.VirtualMachineScaleSet", **kwargs - ) -> "models.VirtualMachineScaleSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + ) -> "_models.VirtualMachineScaleSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, name: str, - parameters: "models.VirtualMachineScaleSet", + parameters: "_models.VirtualMachineScaleSet", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSet"]: """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -170,8 +176,8 @@ async def _delete_initial( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,7 +225,7 @@ async def begin_delete( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -237,7 +243,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -261,7 +267,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -280,7 +292,7 @@ async def get( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> "_models.VirtualMachineScaleSet": """Display information about a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -292,7 +304,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -337,10 +349,10 @@ async def _deallocate_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,9 +407,9 @@ async def begin_deallocate( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. @@ -419,7 +431,7 @@ async def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -462,10 +480,10 @@ async def _delete_instances_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,9 +535,9 @@ async def begin_delete_instances( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ async def begin_delete_instances( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -564,7 +582,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -583,7 +607,7 @@ async def get_instance_view( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.VirtualMachineScaleSetInstanceView": + ) -> "_models.VirtualMachineScaleSetInstanceView": """Gets the status of a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -595,7 +619,7 @@ async def get_instance_view( :rtype: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -640,7 +664,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListResult"]: """Gets a list of all VM scale sets under a resource group. :param resource_group_name: The name of the resource group. @@ -650,7 +674,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -709,7 +733,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListWithLinkResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListWithLinkResult"]: """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. @@ -719,7 +743,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetListWithLinkResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListWithLinkResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -779,7 +803,7 @@ def list_skus( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListSkusResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListSkusResult"]: """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. @@ -792,7 +816,7 @@ def list_skus( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetListSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -853,10 +877,10 @@ async def _power_off_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -911,9 +935,9 @@ async def begin_power_off( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. @@ -935,7 +959,7 @@ async def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -960,7 +984,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -978,10 +1008,10 @@ async def _restart_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1036,9 +1066,9 @@ async def begin_restart( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1058,7 +1088,7 @@ async def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1083,7 +1113,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1101,10 +1137,10 @@ async def _start_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1159,9 +1195,9 @@ async def begin_start( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1181,7 +1217,7 @@ async def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1206,7 +1242,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1224,10 +1266,10 @@ async def _update_instances_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1279,9 +1321,9 @@ async def begin_update_instances( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1301,7 +1343,7 @@ async def begin_update_instances( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1326,7 +1368,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1345,8 +1393,8 @@ async def _reimage_initial( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1394,7 +1442,7 @@ async def begin_reimage( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1412,7 +1460,7 @@ async def begin_reimage( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1436,7 +1484,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_sizes_operations.py index fcb92799f18b..8abf986603d3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_sizes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VirtualMachineSizesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes for a subscription in a location. :param location: The location upon which virtual-machine-sizes is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machines_operations.py index a0240ebefdd9..8922478e13b0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machines_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachinesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get_extensions( vm_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtensionsListResult": + ) -> "_models.VirtualMachineExtensionsListResult": """The operation to get all extensions of a Virtual Machine. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def get_extensions( :rtype: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineExtensionsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,10 +110,10 @@ async def _capture_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineCaptureParameters", + parameters: "_models.VirtualMachineCaptureParameters", **kwargs - ) -> Optional["models.VirtualMachineCaptureResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + ) -> Optional["_models.VirtualMachineCaptureResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualMachineCaptureResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -165,9 +165,9 @@ async def begin_capture( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineCaptureParameters", + parameters: "_models.VirtualMachineCaptureParameters", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineCaptureResult"]: + ) -> AsyncLROPoller["_models.VirtualMachineCaptureResult"]: """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -188,7 +188,7 @@ async def begin_capture( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -213,7 +213,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -231,10 +237,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachine", + parameters: "_models.VirtualMachine", **kwargs - ) -> "models.VirtualMachine": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + ) -> "_models.VirtualMachine": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,9 +294,9 @@ async def begin_create_or_update( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachine", + parameters: "_models.VirtualMachine", **kwargs - ) -> AsyncLROPoller["models.VirtualMachine"]: + ) -> AsyncLROPoller["_models.VirtualMachine"]: """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -310,7 +316,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +341,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -354,8 +366,8 @@ async def _delete_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ async def begin_delete( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -421,7 +433,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -445,7 +457,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -465,7 +483,7 @@ async def get( vm_name: str, expand: Optional[str] = "instanceView", **kwargs - ) -> "models.VirtualMachine": + ) -> "_models.VirtualMachine": """Retrieves information about the model view or the instance view of a virtual machine. :param resource_group_name: The name of the resource group. @@ -479,7 +497,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachine :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,8 +545,8 @@ async def _deallocate_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -576,7 +594,7 @@ async def begin_deallocate( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. @@ -595,7 +613,7 @@ async def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -619,7 +637,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -638,7 +662,7 @@ async def generalize( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> "_models.OperationStatusResponse": """Sets the state of the virtual machine to generalized. :param resource_group_name: The name of the resource group. @@ -650,7 +674,7 @@ async def generalize( :rtype: ~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -695,7 +719,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. @@ -706,7 +730,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -765,7 +789,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. @@ -774,7 +798,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -834,7 +858,7 @@ def list_available_sizes( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes to which the specified virtual machine can be resized. @@ -847,7 +871,7 @@ def list_available_sizes( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -909,8 +933,8 @@ async def _power_off_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -958,7 +982,7 @@ async def begin_power_off( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. @@ -977,7 +1001,7 @@ async def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1001,7 +1025,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1020,8 +1050,8 @@ async def _restart_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1069,7 +1099,7 @@ async def begin_restart( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1087,7 +1117,7 @@ async def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1111,7 +1141,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1130,8 +1166,8 @@ async def _start_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1179,7 +1215,7 @@ async def begin_start( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1197,7 +1233,7 @@ async def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1221,7 +1257,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1240,8 +1282,8 @@ async def _redeploy_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1289,7 +1331,7 @@ async def begin_redeploy( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1307,7 +1349,7 @@ async def begin_redeploy( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1331,7 +1373,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_availability_sets_operations.py index 010e1cc61af6..d9a1a642d0e8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_availability_sets_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailabilitySetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str name, # type: str - parameters, # type: "models.AvailabilitySet" + parameters, # type: "_models.AvailabilitySet" **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Create or update an availability set. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~azure.mgmt.compute.v2016_03_30.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,7 +118,7 @@ def delete( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] + # type: (...) -> Optional["_models.OperationStatusResponse"] """Delete an availability set. :param resource_group_name: The name of the resource group. @@ -130,7 +130,7 @@ def delete( :rtype: ~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -179,7 +179,7 @@ def get( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Retrieves information about an availability set. :param resource_group_name: The name of the resource group. @@ -191,7 +191,7 @@ def get( :rtype: ~azure.mgmt.compute.v2016_03_30.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -237,7 +237,7 @@ def list_by_subscription( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailabilitySetListResult"] + # type: (...) -> Iterable["_models.AvailabilitySetListResult"] """Lists all availability sets in a subscription. :param expand: The expand expression to apply to the operation. Allowed values are @@ -248,7 +248,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_03_30.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -310,7 +310,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailabilitySetListResult"] + # type: (...) -> Iterable["_models.AvailabilitySetListResult"] """Lists all availability sets in a resource group. :param resource_group_name: The name of the resource group. @@ -320,7 +320,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_03_30.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -382,7 +382,7 @@ def list_available_sizes( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. @@ -395,7 +395,7 @@ def list_available_sizes( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_usage_operations.py index be6b48366cf5..9170f5d044f0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsageOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListUsagesResult"] + # type: (...) -> Iterable["_models.ListUsagesResult"] """Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_03_30.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extension_images_operations.py index eaee4353f80a..8698ad2d2e2f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extension_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VirtualMachineExtensionImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( version, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtensionImage" + # type: (...) -> "_models.VirtualMachineExtensionImage" """Gets a virtual machine extension image. :param location: The name of a supported Azure region. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineExtensionImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def list_types( publisher_name, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineExtensionImage"] + # type: (...) -> List["_models.VirtualMachineExtensionImage"] """Gets a list of virtual machine extension image types. :param location: The name of a supported Azure region. @@ -129,7 +129,7 @@ def list_types( :rtype: list[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -180,7 +180,7 @@ def list_versions( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineExtensionImage"] + # type: (...) -> List["_models.VirtualMachineExtensionImage"] """Gets a list of virtual machine extension image versions. :param location: The name of a supported Azure region. @@ -200,7 +200,7 @@ def list_versions( :rtype: list[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extensions_operations.py index 3ec51e39c908..583728d18f0b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VirtualMachineExtensionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineExtension"] """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -183,11 +190,11 @@ def _update_initial( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -239,10 +246,10 @@ def begin_update( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineExtension"] """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -265,7 +272,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -291,7 +298,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -312,8 +326,8 @@ def _delete_initial( vm_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -364,7 +378,7 @@ def begin_delete( vm_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -384,7 +398,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -409,7 +423,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -431,7 +452,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" + # type: (...) -> "_models.VirtualMachineExtension" """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -447,7 +468,7 @@ def get( :rtype: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_images_operations.py index 952c5798734e..14c398ed89ed 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VirtualMachineImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( version, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineImage" + # type: (...) -> "_models.VirtualMachineImage" """Gets a virtual machine image. :param location: The name of a supported Azure region. @@ -71,7 +71,7 @@ def get( :rtype: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -126,7 +126,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. @@ -149,7 +149,7 @@ def list( :rtype: list[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -204,7 +204,7 @@ def list_offers( publisher_name, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image offers for the specified location and publisher. :param location: The name of a supported Azure region. @@ -216,7 +216,7 @@ def list_offers( :rtype: list[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,7 +262,7 @@ def list_publishers( location, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image publishers for the specified Azure location. :param location: The name of a supported Azure region. @@ -272,7 +272,7 @@ def list_publishers( :rtype: list[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -319,7 +319,7 @@ def list_skus( offer, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. :param location: The name of a supported Azure region. @@ -333,7 +333,7 @@ def list_skus( :rtype: list[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_set_vms_operations.py index 84f113bff444..88045ce765e3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_set_vms_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetVMsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,8 +54,8 @@ def _reimage_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,7 +106,7 @@ def begin_reimage( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ def begin_reimage( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -172,8 +179,8 @@ def _deallocate_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -224,7 +231,7 @@ def begin_deallocate( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. @@ -246,7 +253,7 @@ def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -271,7 +278,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -292,8 +306,8 @@ def _delete_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -344,7 +358,7 @@ def begin_delete( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -364,7 +378,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -389,7 +403,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -410,7 +431,7 @@ def get( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVM" + # type: (...) -> "_models.VirtualMachineScaleSetVM" """Gets a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -424,7 +445,7 @@ def get( :rtype: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetVM :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -473,7 +494,7 @@ def get_instance_view( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVMInstanceView" + # type: (...) -> "_models.VirtualMachineScaleSetVMInstanceView" """Gets the status of a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -487,7 +508,7 @@ def get_instance_view( :rtype: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetVMInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -538,7 +559,7 @@ def list( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetVMListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetVMListResult"] """Gets a list of all virtual machines in a VM scale sets. :param resource_group_name: The name of the resource group. @@ -559,7 +580,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetVMListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -629,8 +650,8 @@ def _power_off_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -681,7 +702,7 @@ def begin_power_off( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. @@ -703,7 +724,7 @@ def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -728,7 +749,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -749,8 +777,8 @@ def _restart_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -801,7 +829,7 @@ def begin_restart( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -821,7 +849,7 @@ def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -846,7 +874,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -867,8 +902,8 @@ def _start_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -919,7 +954,7 @@ def begin_start( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -939,7 +974,7 @@ def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -964,7 +999,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_sets_operations.py index 5d377e2de081..9c2d9d7787ad 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str name, # type: str - parameters, # type: "models.VirtualMachineScaleSet" + parameters, # type: "_models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + # type: (...) -> "_models.VirtualMachineScaleSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str name, # type: str - parameters, # type: "models.VirtualMachineScaleSet" + parameters, # type: "_models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSet"] """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -177,8 +183,8 @@ def _delete_initial( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,7 +233,7 @@ def begin_delete( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -245,7 +251,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -269,7 +275,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -289,7 +301,7 @@ def get( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" + # type: (...) -> "_models.VirtualMachineScaleSet" """Display information about a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -301,7 +313,7 @@ def get( :rtype: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -346,11 +358,11 @@ def _deallocate_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,10 +417,10 @@ def begin_deallocate( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. @@ -430,7 +442,7 @@ def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -455,7 +467,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -473,11 +491,11 @@ def _delete_instances_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,10 +547,10 @@ def begin_delete_instances( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -552,7 +570,7 @@ def begin_delete_instances( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -577,7 +595,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -597,7 +621,7 @@ def get_instance_view( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetInstanceView" + # type: (...) -> "_models.VirtualMachineScaleSetInstanceView" """Gets the status of a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -609,7 +633,7 @@ def get_instance_view( :rtype: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -655,7 +679,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListResult"] """Gets a list of all VM scale sets under a resource group. :param resource_group_name: The name of the resource group. @@ -665,7 +689,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -725,7 +749,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListWithLinkResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListWithLinkResult"] """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. @@ -735,7 +759,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetListWithLinkResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListWithLinkResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -796,7 +820,7 @@ def list_skus( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListSkusResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListSkusResult"] """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. @@ -809,7 +833,7 @@ def list_skus( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineScaleSetListSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -870,11 +894,11 @@ def _power_off_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -929,10 +953,10 @@ def begin_power_off( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. @@ -954,7 +978,7 @@ def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -979,7 +1003,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -997,11 +1027,11 @@ def _restart_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1056,10 +1086,10 @@ def begin_restart( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1079,7 +1109,7 @@ def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1104,7 +1134,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1122,11 +1158,11 @@ def _start_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1181,10 +1217,10 @@ def begin_start( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1204,7 +1240,7 @@ def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1229,7 +1265,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1247,11 +1289,11 @@ def _update_instances_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1303,10 +1345,10 @@ def begin_update_instances( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1326,7 +1368,7 @@ def begin_update_instances( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1351,7 +1393,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1371,8 +1419,8 @@ def _reimage_initial( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1421,7 +1469,7 @@ def begin_reimage( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1439,7 +1487,7 @@ def begin_reimage( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1463,7 +1511,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_sizes_operations.py index 93d62f3dc530..38e4c322e5c0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_sizes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VirtualMachineSizesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes for a subscription in a location. :param location: The location upon which virtual-machine-sizes is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machines_operations.py index 38c18652b760..86c96f3db2de 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machines_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachinesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get_extensions( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtensionsListResult" + # type: (...) -> "_models.VirtualMachineExtensionsListResult" """The operation to get all extensions of a Virtual Machine. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def get_extensions( :rtype: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachineExtensionsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,11 +115,11 @@ def _capture_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineCaptureParameters" + parameters, # type: "_models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualMachineCaptureResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + # type: (...) -> Optional["_models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualMachineCaptureResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -171,10 +171,10 @@ def begin_capture( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineCaptureParameters" + parameters, # type: "_models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineCaptureResult"] + # type: (...) -> LROPoller["_models.VirtualMachineCaptureResult"] """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -195,7 +195,7 @@ def begin_capture( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -220,7 +220,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -238,11 +244,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachine" + parameters, # type: "_models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + # type: (...) -> "_models.VirtualMachine" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -296,10 +302,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachine" + parameters, # type: "_models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachine"] + # type: (...) -> LROPoller["_models.VirtualMachine"] """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -319,7 +325,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -344,7 +350,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -364,8 +376,8 @@ def _delete_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +426,7 @@ def begin_delete( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -432,7 +444,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -456,7 +468,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -477,7 +495,7 @@ def get( expand="instanceView", # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" + # type: (...) -> "_models.VirtualMachine" """Retrieves information about the model view or the instance view of a virtual machine. :param resource_group_name: The name of the resource group. @@ -491,7 +509,7 @@ def get( :rtype: ~azure.mgmt.compute.v2016_03_30.models.VirtualMachine :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -540,8 +558,8 @@ def _deallocate_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -590,7 +608,7 @@ def begin_deallocate( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. @@ -609,7 +627,7 @@ def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -633,7 +651,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -653,7 +677,7 @@ def generalize( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" + # type: (...) -> "_models.OperationStatusResponse" """Sets the state of the virtual machine to generalized. :param resource_group_name: The name of the resource group. @@ -665,7 +689,7 @@ def generalize( :rtype: ~azure.mgmt.compute.v2016_03_30.models.OperationStatusResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -711,7 +735,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. @@ -722,7 +746,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -782,7 +806,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. @@ -791,7 +815,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -852,7 +876,7 @@ def list_available_sizes( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes to which the specified virtual machine can be resized. @@ -865,7 +889,7 @@ def list_available_sizes( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_03_30.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -928,8 +952,8 @@ def _power_off_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -978,7 +1002,7 @@ def begin_power_off( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. @@ -997,7 +1021,7 @@ def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1021,7 +1045,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1041,8 +1071,8 @@ def _restart_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1091,7 +1121,7 @@ def begin_restart( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1109,7 +1139,7 @@ def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1133,7 +1163,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1153,8 +1189,8 @@ def _start_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1203,7 +1239,7 @@ def begin_start( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1221,7 +1257,7 @@ def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1245,7 +1281,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1265,8 +1307,8 @@ def _redeploy_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1315,7 +1357,7 @@ def begin_redeploy( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1333,7 +1375,7 @@ def begin_redeploy( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1357,7 +1399,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_compute_management_client.py index c08c09d03e0b..78e44772189d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_compute_management_client.py @@ -83,7 +83,6 @@ def __init__( 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.availability_sets = AvailabilitySetsOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_metadata.json index 4d29350aa90e..62448e4f1afc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/_compute_management_client.py index 5a3172727c21..e09d7b7b333c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/_compute_management_client.py @@ -80,7 +80,6 @@ def __init__( 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.availability_sets = AvailabilitySetsOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_availability_sets_operations.py index 0827933e711f..7d47062ed3b6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_availability_sets_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailabilitySetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, name: str, - parameters: "models.AvailabilitySet", + parameters: "_models.AvailabilitySet", **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Create or update an availability set. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,7 +112,7 @@ async def delete( resource_group_name: str, availability_set_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: + ) -> Optional["_models.OperationStatusResponse"]: """Delete an availability set. :param resource_group_name: The name of the resource group. @@ -124,7 +124,7 @@ async def delete( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -172,7 +172,7 @@ async def get( resource_group_name: str, availability_set_name: str, **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Retrieves information about an availability set. :param resource_group_name: The name of the resource group. @@ -184,7 +184,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,7 +228,7 @@ async def get( def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.AvailabilitySetListResult"]: + ) -> AsyncIterable["_models.AvailabilitySetListResult"]: """Lists all availability sets in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -236,7 +236,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,7 +295,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailabilitySetListResult"]: + ) -> AsyncIterable["_models.AvailabilitySetListResult"]: """Lists all availability sets in a resource group. :param resource_group_name: The name of the resource group. @@ -305,7 +305,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -366,7 +366,7 @@ def list_available_sizes( resource_group_name: str, availability_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. @@ -379,7 +379,7 @@ def list_available_sizes( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_disks_operations.py index c2eba1321480..ec6d7a8c5cf6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_disks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DisksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, disk_name: str, - disk: "models.Disk", + disk: "_models.Disk", **kwargs - ) -> "models.Disk": - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + ) -> "_models.Disk": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, disk_name: str, - disk: "models.Disk", + disk: "_models.Disk", **kwargs - ) -> AsyncLROPoller["models.Disk"]: + ) -> AsyncLROPoller["_models.Disk"]: """Creates or updates a disk. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -171,10 +177,10 @@ async def _update_initial( self, resource_group_name: str, disk_name: str, - disk: "models.DiskUpdate", + disk: "_models.DiskUpdate", **kwargs - ) -> "models.Disk": - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + ) -> "_models.Disk": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,9 +234,9 @@ async def begin_update( self, resource_group_name: str, disk_name: str, - disk: "models.DiskUpdate", + disk: "_models.DiskUpdate", **kwargs - ) -> AsyncLROPoller["models.Disk"]: + ) -> AsyncLROPoller["_models.Disk"]: """Updates (patches) a disk. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -296,7 +308,7 @@ async def get( resource_group_name: str, disk_name: str, **kwargs - ) -> "models.Disk": + ) -> "_models.Disk": """Gets information about a disk. :param resource_group_name: The name of the resource group. @@ -310,7 +322,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.Disk :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -356,8 +368,8 @@ async def _delete_initial( resource_group_name: str, disk_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +417,7 @@ async def begin_delete( resource_group_name: str, disk_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deletes a disk. :param resource_group_name: The name of the resource group. @@ -425,7 +437,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -449,7 +461,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -467,7 +485,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DiskList"]: + ) -> AsyncIterable["_models.DiskList"]: """Lists all the disks under a resource group. :param resource_group_name: The name of the resource group. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -536,7 +554,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.DiskList"]: + ) -> AsyncIterable["_models.DiskList"]: """Lists all the disks under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -544,7 +562,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -603,10 +621,10 @@ async def _grant_access_initial( self, resource_group_name: str, disk_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> Optional["models.AccessUri"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + ) -> Optional["_models.AccessUri"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,9 +676,9 @@ async def begin_grant_access( self, resource_group_name: str, disk_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> AsyncLROPoller["models.AccessUri"]: + ) -> AsyncLROPoller["_models.AccessUri"]: """Grants access to a disk. :param resource_group_name: The name of the resource group. @@ -683,7 +701,7 @@ async def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -708,7 +726,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -727,8 +751,8 @@ async def _revoke_access_initial( resource_group_name: str, disk_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -776,7 +800,7 @@ async def begin_revoke_access( resource_group_name: str, disk_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Revokes access to a disk. :param resource_group_name: The name of the resource group. @@ -796,7 +820,7 @@ async def begin_revoke_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -820,7 +844,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_images_operations.py index 17d28063ba64..cc9fa3b08f68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, image_name: str, - parameters: "models.Image", + parameters: "_models.Image", **kwargs - ) -> "models.Image": - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + ) -> "_models.Image": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, image_name: str, - parameters: "models.Image", + parameters: "_models.Image", **kwargs - ) -> AsyncLROPoller["models.Image"]: + ) -> AsyncLROPoller["_models.Image"]: """Create or update an image. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -170,8 +176,8 @@ async def _delete_initial( resource_group_name: str, image_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,7 +225,7 @@ async def begin_delete( resource_group_name: str, image_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deletes an Image. :param resource_group_name: The name of the resource group. @@ -237,7 +243,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -261,7 +267,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -281,7 +293,7 @@ async def get( image_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Image": + ) -> "_models.Image": """Gets an image. :param resource_group_name: The name of the resource group. @@ -295,7 +307,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.Image :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -342,7 +354,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ImageListResult"]: + ) -> AsyncIterable["_models.ImageListResult"]: """Gets the list of images under a resource group. :param resource_group_name: The name of the resource group. @@ -352,7 +364,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +423,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ImageListResult"]: + ) -> AsyncIterable["_models.ImageListResult"]: """Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. @@ -420,7 +432,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_snapshots_operations.py index dd65efcd389e..736014aa599f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_snapshots_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SnapshotsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.Snapshot", + snapshot: "_models.Snapshot", **kwargs - ) -> "models.Snapshot": - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + ) -> "_models.Snapshot": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.Snapshot", + snapshot: "_models.Snapshot", **kwargs - ) -> AsyncLROPoller["models.Snapshot"]: + ) -> AsyncLROPoller["_models.Snapshot"]: """Creates or updates a snapshot. :param resource_group_name: The name of the resource group. @@ -127,7 +127,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -152,7 +152,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -170,10 +176,10 @@ async def _update_initial( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.SnapshotUpdate", + snapshot: "_models.SnapshotUpdate", **kwargs - ) -> "models.Snapshot": - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + ) -> "_models.Snapshot": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,9 +233,9 @@ async def begin_update( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.SnapshotUpdate", + snapshot: "_models.SnapshotUpdate", **kwargs - ) -> AsyncLROPoller["models.Snapshot"]: + ) -> AsyncLROPoller["_models.Snapshot"]: """Updates (patches) a snapshot. :param resource_group_name: The name of the resource group. @@ -250,7 +256,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -275,7 +281,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -294,7 +306,7 @@ async def get( resource_group_name: str, snapshot_name: str, **kwargs - ) -> "models.Snapshot": + ) -> "_models.Snapshot": """Gets information about a snapshot. :param resource_group_name: The name of the resource group. @@ -307,7 +319,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.Snapshot :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -353,8 +365,8 @@ async def _delete_initial( resource_group_name: str, snapshot_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -402,7 +414,7 @@ async def begin_delete( resource_group_name: str, snapshot_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deletes a snapshot. :param resource_group_name: The name of the resource group. @@ -421,7 +433,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -445,7 +457,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -463,7 +481,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.SnapshotList"]: + ) -> AsyncIterable["_models.SnapshotList"]: """Lists snapshots under a resource group. :param resource_group_name: The name of the resource group. @@ -473,7 +491,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -532,7 +550,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.SnapshotList"]: + ) -> AsyncIterable["_models.SnapshotList"]: """Lists snapshots under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -540,7 +558,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -599,10 +617,10 @@ async def _grant_access_initial( self, resource_group_name: str, snapshot_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> Optional["models.AccessUri"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + ) -> Optional["_models.AccessUri"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -654,9 +672,9 @@ async def begin_grant_access( self, resource_group_name: str, snapshot_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> AsyncLROPoller["models.AccessUri"]: + ) -> AsyncLROPoller["_models.AccessUri"]: """Grants access to a snapshot. :param resource_group_name: The name of the resource group. @@ -678,7 +696,7 @@ async def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -703,7 +721,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -722,8 +746,8 @@ async def _revoke_access_initial( resource_group_name: str, snapshot_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -771,7 +795,7 @@ async def begin_revoke_access( resource_group_name: str, snapshot_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Revokes access to a snapshot. :param resource_group_name: The name of the resource group. @@ -790,7 +814,7 @@ async def begin_revoke_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -814,7 +838,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_usage_operations.py index 42e853bca174..556ebbf0b45e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsageOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.ListUsagesResult"]: + ) -> AsyncIterable["_models.ListUsagesResult"]: """Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extension_images_operations.py index 013027f96fab..fb8efcb408f7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extension_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VirtualMachineExtensionImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( type: str, version: str, **kwargs - ) -> "models.VirtualMachineExtensionImage": + ) -> "_models.VirtualMachineExtensionImage": """Gets a virtual machine extension image. :param location: The name of a supported Azure region. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineExtensionImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,7 +111,7 @@ async def list_types( location: str, publisher_name: str, **kwargs - ) -> List["models.VirtualMachineExtensionImage"]: + ) -> List["_models.VirtualMachineExtensionImage"]: """Gets a list of virtual machine extension image types. :param location: The name of a supported Azure region. @@ -123,7 +123,7 @@ async def list_types( :rtype: list[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -173,7 +173,7 @@ async def list_versions( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> List["models.VirtualMachineExtensionImage"]: + ) -> List["_models.VirtualMachineExtensionImage"]: """Gets a list of virtual machine extension image versions. :param location: The name of a supported Azure region. @@ -193,7 +193,7 @@ async def list_versions( :rtype: list[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extensions_operations.py index 03414a2c83d4..0fd249dcca25 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VirtualMachineExtensionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineExtension", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineExtension", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineExtension"]: """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -177,10 +184,10 @@ async def _update_initial( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineExtensionUpdate", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -232,9 +239,9 @@ async def begin_update( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineExtensionUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineExtension"]: """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -257,7 +264,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -283,7 +290,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -303,8 +317,8 @@ async def _delete_initial( vm_name: str, vm_extension_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,7 +368,7 @@ async def begin_delete( vm_name: str, vm_extension_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -374,7 +388,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -399,7 +413,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -420,7 +441,7 @@ async def get( vm_extension_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtension": + ) -> "_models.VirtualMachineExtension": """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -436,7 +457,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_images_operations.py index 9d4843febaf4..05110ce364fc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VirtualMachineImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( skus: str, version: str, **kwargs - ) -> "models.VirtualMachineImage": + ) -> "_models.VirtualMachineImage": """Gets a virtual machine image. :param location: The name of a supported Azure region. @@ -66,7 +66,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,7 +120,7 @@ async def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. @@ -143,7 +143,7 @@ async def list( :rtype: list[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -197,7 +197,7 @@ async def list_offers( location: str, publisher_name: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image offers for the specified location and publisher. :param location: The name of a supported Azure region. @@ -209,7 +209,7 @@ async def list_offers( :rtype: list[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -254,7 +254,7 @@ async def list_publishers( self, location: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image publishers for the specified Azure location. :param location: The name of a supported Azure region. @@ -264,7 +264,7 @@ async def list_publishers( :rtype: list[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -310,7 +310,7 @@ async def list_skus( publisher_name: str, offer: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. :param location: The name of a supported Azure region. @@ -324,7 +324,7 @@ async def list_skus( :rtype: list[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_set_vms_operations.py index 6f20b94404e1..a51dfc13e185 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetVMsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,8 +49,8 @@ async def _reimage_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ async def begin_reimage( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -120,7 +120,7 @@ async def begin_reimage( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -145,7 +145,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -165,8 +172,8 @@ async def _reimage_all_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +223,7 @@ async def begin_reimage_all( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. @@ -237,7 +244,7 @@ async def begin_reimage_all( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -262,7 +269,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -282,8 +296,8 @@ async def _deallocate_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -333,7 +347,7 @@ async def begin_deallocate( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. @@ -355,7 +369,7 @@ async def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -380,7 +394,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -400,8 +421,8 @@ async def _delete_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -451,7 +472,7 @@ async def begin_delete( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -471,7 +492,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -496,7 +517,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -516,7 +544,7 @@ async def get( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.VirtualMachineScaleSetVM": + ) -> "_models.VirtualMachineScaleSetVM": """Gets a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -530,7 +558,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetVM :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +606,7 @@ async def get_instance_view( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.VirtualMachineScaleSetVMInstanceView": + ) -> "_models.VirtualMachineScaleSetVMInstanceView": """Gets the status of a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -592,7 +620,7 @@ async def get_instance_view( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetVMInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -642,7 +670,7 @@ def list( select: Optional[str] = None, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetVMListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetVMListResult"]: """Gets a list of all virtual machines in a VM scale sets. :param resource_group_name: The name of the resource group. @@ -660,7 +688,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetVMListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -729,8 +757,8 @@ async def _power_off_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -780,7 +808,7 @@ async def begin_power_off( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. @@ -802,7 +830,7 @@ async def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -827,7 +855,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -847,8 +882,8 @@ async def _restart_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -898,7 +933,7 @@ async def begin_restart( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -918,7 +953,7 @@ async def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -943,7 +978,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -963,8 +1005,8 @@ async def _start_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1014,7 +1056,7 @@ async def begin_start( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1034,7 +1076,7 @@ async def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1059,7 +1101,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_sets_operations.py index 92ef3158490e..be650cbd91c1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, name: str, - parameters: "models.VirtualMachineScaleSet", + parameters: "_models.VirtualMachineScaleSet", **kwargs - ) -> "models.VirtualMachineScaleSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + ) -> "_models.VirtualMachineScaleSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, name: str, - parameters: "models.VirtualMachineScaleSet", + parameters: "_models.VirtualMachineScaleSet", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSet"]: """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -170,8 +176,8 @@ async def _delete_initial( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,7 +225,7 @@ async def begin_delete( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -237,7 +243,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -261,7 +267,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -280,7 +292,7 @@ async def get( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> "_models.VirtualMachineScaleSet": """Display information about a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -292,7 +304,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -337,10 +349,10 @@ async def _deallocate_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -395,9 +407,9 @@ async def begin_deallocate( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. @@ -419,7 +431,7 @@ async def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -444,7 +456,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -462,10 +480,10 @@ async def _delete_instances_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -517,9 +535,9 @@ async def begin_delete_instances( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -539,7 +557,7 @@ async def begin_delete_instances( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -564,7 +582,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -583,7 +607,7 @@ async def get_instance_view( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.VirtualMachineScaleSetInstanceView": + ) -> "_models.VirtualMachineScaleSetInstanceView": """Gets the status of a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -595,7 +619,7 @@ async def get_instance_view( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -640,7 +664,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListResult"]: """Gets a list of all VM scale sets under a resource group. :param resource_group_name: The name of the resource group. @@ -650,7 +674,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -709,7 +733,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListWithLinkResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListWithLinkResult"]: """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. @@ -719,7 +743,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetListWithLinkResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListWithLinkResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -779,7 +803,7 @@ def list_skus( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListSkusResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListSkusResult"]: """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. @@ -792,7 +816,7 @@ def list_skus( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetListSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -853,10 +877,10 @@ async def _power_off_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -911,9 +935,9 @@ async def begin_power_off( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. @@ -935,7 +959,7 @@ async def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -960,7 +984,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -978,10 +1008,10 @@ async def _restart_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1036,9 +1066,9 @@ async def begin_restart( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1058,7 +1088,7 @@ async def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1083,7 +1113,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1101,10 +1137,10 @@ async def _start_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1159,9 +1195,9 @@ async def begin_start( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1181,7 +1217,7 @@ async def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1206,7 +1242,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1224,10 +1266,10 @@ async def _update_instances_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1279,9 +1321,9 @@ async def begin_update_instances( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1301,7 +1343,7 @@ async def begin_update_instances( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1326,7 +1368,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1345,8 +1393,8 @@ async def _reimage_initial( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1394,7 +1442,7 @@ async def begin_reimage( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1412,7 +1460,7 @@ async def begin_reimage( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1436,7 +1484,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1455,8 +1509,8 @@ async def _reimage_all_initial( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1504,7 +1558,7 @@ async def begin_reimage_all( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. @@ -1523,7 +1577,7 @@ async def begin_reimage_all( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1547,7 +1601,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_sizes_operations.py index de9a09c33384..7c7b26e13091 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_sizes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VirtualMachineSizesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes for a subscription in a location. :param location: The location upon which virtual-machine-sizes is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machines_operations.py index 4cf5d181cedc..57351210e625 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machines_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachinesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get_extensions( vm_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtensionsListResult": + ) -> "_models.VirtualMachineExtensionsListResult": """The operation to get all extensions of a Virtual Machine. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def get_extensions( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineExtensionsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,10 +110,10 @@ async def _capture_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineCaptureParameters", + parameters: "_models.VirtualMachineCaptureParameters", **kwargs - ) -> Optional["models.VirtualMachineCaptureResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + ) -> Optional["_models.VirtualMachineCaptureResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualMachineCaptureResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -165,9 +165,9 @@ async def begin_capture( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineCaptureParameters", + parameters: "_models.VirtualMachineCaptureParameters", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineCaptureResult"]: + ) -> AsyncLROPoller["_models.VirtualMachineCaptureResult"]: """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -188,7 +188,7 @@ async def begin_capture( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -213,7 +213,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -231,10 +237,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachine", + parameters: "_models.VirtualMachine", **kwargs - ) -> "models.VirtualMachine": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + ) -> "_models.VirtualMachine": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,9 +294,9 @@ async def begin_create_or_update( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachine", + parameters: "_models.VirtualMachine", **kwargs - ) -> AsyncLROPoller["models.VirtualMachine"]: + ) -> AsyncLROPoller["_models.VirtualMachine"]: """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -310,7 +316,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,7 +341,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -354,8 +366,8 @@ async def _delete_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -403,7 +415,7 @@ async def begin_delete( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -421,7 +433,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -445,7 +457,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -465,7 +483,7 @@ async def get( vm_name: str, expand: Optional[str] = "instanceView", **kwargs - ) -> "models.VirtualMachine": + ) -> "_models.VirtualMachine": """Retrieves information about the model view or the instance view of a virtual machine. :param resource_group_name: The name of the resource group. @@ -479,7 +497,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachine :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -527,8 +545,8 @@ async def _convert_to_managed_disks_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -576,7 +594,7 @@ async def begin_convert_to_managed_disks( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- deallocated before invoking this operation. @@ -595,7 +613,7 @@ async def begin_convert_to_managed_disks( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -619,7 +637,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -638,8 +662,8 @@ async def _deallocate_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -687,7 +711,7 @@ async def begin_deallocate( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. @@ -706,7 +730,7 @@ async def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -730,7 +754,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -749,7 +779,7 @@ async def generalize( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> "_models.OperationStatusResponse": """Sets the state of the virtual machine to generalized. :param resource_group_name: The name of the resource group. @@ -761,7 +791,7 @@ async def generalize( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -806,7 +836,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. @@ -817,7 +847,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -876,7 +906,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. @@ -885,7 +915,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -945,7 +975,7 @@ def list_available_sizes( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes to which the specified virtual machine can be resized. @@ -958,7 +988,7 @@ def list_available_sizes( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1020,8 +1050,8 @@ async def _power_off_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1069,7 +1099,7 @@ async def begin_power_off( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. @@ -1088,7 +1118,7 @@ async def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1112,7 +1142,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1131,8 +1167,8 @@ async def _restart_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1180,7 +1216,7 @@ async def begin_restart( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1198,7 +1234,7 @@ async def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1222,7 +1258,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1241,8 +1283,8 @@ async def _start_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1290,7 +1332,7 @@ async def begin_start( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1308,7 +1350,7 @@ async def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1332,7 +1374,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1351,8 +1399,8 @@ async def _redeploy_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1400,7 +1448,7 @@ async def begin_redeploy( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1418,7 +1466,7 @@ async def begin_redeploy( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1442,7 +1490,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_availability_sets_operations.py index ad8549434483..579bbd69e59e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_availability_sets_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailabilitySetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str name, # type: str - parameters, # type: "models.AvailabilitySet" + parameters, # type: "_models.AvailabilitySet" **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Create or update an availability set. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,7 +118,7 @@ def delete( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] + # type: (...) -> Optional["_models.OperationStatusResponse"] """Delete an availability set. :param resource_group_name: The name of the resource group. @@ -130,7 +130,7 @@ def delete( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -179,7 +179,7 @@ def get( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Retrieves information about an availability set. :param resource_group_name: The name of the resource group. @@ -191,7 +191,7 @@ def get( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -236,7 +236,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailabilitySetListResult"] + # type: (...) -> Iterable["_models.AvailabilitySetListResult"] """Lists all availability sets in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -244,7 +244,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -304,7 +304,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailabilitySetListResult"] + # type: (...) -> Iterable["_models.AvailabilitySetListResult"] """Lists all availability sets in a resource group. :param resource_group_name: The name of the resource group. @@ -314,7 +314,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -376,7 +376,7 @@ def list_available_sizes( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. @@ -389,7 +389,7 @@ def list_available_sizes( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_disks_operations.py index a76b30749fd1..ca7fcd76a16e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_disks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DisksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.Disk" + disk, # type: "_models.Disk" **kwargs # type: Any ): - # type: (...) -> "models.Disk" - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + # type: (...) -> "_models.Disk" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.Disk" + disk, # type: "_models.Disk" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Disk"] + # type: (...) -> LROPoller["_models.Disk"] """Creates or updates a disk. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -177,11 +183,11 @@ def _update_initial( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.DiskUpdate" + disk, # type: "_models.DiskUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Disk" - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + # type: (...) -> "_models.Disk" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,10 +241,10 @@ def begin_update( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.DiskUpdate" + disk, # type: "_models.DiskUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Disk"] + # type: (...) -> LROPoller["_models.Disk"] """Updates (patches) a disk. :param resource_group_name: The name of the resource group. @@ -260,7 +266,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -285,7 +291,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -305,7 +317,7 @@ def get( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Disk" + # type: (...) -> "_models.Disk" """Gets information about a disk. :param resource_group_name: The name of the resource group. @@ -319,7 +331,7 @@ def get( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.Disk :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -366,8 +378,8 @@ def _delete_initial( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -416,7 +428,7 @@ def begin_delete( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deletes a disk. :param resource_group_name: The name of the resource group. @@ -436,7 +448,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -460,7 +472,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -479,7 +497,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskList"] + # type: (...) -> Iterable["_models.DiskList"] """Lists all the disks under a resource group. :param resource_group_name: The name of the resource group. @@ -489,7 +507,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -549,7 +567,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskList"] + # type: (...) -> Iterable["_models.DiskList"] """Lists all the disks under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -557,7 +575,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -616,11 +634,11 @@ def _grant_access_initial( self, resource_group_name, # type: str disk_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> Optional["models.AccessUri"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + # type: (...) -> Optional["_models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -672,10 +690,10 @@ def begin_grant_access( self, resource_group_name, # type: str disk_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AccessUri"] + # type: (...) -> LROPoller["_models.AccessUri"] """Grants access to a disk. :param resource_group_name: The name of the resource group. @@ -698,7 +716,7 @@ def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -723,7 +741,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -743,8 +767,8 @@ def _revoke_access_initial( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -793,7 +817,7 @@ def begin_revoke_access( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Revokes access to a disk. :param resource_group_name: The name of the resource group. @@ -813,7 +837,7 @@ def begin_revoke_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -837,7 +861,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_images_operations.py index 7c59e5f2d6e9..2cbf8d9674fd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.Image" + parameters, # type: "_models.Image" **kwargs # type: Any ): - # type: (...) -> "models.Image" - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + # type: (...) -> "_models.Image" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.Image" + parameters, # type: "_models.Image" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Image"] + # type: (...) -> LROPoller["_models.Image"] """Create or update an image. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -177,8 +183,8 @@ def _delete_initial( image_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,7 +233,7 @@ def begin_delete( image_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deletes an Image. :param resource_group_name: The name of the resource group. @@ -245,7 +251,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -269,7 +275,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -290,7 +302,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Image" + # type: (...) -> "_models.Image" """Gets an image. :param resource_group_name: The name of the resource group. @@ -304,7 +316,7 @@ def get( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.Image :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -352,7 +364,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ImageListResult"] + # type: (...) -> Iterable["_models.ImageListResult"] """Gets the list of images under a resource group. :param resource_group_name: The name of the resource group. @@ -362,7 +374,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -422,7 +434,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ImageListResult"] + # type: (...) -> Iterable["_models.ImageListResult"] """Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. @@ -431,7 +443,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_snapshots_operations.py index b85ad71a5b76..8c6e8e88b51c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_snapshots_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SnapshotsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.Snapshot" + snapshot, # type: "_models.Snapshot" **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + # type: (...) -> "_models.Snapshot" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.Snapshot" + snapshot, # type: "_models.Snapshot" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Snapshot"] + # type: (...) -> LROPoller["_models.Snapshot"] """Creates or updates a snapshot. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -176,11 +182,11 @@ def _update_initial( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.SnapshotUpdate" + snapshot, # type: "_models.SnapshotUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + # type: (...) -> "_models.Snapshot" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -234,10 +240,10 @@ def begin_update( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.SnapshotUpdate" + snapshot, # type: "_models.SnapshotUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Snapshot"] + # type: (...) -> LROPoller["_models.Snapshot"] """Updates (patches) a snapshot. :param resource_group_name: The name of the resource group. @@ -258,7 +264,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -283,7 +289,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -303,7 +315,7 @@ def get( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" + # type: (...) -> "_models.Snapshot" """Gets information about a snapshot. :param resource_group_name: The name of the resource group. @@ -316,7 +328,7 @@ def get( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.Snapshot :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -363,8 +375,8 @@ def _delete_initial( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,7 +425,7 @@ def begin_delete( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deletes a snapshot. :param resource_group_name: The name of the resource group. @@ -432,7 +444,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -456,7 +468,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -475,7 +493,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SnapshotList"] + # type: (...) -> Iterable["_models.SnapshotList"] """Lists snapshots under a resource group. :param resource_group_name: The name of the resource group. @@ -485,7 +503,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -545,7 +563,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.SnapshotList"] + # type: (...) -> Iterable["_models.SnapshotList"] """Lists snapshots under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -553,7 +571,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -612,11 +630,11 @@ def _grant_access_initial( self, resource_group_name, # type: str snapshot_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> Optional["models.AccessUri"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + # type: (...) -> Optional["_models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -668,10 +686,10 @@ def begin_grant_access( self, resource_group_name, # type: str snapshot_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AccessUri"] + # type: (...) -> LROPoller["_models.AccessUri"] """Grants access to a snapshot. :param resource_group_name: The name of the resource group. @@ -693,7 +711,7 @@ def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -718,7 +736,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -738,8 +762,8 @@ def _revoke_access_initial( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -788,7 +812,7 @@ def begin_revoke_access( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Revokes access to a snapshot. :param resource_group_name: The name of the resource group. @@ -807,7 +831,7 @@ def begin_revoke_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -831,7 +855,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_usage_operations.py index 4d67acac46cf..21feed139234 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsageOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListUsagesResult"] + # type: (...) -> Iterable["_models.ListUsagesResult"] """Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extension_images_operations.py index 7446adba613d..ad6ca394b0fe 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extension_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VirtualMachineExtensionImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( version, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtensionImage" + # type: (...) -> "_models.VirtualMachineExtensionImage" """Gets a virtual machine extension image. :param location: The name of a supported Azure region. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineExtensionImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def list_types( publisher_name, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineExtensionImage"] + # type: (...) -> List["_models.VirtualMachineExtensionImage"] """Gets a list of virtual machine extension image types. :param location: The name of a supported Azure region. @@ -129,7 +129,7 @@ def list_types( :rtype: list[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -180,7 +180,7 @@ def list_versions( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineExtensionImage"] + # type: (...) -> List["_models.VirtualMachineExtensionImage"] """Gets a list of virtual machine extension image versions. :param location: The name of a supported Azure region. @@ -200,7 +200,7 @@ def list_versions( :rtype: list[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extensions_operations.py index be1468c22be5..62cc07901269 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VirtualMachineExtensionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineExtension"] """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -183,11 +190,11 @@ def _update_initial( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -239,10 +246,10 @@ def begin_update( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineExtension"] """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -265,7 +272,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -291,7 +298,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -312,8 +326,8 @@ def _delete_initial( vm_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -364,7 +378,7 @@ def begin_delete( vm_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -384,7 +398,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -409,7 +423,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -431,7 +452,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" + # type: (...) -> "_models.VirtualMachineExtension" """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -447,7 +468,7 @@ def get( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_images_operations.py index af213b211190..ec4daf546b61 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VirtualMachineImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( version, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineImage" + # type: (...) -> "_models.VirtualMachineImage" """Gets a virtual machine image. :param location: The name of a supported Azure region. @@ -71,7 +71,7 @@ def get( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -126,7 +126,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. @@ -149,7 +149,7 @@ def list( :rtype: list[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -204,7 +204,7 @@ def list_offers( publisher_name, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image offers for the specified location and publisher. :param location: The name of a supported Azure region. @@ -216,7 +216,7 @@ def list_offers( :rtype: list[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,7 +262,7 @@ def list_publishers( location, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image publishers for the specified Azure location. :param location: The name of a supported Azure region. @@ -272,7 +272,7 @@ def list_publishers( :rtype: list[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -319,7 +319,7 @@ def list_skus( offer, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. :param location: The name of a supported Azure region. @@ -333,7 +333,7 @@ def list_skus( :rtype: list[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_set_vms_operations.py index 345fd31a2f65..b0a97fd635a7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_set_vms_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetVMsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,8 +54,8 @@ def _reimage_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,7 +106,7 @@ def begin_reimage( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ def begin_reimage( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -172,8 +179,8 @@ def _reimage_all_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -224,7 +231,7 @@ def begin_reimage_all( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. @@ -245,7 +252,7 @@ def begin_reimage_all( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -270,7 +277,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -291,8 +305,8 @@ def _deallocate_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -343,7 +357,7 @@ def begin_deallocate( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. @@ -365,7 +379,7 @@ def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -390,7 +404,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -411,8 +432,8 @@ def _delete_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -463,7 +484,7 @@ def begin_delete( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -483,7 +504,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -508,7 +529,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -529,7 +557,7 @@ def get( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVM" + # type: (...) -> "_models.VirtualMachineScaleSetVM" """Gets a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -543,7 +571,7 @@ def get( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetVM :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -592,7 +620,7 @@ def get_instance_view( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVMInstanceView" + # type: (...) -> "_models.VirtualMachineScaleSetVMInstanceView" """Gets the status of a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -606,7 +634,7 @@ def get_instance_view( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetVMInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -657,7 +685,7 @@ def list( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetVMListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetVMListResult"] """Gets a list of all virtual machines in a VM scale sets. :param resource_group_name: The name of the resource group. @@ -675,7 +703,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetVMListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -745,8 +773,8 @@ def _power_off_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -797,7 +825,7 @@ def begin_power_off( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. @@ -819,7 +847,7 @@ def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -844,7 +872,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -865,8 +900,8 @@ def _restart_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -917,7 +952,7 @@ def begin_restart( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -937,7 +972,7 @@ def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -962,7 +997,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -983,8 +1025,8 @@ def _start_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1035,7 +1077,7 @@ def begin_start( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1055,7 +1097,7 @@ def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1080,7 +1122,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_sets_operations.py index 3f71471fd314..35dec6b61d1c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str name, # type: str - parameters, # type: "models.VirtualMachineScaleSet" + parameters, # type: "_models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + # type: (...) -> "_models.VirtualMachineScaleSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str name, # type: str - parameters, # type: "models.VirtualMachineScaleSet" + parameters, # type: "_models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSet"] """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -177,8 +183,8 @@ def _delete_initial( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,7 +233,7 @@ def begin_delete( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -245,7 +251,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -269,7 +275,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -289,7 +301,7 @@ def get( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" + # type: (...) -> "_models.VirtualMachineScaleSet" """Display information about a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -301,7 +313,7 @@ def get( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -346,11 +358,11 @@ def _deallocate_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,10 +417,10 @@ def begin_deallocate( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. @@ -430,7 +442,7 @@ def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -455,7 +467,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -473,11 +491,11 @@ def _delete_instances_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -529,10 +547,10 @@ def begin_delete_instances( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -552,7 +570,7 @@ def begin_delete_instances( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -577,7 +595,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -597,7 +621,7 @@ def get_instance_view( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetInstanceView" + # type: (...) -> "_models.VirtualMachineScaleSetInstanceView" """Gets the status of a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -609,7 +633,7 @@ def get_instance_view( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -655,7 +679,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListResult"] """Gets a list of all VM scale sets under a resource group. :param resource_group_name: The name of the resource group. @@ -665,7 +689,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -725,7 +749,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListWithLinkResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListWithLinkResult"] """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. @@ -735,7 +759,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetListWithLinkResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListWithLinkResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -796,7 +820,7 @@ def list_skus( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListSkusResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListSkusResult"] """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. @@ -809,7 +833,7 @@ def list_skus( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineScaleSetListSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -870,11 +894,11 @@ def _power_off_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -929,10 +953,10 @@ def begin_power_off( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. @@ -954,7 +978,7 @@ def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -979,7 +1003,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -997,11 +1027,11 @@ def _restart_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1056,10 +1086,10 @@ def begin_restart( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1079,7 +1109,7 @@ def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1104,7 +1134,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1122,11 +1158,11 @@ def _start_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1181,10 +1217,10 @@ def begin_start( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1204,7 +1240,7 @@ def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1229,7 +1265,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1247,11 +1289,11 @@ def _update_instances_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1303,10 +1345,10 @@ def begin_update_instances( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1326,7 +1368,7 @@ def begin_update_instances( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1351,7 +1393,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1371,8 +1419,8 @@ def _reimage_initial( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1421,7 +1469,7 @@ def begin_reimage( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1439,7 +1487,7 @@ def begin_reimage( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1463,7 +1511,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1483,8 +1537,8 @@ def _reimage_all_initial( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1533,7 +1587,7 @@ def begin_reimage_all( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. @@ -1552,7 +1606,7 @@ def begin_reimage_all( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1576,7 +1630,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_sizes_operations.py index d222ce07b06c..e3c38bf1e70b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_sizes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VirtualMachineSizesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes for a subscription in a location. :param location: The location upon which virtual-machine-sizes is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machines_operations.py index 0638f0459363..a34f120247b6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machines_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachinesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get_extensions( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtensionsListResult" + # type: (...) -> "_models.VirtualMachineExtensionsListResult" """The operation to get all extensions of a Virtual Machine. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def get_extensions( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineExtensionsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,11 +115,11 @@ def _capture_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineCaptureParameters" + parameters, # type: "_models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualMachineCaptureResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + # type: (...) -> Optional["_models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualMachineCaptureResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -171,10 +171,10 @@ def begin_capture( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineCaptureParameters" + parameters, # type: "_models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineCaptureResult"] + # type: (...) -> LROPoller["_models.VirtualMachineCaptureResult"] """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -195,7 +195,7 @@ def begin_capture( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -220,7 +220,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -238,11 +244,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachine" + parameters, # type: "_models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + # type: (...) -> "_models.VirtualMachine" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -296,10 +302,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachine" + parameters, # type: "_models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachine"] + # type: (...) -> LROPoller["_models.VirtualMachine"] """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -319,7 +325,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -344,7 +350,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -364,8 +376,8 @@ def _delete_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -414,7 +426,7 @@ def begin_delete( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -432,7 +444,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -456,7 +468,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -477,7 +495,7 @@ def get( expand="instanceView", # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" + # type: (...) -> "_models.VirtualMachine" """Retrieves information about the model view or the instance view of a virtual machine. :param resource_group_name: The name of the resource group. @@ -491,7 +509,7 @@ def get( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachine :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -540,8 +558,8 @@ def _convert_to_managed_disks_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -590,7 +608,7 @@ def begin_convert_to_managed_disks( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- deallocated before invoking this operation. @@ -609,7 +627,7 @@ def begin_convert_to_managed_disks( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -633,7 +651,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -653,8 +677,8 @@ def _deallocate_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -703,7 +727,7 @@ def begin_deallocate( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. @@ -722,7 +746,7 @@ def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -746,7 +770,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -766,7 +796,7 @@ def generalize( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" + # type: (...) -> "_models.OperationStatusResponse" """Sets the state of the virtual machine to generalized. :param resource_group_name: The name of the resource group. @@ -778,7 +808,7 @@ def generalize( :rtype: ~azure.mgmt.compute.v2016_04_30_preview.models.OperationStatusResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -824,7 +854,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. @@ -835,7 +865,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -895,7 +925,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. @@ -904,7 +934,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -965,7 +995,7 @@ def list_available_sizes( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes to which the specified virtual machine can be resized. @@ -978,7 +1008,7 @@ def list_available_sizes( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2016_04_30_preview.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1041,8 +1071,8 @@ def _power_off_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1091,7 +1121,7 @@ def begin_power_off( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. @@ -1110,7 +1140,7 @@ def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1134,7 +1164,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1154,8 +1190,8 @@ def _restart_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1204,7 +1240,7 @@ def begin_restart( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1222,7 +1258,7 @@ def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1246,7 +1282,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1266,8 +1308,8 @@ def _start_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1316,7 +1358,7 @@ def begin_start( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1334,7 +1376,7 @@ def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1358,7 +1400,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1378,8 +1426,8 @@ def _redeploy_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1428,7 +1476,7 @@ def begin_redeploy( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1446,7 +1494,7 @@ def begin_redeploy( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1470,7 +1518,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_compute_management_client.py index a3f24ad7ea95..1e1a2c60870a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_compute_management_client.py @@ -95,7 +95,6 @@ def __init__( 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.availability_sets = AvailabilitySetsOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_metadata.json index 39fc5d8bbecb..e85e400e7025 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/_compute_management_client.py index 133537d9ab00..f429d5f056b8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/_compute_management_client.py @@ -92,7 +92,6 @@ def __init__( 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.availability_sets = AvailabilitySetsOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_availability_sets_operations.py index dede21467625..cc475e233b56 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_availability_sets_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailabilitySetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, availability_set_name: str, - parameters: "models.AvailabilitySet", + parameters: "_models.AvailabilitySet", **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Create or update an availability set. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~azure.mgmt.compute.v2017_03_30.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,7 +112,7 @@ async def delete( resource_group_name: str, availability_set_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: + ) -> Optional["_models.OperationStatusResponse"]: """Delete an availability set. :param resource_group_name: The name of the resource group. @@ -124,7 +124,7 @@ async def delete( :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -172,7 +172,7 @@ async def get( resource_group_name: str, availability_set_name: str, **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Retrieves information about an availability set. :param resource_group_name: The name of the resource group. @@ -184,7 +184,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2017_03_30.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -229,7 +229,7 @@ def list_by_subscription( self, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.AvailabilitySetListResult"]: + ) -> AsyncIterable["_models.AvailabilitySetListResult"]: """Lists all availability sets in a subscription. :param expand: The expand expression to apply to the operation. Allowed values are @@ -240,7 +240,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_03_30.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -301,7 +301,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailabilitySetListResult"]: + ) -> AsyncIterable["_models.AvailabilitySetListResult"]: """Lists all availability sets in a resource group. :param resource_group_name: The name of the resource group. @@ -311,7 +311,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_03_30.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -372,7 +372,7 @@ def list_available_sizes( resource_group_name: str, availability_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. @@ -385,7 +385,7 @@ def list_available_sizes( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_disks_operations.py index 92161c18e82f..598bcd5db223 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_disks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DisksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, disk_name: str, - disk: "models.Disk", + disk: "_models.Disk", **kwargs - ) -> "models.Disk": - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + ) -> "_models.Disk": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, disk_name: str, - disk: "models.Disk", + disk: "_models.Disk", **kwargs - ) -> AsyncLROPoller["models.Disk"]: + ) -> AsyncLROPoller["_models.Disk"]: """Creates or updates a disk. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -171,10 +177,10 @@ async def _update_initial( self, resource_group_name: str, disk_name: str, - disk: "models.DiskUpdate", + disk: "_models.DiskUpdate", **kwargs - ) -> "models.Disk": - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + ) -> "_models.Disk": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,9 +234,9 @@ async def begin_update( self, resource_group_name: str, disk_name: str, - disk: "models.DiskUpdate", + disk: "_models.DiskUpdate", **kwargs - ) -> AsyncLROPoller["models.Disk"]: + ) -> AsyncLROPoller["_models.Disk"]: """Updates (patches) a disk. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -296,7 +308,7 @@ async def get( resource_group_name: str, disk_name: str, **kwargs - ) -> "models.Disk": + ) -> "_models.Disk": """Gets information about a disk. :param resource_group_name: The name of the resource group. @@ -310,7 +322,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2017_03_30.models.Disk :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -356,8 +368,8 @@ async def _delete_initial( resource_group_name: str, disk_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +417,7 @@ async def begin_delete( resource_group_name: str, disk_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deletes a disk. :param resource_group_name: The name of the resource group. @@ -425,7 +437,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -449,7 +461,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -467,7 +485,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DiskList"]: + ) -> AsyncIterable["_models.DiskList"]: """Lists all the disks under a resource group. :param resource_group_name: The name of the resource group. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_03_30.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -536,7 +554,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.DiskList"]: + ) -> AsyncIterable["_models.DiskList"]: """Lists all the disks under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -544,7 +562,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_03_30.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -603,10 +621,10 @@ async def _grant_access_initial( self, resource_group_name: str, disk_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> Optional["models.AccessUri"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + ) -> Optional["_models.AccessUri"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,9 +676,9 @@ async def begin_grant_access( self, resource_group_name: str, disk_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> AsyncLROPoller["models.AccessUri"]: + ) -> AsyncLROPoller["_models.AccessUri"]: """Grants access to a disk. :param resource_group_name: The name of the resource group. @@ -683,7 +701,7 @@ async def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -708,7 +726,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -727,8 +751,8 @@ async def _revoke_access_initial( resource_group_name: str, disk_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -776,7 +800,7 @@ async def begin_revoke_access( resource_group_name: str, disk_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Revokes access to a disk. :param resource_group_name: The name of the resource group. @@ -796,7 +820,7 @@ async def begin_revoke_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -820,7 +844,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_images_operations.py index 0e8ca831e7a1..4860a999bd39 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, image_name: str, - parameters: "models.Image", + parameters: "_models.Image", **kwargs - ) -> "models.Image": - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + ) -> "_models.Image": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, image_name: str, - parameters: "models.Image", + parameters: "_models.Image", **kwargs - ) -> AsyncLROPoller["models.Image"]: + ) -> AsyncLROPoller["_models.Image"]: """Create or update an image. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -170,8 +176,8 @@ async def _delete_initial( resource_group_name: str, image_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -219,7 +225,7 @@ async def begin_delete( resource_group_name: str, image_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deletes an Image. :param resource_group_name: The name of the resource group. @@ -237,7 +243,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -261,7 +267,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -281,7 +293,7 @@ async def get( image_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Image": + ) -> "_models.Image": """Gets an image. :param resource_group_name: The name of the resource group. @@ -295,7 +307,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2017_03_30.models.Image :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -342,7 +354,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ImageListResult"]: + ) -> AsyncIterable["_models.ImageListResult"]: """Gets the list of images under a resource group. :param resource_group_name: The name of the resource group. @@ -352,7 +364,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_03_30.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -411,7 +423,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ImageListResult"]: + ) -> AsyncIterable["_models.ImageListResult"]: """Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. @@ -420,7 +432,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_03_30.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_resource_skus_operations.py index 7ff260671c50..1479b57ad878 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_resource_skus_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_resource_skus_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ResourceSkusOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ResourceSkusResult"]: + ) -> AsyncIterable["_models.ResourceSkusResult"]: """Gets the list of Microsoft.Compute SKUs available for your Subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_03_30.models.ResourceSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_snapshots_operations.py index 0cd1e4bc9e88..df8436a3dbf2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_snapshots_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SnapshotsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.Snapshot", + snapshot: "_models.Snapshot", **kwargs - ) -> "models.Snapshot": - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + ) -> "_models.Snapshot": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.Snapshot", + snapshot: "_models.Snapshot", **kwargs - ) -> AsyncLROPoller["models.Snapshot"]: + ) -> AsyncLROPoller["_models.Snapshot"]: """Creates or updates a snapshot. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -171,10 +177,10 @@ async def _update_initial( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.SnapshotUpdate", + snapshot: "_models.SnapshotUpdate", **kwargs - ) -> "models.Snapshot": - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + ) -> "_models.Snapshot": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,9 +234,9 @@ async def begin_update( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.SnapshotUpdate", + snapshot: "_models.SnapshotUpdate", **kwargs - ) -> AsyncLROPoller["models.Snapshot"]: + ) -> AsyncLROPoller["_models.Snapshot"]: """Updates (patches) a snapshot. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -296,7 +308,7 @@ async def get( resource_group_name: str, snapshot_name: str, **kwargs - ) -> "models.Snapshot": + ) -> "_models.Snapshot": """Gets information about a snapshot. :param resource_group_name: The name of the resource group. @@ -310,7 +322,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2017_03_30.models.Snapshot :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -356,8 +368,8 @@ async def _delete_initial( resource_group_name: str, snapshot_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -405,7 +417,7 @@ async def begin_delete( resource_group_name: str, snapshot_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deletes a snapshot. :param resource_group_name: The name of the resource group. @@ -425,7 +437,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -449,7 +461,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -467,7 +485,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.SnapshotList"]: + ) -> AsyncIterable["_models.SnapshotList"]: """Lists snapshots under a resource group. :param resource_group_name: The name of the resource group. @@ -477,7 +495,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_03_30.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -536,7 +554,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.SnapshotList"]: + ) -> AsyncIterable["_models.SnapshotList"]: """Lists snapshots under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -544,7 +562,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_03_30.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -603,10 +621,10 @@ async def _grant_access_initial( self, resource_group_name: str, snapshot_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> Optional["models.AccessUri"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + ) -> Optional["_models.AccessUri"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -658,9 +676,9 @@ async def begin_grant_access( self, resource_group_name: str, snapshot_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> AsyncLROPoller["models.AccessUri"]: + ) -> AsyncLROPoller["_models.AccessUri"]: """Grants access to a snapshot. :param resource_group_name: The name of the resource group. @@ -683,7 +701,7 @@ async def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -708,7 +726,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -727,8 +751,8 @@ async def _revoke_access_initial( resource_group_name: str, snapshot_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -776,7 +800,7 @@ async def begin_revoke_access( resource_group_name: str, snapshot_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Revokes access to a snapshot. :param resource_group_name: The name of the resource group. @@ -796,7 +820,7 @@ async def begin_revoke_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -820,7 +844,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_usage_operations.py index fc64ae9e6c35..c85776d199b0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsageOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.ListUsagesResult"]: + ) -> AsyncIterable["_models.ListUsagesResult"]: """Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_03_30.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extension_images_operations.py index 503d6247663f..9470d7d183c5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extension_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VirtualMachineExtensionImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( type: str, version: str, **kwargs - ) -> "models.VirtualMachineExtensionImage": + ) -> "_models.VirtualMachineExtensionImage": """Gets a virtual machine extension image. :param location: The name of a supported Azure region. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineExtensionImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,7 +111,7 @@ async def list_types( location: str, publisher_name: str, **kwargs - ) -> List["models.VirtualMachineExtensionImage"]: + ) -> List["_models.VirtualMachineExtensionImage"]: """Gets a list of virtual machine extension image types. :param location: The name of a supported Azure region. @@ -123,7 +123,7 @@ async def list_types( :rtype: list[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -173,7 +173,7 @@ async def list_versions( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> List["models.VirtualMachineExtensionImage"]: + ) -> List["_models.VirtualMachineExtensionImage"]: """Gets a list of virtual machine extension image versions. :param location: The name of a supported Azure region. @@ -193,7 +193,7 @@ async def list_versions( :rtype: list[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extensions_operations.py index 7499cfb904ea..93340ebe722d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VirtualMachineExtensionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineExtension", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineExtension", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineExtension"]: """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -177,10 +184,10 @@ async def _update_initial( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineExtensionUpdate", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -232,9 +239,9 @@ async def begin_update( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineExtensionUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineExtension"]: """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -257,7 +264,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -283,7 +290,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -303,8 +317,8 @@ async def _delete_initial( vm_name: str, vm_extension_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,7 +368,7 @@ async def begin_delete( vm_name: str, vm_extension_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -374,7 +388,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -399,7 +413,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -420,7 +441,7 @@ async def get( vm_extension_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtension": + ) -> "_models.VirtualMachineExtension": """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -436,7 +457,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_images_operations.py index 5499938b02ef..1c420479abef 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VirtualMachineImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( skus: str, version: str, **kwargs - ) -> "models.VirtualMachineImage": + ) -> "_models.VirtualMachineImage": """Gets a virtual machine image. :param location: The name of a supported Azure region. @@ -66,7 +66,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,7 +120,7 @@ async def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. @@ -143,7 +143,7 @@ async def list( :rtype: list[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -197,7 +197,7 @@ async def list_offers( location: str, publisher_name: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image offers for the specified location and publisher. :param location: The name of a supported Azure region. @@ -209,7 +209,7 @@ async def list_offers( :rtype: list[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -254,7 +254,7 @@ async def list_publishers( self, location: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image publishers for the specified Azure location. :param location: The name of a supported Azure region. @@ -264,7 +264,7 @@ async def list_publishers( :rtype: list[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -310,7 +310,7 @@ async def list_skus( publisher_name: str, offer: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. :param location: The name of a supported Azure region. @@ -324,7 +324,7 @@ async def list_skus( :rtype: list[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_run_commands_operations.py index ec1757a7bf54..f60b6d529b5f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_run_commands_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VirtualMachineRunCommandsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.RunCommandListResult"]: + ) -> AsyncIterable["_models.RunCommandListResult"]: """Lists all available run commands for a subscription in a location. :param location: The location upon which run commands is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_03_30.models.RunCommandListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ async def get( location: str, command_id: str, **kwargs - ) -> "models.RunCommandDocument": + ) -> "_models.RunCommandDocument": """Gets specific run command for a subscription in a location. :param location: The location upon which run commands is queried. @@ -128,7 +128,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2017_03_30.models.RunCommandDocument :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandDocument"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_extensions_operations.py index a364f48ce323..8e1f77e3a010 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetExtensionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, vm_scale_set_name: str, vmss_extension_name: str, - extension_parameters: "models.VirtualMachineScaleSetExtension", + extension_parameters: "_models.VirtualMachineScaleSetExtension", **kwargs - ) -> "models.VirtualMachineScaleSetExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + ) -> "_models.VirtualMachineScaleSetExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def begin_create_or_update( resource_group_name: str, vm_scale_set_name: str, vmss_extension_name: str, - extension_parameters: "models.VirtualMachineScaleSetExtension", + extension_parameters: "_models.VirtualMachineScaleSetExtension", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSetExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSetExtension"]: """The operation to create or update an extension. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -179,8 +186,8 @@ async def _delete_initial( vm_scale_set_name: str, vmss_extension_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -230,7 +237,7 @@ async def begin_delete( vm_scale_set_name: str, vmss_extension_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -250,7 +257,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -275,7 +282,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -296,7 +310,7 @@ async def get( vmss_extension_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineScaleSetExtension": + ) -> "_models.VirtualMachineScaleSetExtension": """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -312,7 +326,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -361,7 +375,7 @@ def list( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetExtensionListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetExtensionListResult"]: """Gets a list of all extensions in a VM scale set. :param resource_group_name: The name of the resource group. @@ -373,7 +387,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetExtensionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtensionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index d41b76a35d62..49e6921ed72c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VirtualMachineScaleSetRollingUpgradesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,8 +47,8 @@ async def _cancel_initial( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ async def begin_cancel( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Cancels the current virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -114,7 +114,7 @@ async def begin_cancel( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -157,8 +163,8 @@ async def _start_os_upgrade_initial( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ async def begin_start_os_upgrade( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. @@ -226,7 +232,7 @@ async def begin_start_os_upgrade( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -250,7 +256,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -269,7 +281,7 @@ async def get_latest( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.RollingUpgradeStatusInfo": + ) -> "_models.RollingUpgradeStatusInfo": """Gets the status of the latest virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -281,7 +293,7 @@ async def get_latest( :rtype: ~azure.mgmt.compute.v2017_03_30.models.RollingUpgradeStatusInfo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RollingUpgradeStatusInfo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py index 7b8d29593c33..a16eb411ed74 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetVMsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,8 +49,8 @@ async def _reimage_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ async def begin_reimage( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -120,7 +120,7 @@ async def begin_reimage( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -145,7 +145,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -165,8 +172,8 @@ async def _reimage_all_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +223,7 @@ async def begin_reimage_all( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. @@ -237,7 +244,7 @@ async def begin_reimage_all( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -262,7 +269,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -282,8 +296,8 @@ async def _deallocate_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -333,7 +347,7 @@ async def begin_deallocate( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. @@ -355,7 +369,7 @@ async def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -380,7 +394,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -400,8 +421,8 @@ async def _delete_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -451,7 +472,7 @@ async def begin_delete( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -471,7 +492,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -496,7 +517,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -516,7 +544,7 @@ async def get( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.VirtualMachineScaleSetVM": + ) -> "_models.VirtualMachineScaleSetVM": """Gets a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -530,7 +558,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetVM :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -578,7 +606,7 @@ async def get_instance_view( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.VirtualMachineScaleSetVMInstanceView": + ) -> "_models.VirtualMachineScaleSetVMInstanceView": """Gets the status of a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -592,7 +620,7 @@ async def get_instance_view( :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetVMInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -642,7 +670,7 @@ def list( select: Optional[str] = None, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetVMListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetVMListResult"]: """Gets a list of all virtual machines in a VM scale sets. :param resource_group_name: The name of the resource group. @@ -663,7 +691,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetVMListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -732,8 +760,8 @@ async def _power_off_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -783,7 +811,7 @@ async def begin_power_off( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. @@ -805,7 +833,7 @@ async def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -830,7 +858,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -850,8 +885,8 @@ async def _restart_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -901,7 +936,7 @@ async def begin_restart( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -921,7 +956,7 @@ async def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -946,7 +981,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -966,8 +1008,8 @@ async def _start_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1017,7 +1059,7 @@ async def begin_start( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1037,7 +1079,7 @@ async def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1062,7 +1104,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_sets_operations.py index b55fc36d6990..bb12ce46cd90 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSet", + parameters: "_models.VirtualMachineScaleSet", **kwargs - ) -> "models.VirtualMachineScaleSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + ) -> "_models.VirtualMachineScaleSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSet", + parameters: "_models.VirtualMachineScaleSet", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSet"]: """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -169,10 +175,10 @@ async def _update_initial( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSetUpdate", + parameters: "_models.VirtualMachineScaleSetUpdate", **kwargs - ) -> "models.VirtualMachineScaleSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + ) -> "_models.VirtualMachineScaleSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -222,9 +228,9 @@ async def begin_update( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSetUpdate", + parameters: "_models.VirtualMachineScaleSetUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSet"]: """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -244,7 +250,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -269,7 +275,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -288,8 +300,8 @@ async def _delete_initial( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -337,7 +349,7 @@ async def begin_delete( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -379,7 +391,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -398,7 +416,7 @@ async def get( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> "_models.VirtualMachineScaleSet": """Display information about a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -410,7 +428,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -455,10 +473,10 @@ async def _deallocate_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -513,9 +531,9 @@ async def begin_deallocate( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. @@ -537,7 +555,7 @@ async def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -562,7 +580,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -580,10 +604,10 @@ async def _delete_instances_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -635,9 +659,9 @@ async def begin_delete_instances( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -657,7 +681,7 @@ async def begin_delete_instances( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -682,7 +706,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -701,7 +731,7 @@ async def get_instance_view( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.VirtualMachineScaleSetInstanceView": + ) -> "_models.VirtualMachineScaleSetInstanceView": """Gets the status of a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -713,7 +743,7 @@ async def get_instance_view( :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -758,7 +788,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListResult"]: """Gets a list of all VM scale sets under a resource group. :param resource_group_name: The name of the resource group. @@ -768,7 +798,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -827,7 +857,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListWithLinkResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListWithLinkResult"]: """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. @@ -837,7 +867,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetListWithLinkResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListWithLinkResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -897,7 +927,7 @@ def list_skus( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListSkusResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListSkusResult"]: """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. @@ -910,7 +940,7 @@ def list_skus( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetListSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -971,10 +1001,10 @@ async def _power_off_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1029,9 +1059,9 @@ async def begin_power_off( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. @@ -1053,7 +1083,7 @@ async def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1078,7 +1108,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1096,10 +1132,10 @@ async def _restart_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1154,9 +1190,9 @@ async def begin_restart( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1176,7 +1212,7 @@ async def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1201,7 +1237,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1219,10 +1261,10 @@ async def _start_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1277,9 +1319,9 @@ async def begin_start( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1299,7 +1341,7 @@ async def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1324,7 +1366,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1342,10 +1390,10 @@ async def _update_instances_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1397,9 +1445,9 @@ async def begin_update_instances( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1419,7 +1467,7 @@ async def begin_update_instances( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1444,7 +1492,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1462,10 +1516,10 @@ async def _reimage_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1520,9 +1574,9 @@ async def begin_reimage( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1542,7 +1596,7 @@ async def begin_reimage( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1567,7 +1621,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1585,10 +1645,10 @@ async def _reimage_all_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1643,9 +1703,9 @@ async def begin_reimage_all( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. @@ -1666,7 +1726,7 @@ async def begin_reimage_all( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1691,7 +1751,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_sizes_operations.py index 4209dafb1b1a..cc221800c8fb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_sizes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VirtualMachineSizesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes for a subscription in a location. :param location: The location upon which virtual-machine-sizes is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machines_operations.py index aadf168bded7..1246e2c714c3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machines_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachinesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get_extensions( vm_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtensionsListResult": + ) -> "_models.VirtualMachineExtensionsListResult": """The operation to get all extensions of a Virtual Machine. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def get_extensions( :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineExtensionsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,7 +110,7 @@ def list_by_location( self, location: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Gets all the virtual machines under the specified subscription for the specified location. :param location: The location for which virtual machines under the subscription are queried. @@ -120,7 +120,7 @@ def list_by_location( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -180,10 +180,10 @@ async def _capture_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineCaptureParameters", + parameters: "_models.VirtualMachineCaptureParameters", **kwargs - ) -> Optional["models.VirtualMachineCaptureResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + ) -> Optional["_models.VirtualMachineCaptureResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualMachineCaptureResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,9 +235,9 @@ async def begin_capture( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineCaptureParameters", + parameters: "_models.VirtualMachineCaptureParameters", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineCaptureResult"]: + ) -> AsyncLROPoller["_models.VirtualMachineCaptureResult"]: """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -258,7 +258,7 @@ async def begin_capture( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -283,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -301,10 +307,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachine", + parameters: "_models.VirtualMachine", **kwargs - ) -> "models.VirtualMachine": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + ) -> "_models.VirtualMachine": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -358,9 +364,9 @@ async def begin_create_or_update( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachine", + parameters: "_models.VirtualMachine", **kwargs - ) -> AsyncLROPoller["models.VirtualMachine"]: + ) -> AsyncLROPoller["_models.VirtualMachine"]: """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -380,7 +386,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -405,7 +411,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -424,8 +436,8 @@ async def _delete_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -473,7 +485,7 @@ async def begin_delete( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -491,7 +503,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -515,7 +527,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -535,7 +553,7 @@ async def get( vm_name: str, expand: Optional[str] = "instanceView", **kwargs - ) -> "models.VirtualMachine": + ) -> "_models.VirtualMachine": """Retrieves information about the model view or the instance view of a virtual machine. :param resource_group_name: The name of the resource group. @@ -549,7 +567,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachine :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -597,7 +615,7 @@ async def instance_view( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.VirtualMachineInstanceView": + ) -> "_models.VirtualMachineInstanceView": """Retrieves information about the run-time state of a virtual machine. :param resource_group_name: The name of the resource group. @@ -609,7 +627,7 @@ async def instance_view( :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -655,8 +673,8 @@ async def _convert_to_managed_disks_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -704,7 +722,7 @@ async def begin_convert_to_managed_disks( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- deallocated before invoking this operation. @@ -723,7 +741,7 @@ async def begin_convert_to_managed_disks( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -747,7 +765,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -766,8 +790,8 @@ async def _deallocate_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -815,7 +839,7 @@ async def begin_deallocate( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. @@ -834,7 +858,7 @@ async def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -858,7 +882,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -877,7 +907,7 @@ async def generalize( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> "_models.OperationStatusResponse": """Sets the state of the virtual machine to generalized. :param resource_group_name: The name of the resource group. @@ -889,7 +919,7 @@ async def generalize( :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -934,7 +964,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. @@ -945,7 +975,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1004,7 +1034,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. @@ -1013,7 +1043,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1073,7 +1103,7 @@ def list_available_sizes( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes to which the specified virtual machine can be resized. @@ -1086,7 +1116,7 @@ def list_available_sizes( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1148,8 +1178,8 @@ async def _power_off_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1197,7 +1227,7 @@ async def begin_power_off( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. @@ -1216,7 +1246,7 @@ async def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1240,7 +1270,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1259,8 +1295,8 @@ async def _restart_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1308,7 +1344,7 @@ async def begin_restart( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1326,7 +1362,7 @@ async def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1350,7 +1386,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1369,8 +1411,8 @@ async def _start_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1418,7 +1460,7 @@ async def begin_start( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1436,7 +1478,7 @@ async def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1460,7 +1502,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1479,8 +1527,8 @@ async def _redeploy_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1528,7 +1576,7 @@ async def begin_redeploy( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1546,7 +1594,7 @@ async def begin_redeploy( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1570,7 +1618,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1589,8 +1643,8 @@ async def _perform_maintenance_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1638,7 +1692,7 @@ async def begin_perform_maintenance( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to perform maintenance on a virtual machine. :param resource_group_name: The name of the resource group. @@ -1656,7 +1710,7 @@ async def begin_perform_maintenance( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1680,7 +1734,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1698,10 +1758,10 @@ async def _run_command_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> Optional["models.RunCommandResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + ) -> Optional["_models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1753,9 +1813,9 @@ async def begin_run_command( self, resource_group_name: str, vm_name: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> AsyncLROPoller["models.RunCommandResult"]: + ) -> AsyncLROPoller["_models.RunCommandResult"]: """Run command on the VM. :param resource_group_name: The name of the resource group. @@ -1775,7 +1835,7 @@ async def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1800,7 +1860,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_availability_sets_operations.py index 08999c7e2797..75b778a05310 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_availability_sets_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailabilitySetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str availability_set_name, # type: str - parameters, # type: "models.AvailabilitySet" + parameters, # type: "_models.AvailabilitySet" **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Create or update an availability set. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~azure.mgmt.compute.v2017_03_30.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,7 +118,7 @@ def delete( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] + # type: (...) -> Optional["_models.OperationStatusResponse"] """Delete an availability set. :param resource_group_name: The name of the resource group. @@ -130,7 +130,7 @@ def delete( :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -179,7 +179,7 @@ def get( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Retrieves information about an availability set. :param resource_group_name: The name of the resource group. @@ -191,7 +191,7 @@ def get( :rtype: ~azure.mgmt.compute.v2017_03_30.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -237,7 +237,7 @@ def list_by_subscription( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailabilitySetListResult"] + # type: (...) -> Iterable["_models.AvailabilitySetListResult"] """Lists all availability sets in a subscription. :param expand: The expand expression to apply to the operation. Allowed values are @@ -248,7 +248,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_03_30.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -310,7 +310,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailabilitySetListResult"] + # type: (...) -> Iterable["_models.AvailabilitySetListResult"] """Lists all availability sets in a resource group. :param resource_group_name: The name of the resource group. @@ -320,7 +320,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_03_30.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -382,7 +382,7 @@ def list_available_sizes( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. @@ -395,7 +395,7 @@ def list_available_sizes( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_disks_operations.py index 59eb7c89c61c..4c3da616bd03 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_disks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DisksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.Disk" + disk, # type: "_models.Disk" **kwargs # type: Any ): - # type: (...) -> "models.Disk" - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + # type: (...) -> "_models.Disk" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.Disk" + disk, # type: "_models.Disk" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Disk"] + # type: (...) -> LROPoller["_models.Disk"] """Creates or updates a disk. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -177,11 +183,11 @@ def _update_initial( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.DiskUpdate" + disk, # type: "_models.DiskUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Disk" - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + # type: (...) -> "_models.Disk" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,10 +241,10 @@ def begin_update( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.DiskUpdate" + disk, # type: "_models.DiskUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Disk"] + # type: (...) -> LROPoller["_models.Disk"] """Updates (patches) a disk. :param resource_group_name: The name of the resource group. @@ -260,7 +266,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -285,7 +291,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -305,7 +317,7 @@ def get( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Disk" + # type: (...) -> "_models.Disk" """Gets information about a disk. :param resource_group_name: The name of the resource group. @@ -319,7 +331,7 @@ def get( :rtype: ~azure.mgmt.compute.v2017_03_30.models.Disk :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -366,8 +378,8 @@ def _delete_initial( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -416,7 +428,7 @@ def begin_delete( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deletes a disk. :param resource_group_name: The name of the resource group. @@ -436,7 +448,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -460,7 +472,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -479,7 +497,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskList"] + # type: (...) -> Iterable["_models.DiskList"] """Lists all the disks under a resource group. :param resource_group_name: The name of the resource group. @@ -489,7 +507,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_03_30.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -549,7 +567,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskList"] + # type: (...) -> Iterable["_models.DiskList"] """Lists all the disks under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -557,7 +575,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_03_30.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -616,11 +634,11 @@ def _grant_access_initial( self, resource_group_name, # type: str disk_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> Optional["models.AccessUri"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + # type: (...) -> Optional["_models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -672,10 +690,10 @@ def begin_grant_access( self, resource_group_name, # type: str disk_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AccessUri"] + # type: (...) -> LROPoller["_models.AccessUri"] """Grants access to a disk. :param resource_group_name: The name of the resource group. @@ -698,7 +716,7 @@ def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -723,7 +741,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -743,8 +767,8 @@ def _revoke_access_initial( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -793,7 +817,7 @@ def begin_revoke_access( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Revokes access to a disk. :param resource_group_name: The name of the resource group. @@ -813,7 +837,7 @@ def begin_revoke_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -837,7 +861,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_images_operations.py index 2957e467a875..6ada383ae0fd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.Image" + parameters, # type: "_models.Image" **kwargs # type: Any ): - # type: (...) -> "models.Image" - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + # type: (...) -> "_models.Image" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.Image" + parameters, # type: "_models.Image" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Image"] + # type: (...) -> LROPoller["_models.Image"] """Create or update an image. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -177,8 +183,8 @@ def _delete_initial( image_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -227,7 +233,7 @@ def begin_delete( image_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deletes an Image. :param resource_group_name: The name of the resource group. @@ -245,7 +251,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -269,7 +275,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -290,7 +302,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Image" + # type: (...) -> "_models.Image" """Gets an image. :param resource_group_name: The name of the resource group. @@ -304,7 +316,7 @@ def get( :rtype: ~azure.mgmt.compute.v2017_03_30.models.Image :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -352,7 +364,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ImageListResult"] + # type: (...) -> Iterable["_models.ImageListResult"] """Gets the list of images under a resource group. :param resource_group_name: The name of the resource group. @@ -362,7 +374,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_03_30.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -422,7 +434,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ImageListResult"] + # type: (...) -> Iterable["_models.ImageListResult"] """Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. @@ -431,7 +443,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_03_30.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_resource_skus_operations.py index fc94215b7672..f64b9974fa9d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_resource_skus_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_resource_skus_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ResourceSkusOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ResourceSkusResult"] + # type: (...) -> Iterable["_models.ResourceSkusResult"] """Gets the list of Microsoft.Compute SKUs available for your Subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_03_30.models.ResourceSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_snapshots_operations.py index 44a8d24033e0..01b1fb83ad70 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_snapshots_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SnapshotsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.Snapshot" + snapshot, # type: "_models.Snapshot" **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + # type: (...) -> "_models.Snapshot" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.Snapshot" + snapshot, # type: "_models.Snapshot" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Snapshot"] + # type: (...) -> LROPoller["_models.Snapshot"] """Creates or updates a snapshot. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -177,11 +183,11 @@ def _update_initial( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.SnapshotUpdate" + snapshot, # type: "_models.SnapshotUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + # type: (...) -> "_models.Snapshot" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,10 +241,10 @@ def begin_update( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.SnapshotUpdate" + snapshot, # type: "_models.SnapshotUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Snapshot"] + # type: (...) -> LROPoller["_models.Snapshot"] """Updates (patches) a snapshot. :param resource_group_name: The name of the resource group. @@ -260,7 +266,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -285,7 +291,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -305,7 +317,7 @@ def get( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" + # type: (...) -> "_models.Snapshot" """Gets information about a snapshot. :param resource_group_name: The name of the resource group. @@ -319,7 +331,7 @@ def get( :rtype: ~azure.mgmt.compute.v2017_03_30.models.Snapshot :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -366,8 +378,8 @@ def _delete_initial( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -416,7 +428,7 @@ def begin_delete( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deletes a snapshot. :param resource_group_name: The name of the resource group. @@ -436,7 +448,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -460,7 +472,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -479,7 +497,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SnapshotList"] + # type: (...) -> Iterable["_models.SnapshotList"] """Lists snapshots under a resource group. :param resource_group_name: The name of the resource group. @@ -489,7 +507,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_03_30.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -549,7 +567,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.SnapshotList"] + # type: (...) -> Iterable["_models.SnapshotList"] """Lists snapshots under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -557,7 +575,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_03_30.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -616,11 +634,11 @@ def _grant_access_initial( self, resource_group_name, # type: str snapshot_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> Optional["models.AccessUri"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + # type: (...) -> Optional["_models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -672,10 +690,10 @@ def begin_grant_access( self, resource_group_name, # type: str snapshot_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AccessUri"] + # type: (...) -> LROPoller["_models.AccessUri"] """Grants access to a snapshot. :param resource_group_name: The name of the resource group. @@ -698,7 +716,7 @@ def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -723,7 +741,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -743,8 +767,8 @@ def _revoke_access_initial( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -793,7 +817,7 @@ def begin_revoke_access( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Revokes access to a snapshot. :param resource_group_name: The name of the resource group. @@ -813,7 +837,7 @@ def begin_revoke_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -837,7 +861,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_usage_operations.py index 645db95df24e..170601baca2b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsageOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListUsagesResult"] + # type: (...) -> Iterable["_models.ListUsagesResult"] """Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_03_30.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extension_images_operations.py index 301f85a9888c..2545028db008 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extension_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VirtualMachineExtensionImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( version, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtensionImage" + # type: (...) -> "_models.VirtualMachineExtensionImage" """Gets a virtual machine extension image. :param location: The name of a supported Azure region. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineExtensionImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def list_types( publisher_name, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineExtensionImage"] + # type: (...) -> List["_models.VirtualMachineExtensionImage"] """Gets a list of virtual machine extension image types. :param location: The name of a supported Azure region. @@ -129,7 +129,7 @@ def list_types( :rtype: list[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -180,7 +180,7 @@ def list_versions( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineExtensionImage"] + # type: (...) -> List["_models.VirtualMachineExtensionImage"] """Gets a list of virtual machine extension image versions. :param location: The name of a supported Azure region. @@ -200,7 +200,7 @@ def list_versions( :rtype: list[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extensions_operations.py index cd5837bb0d61..b72bc5aa09f6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VirtualMachineExtensionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineExtension"] """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -183,11 +190,11 @@ def _update_initial( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -239,10 +246,10 @@ def begin_update( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineExtension"] """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -265,7 +272,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -291,7 +298,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -312,8 +326,8 @@ def _delete_initial( vm_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -364,7 +378,7 @@ def begin_delete( vm_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -384,7 +398,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -409,7 +423,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -431,7 +452,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" + # type: (...) -> "_models.VirtualMachineExtension" """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -447,7 +468,7 @@ def get( :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_images_operations.py index 862ae1f65213..13fc8d10fbf5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VirtualMachineImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( version, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineImage" + # type: (...) -> "_models.VirtualMachineImage" """Gets a virtual machine image. :param location: The name of a supported Azure region. @@ -71,7 +71,7 @@ def get( :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -126,7 +126,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. @@ -149,7 +149,7 @@ def list( :rtype: list[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -204,7 +204,7 @@ def list_offers( publisher_name, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image offers for the specified location and publisher. :param location: The name of a supported Azure region. @@ -216,7 +216,7 @@ def list_offers( :rtype: list[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,7 +262,7 @@ def list_publishers( location, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image publishers for the specified Azure location. :param location: The name of a supported Azure region. @@ -272,7 +272,7 @@ def list_publishers( :rtype: list[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -319,7 +319,7 @@ def list_skus( offer, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. :param location: The name of a supported Azure region. @@ -333,7 +333,7 @@ def list_skus( :rtype: list[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_run_commands_operations.py index 5028014cb7e6..469092fcf5dc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_run_commands_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VirtualMachineRunCommandsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RunCommandListResult"] + # type: (...) -> Iterable["_models.RunCommandListResult"] """Lists all available run commands for a subscription in a location. :param location: The location upon which run commands is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_03_30.models.RunCommandListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def get( command_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RunCommandDocument" + # type: (...) -> "_models.RunCommandDocument" """Gets specific run command for a subscription in a location. :param location: The location upon which run commands is queried. @@ -134,7 +134,7 @@ def get( :rtype: ~azure.mgmt.compute.v2017_03_30.models.RunCommandDocument :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandDocument"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_extensions_operations.py index 72c319368ab8..f13fb0fe2fd2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_extensions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetExtensionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str vm_scale_set_name, # type: str vmss_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineScaleSetExtension" + extension_parameters, # type: "_models.VirtualMachineScaleSetExtension" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + # type: (...) -> "_models.VirtualMachineScaleSetExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def begin_create_or_update( resource_group_name, # type: str vm_scale_set_name, # type: str vmss_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineScaleSetExtension" + extension_parameters, # type: "_models.VirtualMachineScaleSetExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSetExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSetExtension"] """The operation to create or update an extension. :param resource_group_name: The name of the resource group. @@ -139,7 +139,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -165,7 +165,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -186,8 +193,8 @@ def _delete_initial( vmss_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -238,7 +245,7 @@ def begin_delete( vmss_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -258,7 +265,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -283,7 +290,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -305,7 +319,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetExtension" + # type: (...) -> "_models.VirtualMachineScaleSetExtension" """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -321,7 +335,7 @@ def get( :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -371,7 +385,7 @@ def list( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetExtensionListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetExtensionListResult"] """Gets a list of all extensions in a VM scale set. :param resource_group_name: The name of the resource group. @@ -383,7 +397,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetExtensionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtensionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index eff2c2909706..46e56325482f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VirtualMachineScaleSetRollingUpgradesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,8 +52,8 @@ def _cancel_initial( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def begin_cancel( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Cancels the current virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -120,7 +120,7 @@ def begin_cancel( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -144,7 +144,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -164,8 +170,8 @@ def _start_os_upgrade_initial( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,7 +220,7 @@ def begin_start_os_upgrade( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. @@ -234,7 +240,7 @@ def begin_start_os_upgrade( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -258,7 +264,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -278,7 +290,7 @@ def get_latest( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RollingUpgradeStatusInfo" + # type: (...) -> "_models.RollingUpgradeStatusInfo" """Gets the status of the latest virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -290,7 +302,7 @@ def get_latest( :rtype: ~azure.mgmt.compute.v2017_03_30.models.RollingUpgradeStatusInfo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RollingUpgradeStatusInfo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_vms_operations.py index 5f1dfab9d7f5..a2a479bf82fa 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_vms_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetVMsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,8 +54,8 @@ def _reimage_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,7 +106,7 @@ def begin_reimage( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ def begin_reimage( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -172,8 +179,8 @@ def _reimage_all_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -224,7 +231,7 @@ def begin_reimage_all( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. @@ -245,7 +252,7 @@ def begin_reimage_all( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -270,7 +277,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -291,8 +305,8 @@ def _deallocate_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -343,7 +357,7 @@ def begin_deallocate( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. @@ -365,7 +379,7 @@ def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -390,7 +404,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -411,8 +432,8 @@ def _delete_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -463,7 +484,7 @@ def begin_delete( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -483,7 +504,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -508,7 +529,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -529,7 +557,7 @@ def get( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVM" + # type: (...) -> "_models.VirtualMachineScaleSetVM" """Gets a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -543,7 +571,7 @@ def get( :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetVM :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -592,7 +620,7 @@ def get_instance_view( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVMInstanceView" + # type: (...) -> "_models.VirtualMachineScaleSetVMInstanceView" """Gets the status of a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -606,7 +634,7 @@ def get_instance_view( :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetVMInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -657,7 +685,7 @@ def list( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetVMListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetVMListResult"] """Gets a list of all virtual machines in a VM scale sets. :param resource_group_name: The name of the resource group. @@ -678,7 +706,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetVMListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -748,8 +776,8 @@ def _power_off_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -800,7 +828,7 @@ def begin_power_off( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. @@ -822,7 +850,7 @@ def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -847,7 +875,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -868,8 +903,8 @@ def _restart_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -920,7 +955,7 @@ def begin_restart( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -940,7 +975,7 @@ def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -965,7 +1000,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -986,8 +1028,8 @@ def _start_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1038,7 +1080,7 @@ def begin_start( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1058,7 +1100,7 @@ def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1083,7 +1125,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_sets_operations.py index f3c5dcbf1d68..38755740d9cd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSet" + parameters, # type: "_models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + # type: (...) -> "_models.VirtualMachineScaleSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSet" + parameters, # type: "_models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSet"] """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -175,11 +181,11 @@ def _update_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSetUpdate" + parameters, # type: "_models.VirtualMachineScaleSetUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + # type: (...) -> "_models.VirtualMachineScaleSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -229,10 +235,10 @@ def begin_update( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSetUpdate" + parameters, # type: "_models.VirtualMachineScaleSetUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSet"] """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -297,8 +309,8 @@ def _delete_initial( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -347,7 +359,7 @@ def begin_delete( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -365,7 +377,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -389,7 +401,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -409,7 +427,7 @@ def get( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" + # type: (...) -> "_models.VirtualMachineScaleSet" """Display information about a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -421,7 +439,7 @@ def get( :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,11 +484,11 @@ def _deallocate_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -525,10 +543,10 @@ def begin_deallocate( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. @@ -550,7 +568,7 @@ def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -575,7 +593,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -593,11 +617,11 @@ def _delete_instances_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -649,10 +673,10 @@ def begin_delete_instances( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -672,7 +696,7 @@ def begin_delete_instances( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -697,7 +721,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -717,7 +747,7 @@ def get_instance_view( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetInstanceView" + # type: (...) -> "_models.VirtualMachineScaleSetInstanceView" """Gets the status of a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -729,7 +759,7 @@ def get_instance_view( :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -775,7 +805,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListResult"] """Gets a list of all VM scale sets under a resource group. :param resource_group_name: The name of the resource group. @@ -785,7 +815,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -845,7 +875,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListWithLinkResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListWithLinkResult"] """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. @@ -855,7 +885,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetListWithLinkResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListWithLinkResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -916,7 +946,7 @@ def list_skus( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListSkusResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListSkusResult"] """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. @@ -929,7 +959,7 @@ def list_skus( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineScaleSetListSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -990,11 +1020,11 @@ def _power_off_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1049,10 +1079,10 @@ def begin_power_off( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. @@ -1074,7 +1104,7 @@ def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1099,7 +1129,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1117,11 +1153,11 @@ def _restart_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1176,10 +1212,10 @@ def begin_restart( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1199,7 +1235,7 @@ def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1224,7 +1260,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1242,11 +1284,11 @@ def _start_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1301,10 +1343,10 @@ def begin_start( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1324,7 +1366,7 @@ def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1349,7 +1391,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1367,11 +1415,11 @@ def _update_instances_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1423,10 +1471,10 @@ def begin_update_instances( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1446,7 +1494,7 @@ def begin_update_instances( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1471,7 +1519,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1489,11 +1543,11 @@ def _reimage_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1548,10 +1602,10 @@ def begin_reimage( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1571,7 +1625,7 @@ def begin_reimage( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1596,7 +1650,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1614,11 +1674,11 @@ def _reimage_all_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1673,10 +1733,10 @@ def begin_reimage_all( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. @@ -1697,7 +1757,7 @@ def begin_reimage_all( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1722,7 +1782,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_sizes_operations.py index 83f7e9877982..6b5d2f7ab30f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_sizes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VirtualMachineSizesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes for a subscription in a location. :param location: The location upon which virtual-machine-sizes is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machines_operations.py index 5fe8d366f407..eafa92e1b9ff 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machines_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachinesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get_extensions( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtensionsListResult" + # type: (...) -> "_models.VirtualMachineExtensionsListResult" """The operation to get all extensions of a Virtual Machine. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def get_extensions( :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineExtensionsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ def list_by_location( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Gets all the virtual machines under the specified subscription for the specified location. :param location: The location for which virtual machines under the subscription are queried. @@ -126,7 +126,7 @@ def list_by_location( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -186,11 +186,11 @@ def _capture_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineCaptureParameters" + parameters, # type: "_models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualMachineCaptureResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + # type: (...) -> Optional["_models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualMachineCaptureResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -242,10 +242,10 @@ def begin_capture( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineCaptureParameters" + parameters, # type: "_models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineCaptureResult"] + # type: (...) -> LROPoller["_models.VirtualMachineCaptureResult"] """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -266,7 +266,7 @@ def begin_capture( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -291,7 +291,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -309,11 +315,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachine" + parameters, # type: "_models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + # type: (...) -> "_models.VirtualMachine" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -367,10 +373,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachine" + parameters, # type: "_models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachine"] + # type: (...) -> LROPoller["_models.VirtualMachine"] """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -390,7 +396,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -415,7 +421,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -435,8 +447,8 @@ def _delete_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -485,7 +497,7 @@ def begin_delete( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -503,7 +515,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -527,7 +539,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -548,7 +566,7 @@ def get( expand="instanceView", # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" + # type: (...) -> "_models.VirtualMachine" """Retrieves information about the model view or the instance view of a virtual machine. :param resource_group_name: The name of the resource group. @@ -562,7 +580,7 @@ def get( :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachine :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -611,7 +629,7 @@ def instance_view( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineInstanceView" + # type: (...) -> "_models.VirtualMachineInstanceView" """Retrieves information about the run-time state of a virtual machine. :param resource_group_name: The name of the resource group. @@ -623,7 +641,7 @@ def instance_view( :rtype: ~azure.mgmt.compute.v2017_03_30.models.VirtualMachineInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -670,8 +688,8 @@ def _convert_to_managed_disks_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -720,7 +738,7 @@ def begin_convert_to_managed_disks( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- deallocated before invoking this operation. @@ -739,7 +757,7 @@ def begin_convert_to_managed_disks( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -763,7 +781,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -783,8 +807,8 @@ def _deallocate_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -833,7 +857,7 @@ def begin_deallocate( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. @@ -852,7 +876,7 @@ def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -876,7 +900,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -896,7 +926,7 @@ def generalize( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" + # type: (...) -> "_models.OperationStatusResponse" """Sets the state of the virtual machine to generalized. :param resource_group_name: The name of the resource group. @@ -908,7 +938,7 @@ def generalize( :rtype: ~azure.mgmt.compute.v2017_03_30.models.OperationStatusResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -954,7 +984,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. @@ -965,7 +995,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1025,7 +1055,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. @@ -1034,7 +1064,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1095,7 +1125,7 @@ def list_available_sizes( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes to which the specified virtual machine can be resized. @@ -1108,7 +1138,7 @@ def list_available_sizes( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_03_30.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1171,8 +1201,8 @@ def _power_off_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1221,7 +1251,7 @@ def begin_power_off( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. @@ -1240,7 +1270,7 @@ def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1264,7 +1294,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1284,8 +1320,8 @@ def _restart_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1334,7 +1370,7 @@ def begin_restart( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1352,7 +1388,7 @@ def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1376,7 +1412,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1396,8 +1438,8 @@ def _start_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1446,7 +1488,7 @@ def begin_start( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1464,7 +1506,7 @@ def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1488,7 +1530,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1508,8 +1556,8 @@ def _redeploy_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1558,7 +1606,7 @@ def begin_redeploy( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1576,7 +1624,7 @@ def begin_redeploy( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1600,7 +1648,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1620,8 +1674,8 @@ def _perform_maintenance_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1670,7 +1724,7 @@ def begin_perform_maintenance( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to perform maintenance on a virtual machine. :param resource_group_name: The name of the resource group. @@ -1688,7 +1742,7 @@ def begin_perform_maintenance( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1712,7 +1766,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1730,11 +1790,11 @@ def _run_command_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> Optional["models.RunCommandResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + # type: (...) -> Optional["_models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1786,10 +1846,10 @@ def begin_run_command( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RunCommandResult"] + # type: (...) -> LROPoller["_models.RunCommandResult"] """Run command on the VM. :param resource_group_name: The name of the resource group. @@ -1809,7 +1869,7 @@ def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1834,7 +1894,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_compute_management_client.py index 66122fb73dba..6368f16c96cf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_compute_management_client.py @@ -49,7 +49,6 @@ def __init__( 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.resource_skus = ResourceSkusOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_metadata.json index 6e224feb3f20..467ff43bc4db 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": false + "has_lro_operations": false, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/_compute_management_client.py index 9ec019284e19..776d35cc29ff 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/_compute_management_client.py @@ -46,7 +46,6 @@ def __init__( 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.resource_skus = ResourceSkusOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/operations/_resource_skus_operations.py index 76b2028461d8..38e238a9a67e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/operations/_resource_skus_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/operations/_resource_skus_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ResourceSkusOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ResourceSkusResult"]: + ) -> AsyncIterable["_models.ResourceSkusResult"]: """Gets the list of Microsoft.Compute SKUs available for your Subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_09_01.models.ResourceSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/operations/_resource_skus_operations.py index ce7d60f1d985..9207d310c366 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/operations/_resource_skus_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/operations/_resource_skus_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ResourceSkusOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ResourceSkusResult"] + # type: (...) -> Iterable["_models.ResourceSkusResult"] """Gets the list of Microsoft.Compute SKUs available for your Subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_09_01.models.ResourceSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_compute_management_client.py index 7a360591eb8b..9a9611a8c9f6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_compute_management_client.py @@ -92,7 +92,6 @@ def __init__( 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( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_metadata.json index f1fe3390c053..9ab3383f8403 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/_compute_management_client.py index 0754de1374fe..38a400fc36ad 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/_compute_management_client.py @@ -89,7 +89,6 @@ def __init__( 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( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_availability_sets_operations.py index d815173acb89..9e061fcda847 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_availability_sets_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailabilitySetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, availability_set_name: str, - parameters: "models.AvailabilitySet", + parameters: "_models.AvailabilitySet", **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Create or update an availability set. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~azure.mgmt.compute.v2017_12_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,9 +111,9 @@ async def update( self, resource_group_name: str, availability_set_name: str, - parameters: "models.AvailabilitySetUpdate", + parameters: "_models.AvailabilitySetUpdate", **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Update an availability set. :param resource_group_name: The name of the resource group. @@ -127,7 +127,7 @@ async def update( :rtype: ~azure.mgmt.compute.v2017_12_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -178,7 +178,7 @@ async def delete( resource_group_name: str, availability_set_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: + ) -> Optional["_models.OperationStatusResponse"]: """Delete an availability set. :param resource_group_name: The name of the resource group. @@ -190,7 +190,7 @@ async def delete( :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -238,7 +238,7 @@ async def get( resource_group_name: str, availability_set_name: str, **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Retrieves information about an availability set. :param resource_group_name: The name of the resource group. @@ -250,7 +250,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2017_12_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,7 +295,7 @@ def list_by_subscription( self, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.AvailabilitySetListResult"]: + ) -> AsyncIterable["_models.AvailabilitySetListResult"]: """Lists all availability sets in a subscription. :param expand: The expand expression to apply to the operation. Allowed values are @@ -306,7 +306,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_12_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -367,7 +367,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailabilitySetListResult"]: + ) -> AsyncIterable["_models.AvailabilitySetListResult"]: """Lists all availability sets in a resource group. :param resource_group_name: The name of the resource group. @@ -377,7 +377,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_12_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -438,7 +438,7 @@ def list_available_sizes( resource_group_name: str, availability_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. @@ -451,7 +451,7 @@ def list_available_sizes( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_images_operations.py index 84591edcb840..8c64df13a250 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, image_name: str, - parameters: "models.Image", + parameters: "_models.Image", **kwargs - ) -> "models.Image": - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + ) -> "_models.Image": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, image_name: str, - parameters: "models.Image", + parameters: "_models.Image", **kwargs - ) -> AsyncLROPoller["models.Image"]: + ) -> AsyncLROPoller["_models.Image"]: """Create or update an image. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -169,10 +175,10 @@ async def _update_initial( self, resource_group_name: str, image_name: str, - parameters: "models.ImageUpdate", + parameters: "_models.ImageUpdate", **kwargs - ) -> "models.Image": - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + ) -> "_models.Image": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -226,9 +232,9 @@ async def begin_update( self, resource_group_name: str, image_name: str, - parameters: "models.ImageUpdate", + parameters: "_models.ImageUpdate", **kwargs - ) -> AsyncLROPoller["models.Image"]: + ) -> AsyncLROPoller["_models.Image"]: """Update an image. :param resource_group_name: The name of the resource group. @@ -248,7 +254,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -273,7 +279,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -292,8 +304,8 @@ async def _delete_initial( resource_group_name: str, image_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -341,7 +353,7 @@ async def begin_delete( resource_group_name: str, image_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deletes an Image. :param resource_group_name: The name of the resource group. @@ -359,7 +371,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -383,7 +395,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -403,7 +421,7 @@ async def get( image_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Image": + ) -> "_models.Image": """Gets an image. :param resource_group_name: The name of the resource group. @@ -417,7 +435,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2017_12_01.models.Image :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +482,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ImageListResult"]: + ) -> AsyncIterable["_models.ImageListResult"]: """Gets the list of images under a resource group. :param resource_group_name: The name of the resource group. @@ -474,7 +492,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_12_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -533,7 +551,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ImageListResult"]: + ) -> AsyncIterable["_models.ImageListResult"]: """Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. @@ -542,7 +560,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_12_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_log_analytics_operations.py index af2f2f8af735..5a495767b55c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_log_analytics_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class LogAnalyticsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,10 +45,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def _export_request_rate_by_interval_initial( self, location: str, - parameters: "models.RequestRateByIntervalInput", + parameters: "_models.RequestRateByIntervalInput", **kwargs - ) -> Optional["models.LogAnalyticsOperationResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + ) -> Optional["_models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -98,9 +98,9 @@ async def _export_request_rate_by_interval_initial( async def begin_export_request_rate_by_interval( self, location: str, - parameters: "models.RequestRateByIntervalInput", + parameters: "_models.RequestRateByIntervalInput", **kwargs - ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: + ) -> AsyncLROPoller["_models.LogAnalyticsOperationResult"]: """Export logs that show Api requests made by this subscription in the given time window to show throttling activities. @@ -119,7 +119,7 @@ async def begin_export_request_rate_by_interval( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -143,7 +143,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -160,10 +165,10 @@ def get_long_running_output(pipeline_response): async def _export_throttled_requests_initial( self, location: str, - parameters: "models.LogAnalyticsInputBase", + parameters: "_models.LogAnalyticsInputBase", **kwargs - ) -> Optional["models.LogAnalyticsOperationResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + ) -> Optional["_models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -213,9 +218,9 @@ async def _export_throttled_requests_initial( async def begin_export_throttled_requests( self, location: str, - parameters: "models.LogAnalyticsInputBase", + parameters: "_models.LogAnalyticsInputBase", **kwargs - ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: + ) -> AsyncLROPoller["_models.LogAnalyticsOperationResult"]: """Export logs that show total throttled Api requests for this subscription in the given time window. @@ -234,7 +239,7 @@ async def begin_export_throttled_requests( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -258,7 +263,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_operations.py index d3e47f367e9d..528c2311d88e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ComputeOperationListResult"]: + ) -> AsyncIterable["_models.ComputeOperationListResult"]: """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_12_01.models.ComputeOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeOperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_usage_operations.py index dc662d8d9c6a..f98da1df421d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsageOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.ListUsagesResult"]: + ) -> AsyncIterable["_models.ListUsagesResult"]: """Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_12_01.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extension_images_operations.py index ddd9a7c02415..fddfae755b76 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VirtualMachineExtensionImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( type: str, version: str, **kwargs - ) -> "models.VirtualMachineExtensionImage": + ) -> "_models.VirtualMachineExtensionImage": """Gets a virtual machine extension image. :param location: The name of a supported Azure region. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineExtensionImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,7 +111,7 @@ async def list_types( location: str, publisher_name: str, **kwargs - ) -> List["models.VirtualMachineExtensionImage"]: + ) -> List["_models.VirtualMachineExtensionImage"]: """Gets a list of virtual machine extension image types. :param location: The name of a supported Azure region. @@ -123,7 +123,7 @@ async def list_types( :rtype: list[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -173,7 +173,7 @@ async def list_versions( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> List["models.VirtualMachineExtensionImage"]: + ) -> List["_models.VirtualMachineExtensionImage"]: """Gets a list of virtual machine extension image versions. :param location: The name of a supported Azure region. @@ -193,7 +193,7 @@ async def list_versions( :rtype: list[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extensions_operations.py index 6672480b9bfe..147ff2cb1c2b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VirtualMachineExtensionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineExtension", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineExtension", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineExtension"]: """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -177,10 +184,10 @@ async def _update_initial( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineExtensionUpdate", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -232,9 +239,9 @@ async def begin_update( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineExtensionUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineExtension"]: """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -257,7 +264,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -283,7 +290,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -303,8 +317,8 @@ async def _delete_initial( vm_name: str, vm_extension_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -354,7 +368,7 @@ async def begin_delete( vm_name: str, vm_extension_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -374,7 +388,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -399,7 +413,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -420,7 +441,7 @@ async def get( vm_extension_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtension": + ) -> "_models.VirtualMachineExtension": """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -436,7 +457,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_images_operations.py index 84f2585df617..9650952d7c82 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VirtualMachineImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( skus: str, version: str, **kwargs - ) -> "models.VirtualMachineImage": + ) -> "_models.VirtualMachineImage": """Gets a virtual machine image. :param location: The name of a supported Azure region. @@ -66,7 +66,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,7 +120,7 @@ async def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. @@ -143,7 +143,7 @@ async def list( :rtype: list[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -197,7 +197,7 @@ async def list_offers( location: str, publisher_name: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image offers for the specified location and publisher. :param location: The name of a supported Azure region. @@ -209,7 +209,7 @@ async def list_offers( :rtype: list[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -254,7 +254,7 @@ async def list_publishers( self, location: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image publishers for the specified Azure location. :param location: The name of a supported Azure region. @@ -264,7 +264,7 @@ async def list_publishers( :rtype: list[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -310,7 +310,7 @@ async def list_skus( publisher_name: str, offer: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. :param location: The name of a supported Azure region. @@ -324,7 +324,7 @@ async def list_skus( :rtype: list[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_run_commands_operations.py index 18c31db2efc7..fa8b7f1fdde4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VirtualMachineRunCommandsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.RunCommandListResult"]: + ) -> AsyncIterable["_models.RunCommandListResult"]: """Lists all available run commands for a subscription in a location. :param location: The location upon which run commands is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_12_01.models.RunCommandListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ async def get( location: str, command_id: str, **kwargs - ) -> "models.RunCommandDocument": + ) -> "_models.RunCommandDocument": """Gets specific run command for a subscription in a location. :param location: The location upon which run commands is queried. @@ -128,7 +128,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2017_12_01.models.RunCommandDocument :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandDocument"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index e9b7cca79d06..070db0b6dc3d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetExtensionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, vm_scale_set_name: str, vmss_extension_name: str, - extension_parameters: "models.VirtualMachineScaleSetExtension", + extension_parameters: "_models.VirtualMachineScaleSetExtension", **kwargs - ) -> "models.VirtualMachineScaleSetExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + ) -> "_models.VirtualMachineScaleSetExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def begin_create_or_update( resource_group_name: str, vm_scale_set_name: str, vmss_extension_name: str, - extension_parameters: "models.VirtualMachineScaleSetExtension", + extension_parameters: "_models.VirtualMachineScaleSetExtension", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSetExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSetExtension"]: """The operation to create or update an extension. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -179,8 +186,8 @@ async def _delete_initial( vm_scale_set_name: str, vmss_extension_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -230,7 +237,7 @@ async def begin_delete( vm_scale_set_name: str, vmss_extension_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -250,7 +257,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -275,7 +282,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -296,7 +310,7 @@ async def get( vmss_extension_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineScaleSetExtension": + ) -> "_models.VirtualMachineScaleSetExtension": """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -312,7 +326,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -361,7 +375,7 @@ def list( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetExtensionListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetExtensionListResult"]: """Gets a list of all extensions in a VM scale set. :param resource_group_name: The name of the resource group. @@ -373,7 +387,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetExtensionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtensionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 68d208ab5727..6f16793fd4e4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VirtualMachineScaleSetRollingUpgradesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,8 +47,8 @@ async def _cancel_initial( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -96,7 +96,7 @@ async def begin_cancel( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Cancels the current virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -114,7 +114,7 @@ async def begin_cancel( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -138,7 +138,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -157,8 +163,8 @@ async def _start_os_upgrade_initial( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -206,7 +212,7 @@ async def begin_start_os_upgrade( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. @@ -226,7 +232,7 @@ async def begin_start_os_upgrade( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -250,7 +256,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -269,7 +281,7 @@ async def get_latest( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.RollingUpgradeStatusInfo": + ) -> "_models.RollingUpgradeStatusInfo": """Gets the status of the latest virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -281,7 +293,7 @@ async def get_latest( :rtype: ~azure.mgmt.compute.v2017_12_01.models.RollingUpgradeStatusInfo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RollingUpgradeStatusInfo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index ee7bb58211c6..d92771d9465f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetVMsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,8 +49,8 @@ async def _reimage_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -100,7 +100,7 @@ async def begin_reimage( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -120,7 +120,7 @@ async def begin_reimage( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -145,7 +145,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -165,8 +172,8 @@ async def _reimage_all_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +223,7 @@ async def begin_reimage_all( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. @@ -237,7 +244,7 @@ async def begin_reimage_all( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -262,7 +269,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -282,8 +296,8 @@ async def _deallocate_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -333,7 +347,7 @@ async def begin_deallocate( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. @@ -355,7 +369,7 @@ async def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -380,7 +394,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -399,10 +420,10 @@ async def _update_initial( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.VirtualMachineScaleSetVM", + parameters: "_models.VirtualMachineScaleSetVM", **kwargs - ) -> "models.VirtualMachineScaleSetVM": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + ) -> "_models.VirtualMachineScaleSetVM": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -458,9 +479,9 @@ async def begin_update( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.VirtualMachineScaleSetVM", + parameters: "_models.VirtualMachineScaleSetVM", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSetVM"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSetVM"]: """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. @@ -483,7 +504,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -509,7 +530,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -529,8 +557,8 @@ async def _delete_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -580,7 +608,7 @@ async def begin_delete( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -600,7 +628,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -625,7 +653,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -645,7 +680,7 @@ async def get( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.VirtualMachineScaleSetVM": + ) -> "_models.VirtualMachineScaleSetVM": """Gets a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -659,7 +694,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetVM :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -707,7 +742,7 @@ async def get_instance_view( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.VirtualMachineScaleSetVMInstanceView": + ) -> "_models.VirtualMachineScaleSetVMInstanceView": """Gets the status of a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -721,7 +756,7 @@ async def get_instance_view( :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetVMInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -771,7 +806,7 @@ def list( select: Optional[str] = None, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetVMListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetVMListResult"]: """Gets a list of all virtual machines in a VM scale sets. :param resource_group_name: The name of the resource group. @@ -792,7 +827,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetVMListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -861,8 +896,8 @@ async def _power_off_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -912,7 +947,7 @@ async def begin_power_off( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. @@ -934,7 +969,7 @@ async def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -959,7 +994,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -979,8 +1021,8 @@ async def _restart_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1030,7 +1072,7 @@ async def begin_restart( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1050,7 +1092,7 @@ async def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1075,7 +1117,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1095,8 +1144,8 @@ async def _start_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1146,7 +1195,7 @@ async def begin_start( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1166,7 +1215,7 @@ async def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1191,7 +1240,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1211,8 +1267,8 @@ async def _redeploy_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1262,7 +1318,7 @@ async def begin_redeploy( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. @@ -1283,7 +1339,7 @@ async def begin_redeploy( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1308,7 +1364,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1328,8 +1391,8 @@ async def _perform_maintenance_initial( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1379,7 +1442,7 @@ async def begin_perform_maintenance( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Performs maintenance on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1399,7 +1462,7 @@ async def begin_perform_maintenance( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1424,7 +1487,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_sets_operations.py index adcca08f9357..303cace70a7f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSet", + parameters: "_models.VirtualMachineScaleSet", **kwargs - ) -> "models.VirtualMachineScaleSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + ) -> "_models.VirtualMachineScaleSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSet", + parameters: "_models.VirtualMachineScaleSet", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSet"]: """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -169,10 +175,10 @@ async def _update_initial( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSetUpdate", + parameters: "_models.VirtualMachineScaleSetUpdate", **kwargs - ) -> "models.VirtualMachineScaleSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + ) -> "_models.VirtualMachineScaleSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -222,9 +228,9 @@ async def begin_update( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSetUpdate", + parameters: "_models.VirtualMachineScaleSetUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSet"]: """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -244,7 +250,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -269,7 +275,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -288,8 +300,8 @@ async def _delete_initial( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -337,7 +349,7 @@ async def begin_delete( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -355,7 +367,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -379,7 +391,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -398,7 +416,7 @@ async def get( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> "_models.VirtualMachineScaleSet": """Display information about a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -410,7 +428,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -455,10 +473,10 @@ async def _deallocate_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -513,9 +531,9 @@ async def begin_deallocate( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. @@ -537,7 +555,7 @@ async def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -562,7 +580,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -580,10 +604,10 @@ async def _delete_instances_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -635,9 +659,9 @@ async def begin_delete_instances( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -657,7 +681,7 @@ async def begin_delete_instances( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -682,7 +706,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -701,7 +731,7 @@ async def get_instance_view( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.VirtualMachineScaleSetInstanceView": + ) -> "_models.VirtualMachineScaleSetInstanceView": """Gets the status of a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -713,7 +743,7 @@ async def get_instance_view( :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -758,7 +788,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListResult"]: """Gets a list of all VM scale sets under a resource group. :param resource_group_name: The name of the resource group. @@ -768,7 +798,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -827,7 +857,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListWithLinkResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListWithLinkResult"]: """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. @@ -837,7 +867,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetListWithLinkResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListWithLinkResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -897,7 +927,7 @@ def list_skus( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListSkusResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListSkusResult"]: """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. @@ -910,7 +940,7 @@ def list_skus( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetListSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -972,7 +1002,7 @@ def get_os_upgrade_history( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListOSUpgradeHistory"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListOSUpgradeHistory"]: """Gets list of OS upgrades on a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -984,7 +1014,7 @@ def get_os_upgrade_history( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetListOSUpgradeHistory] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListOSUpgradeHistory"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1045,10 +1075,10 @@ async def _power_off_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1103,9 +1133,9 @@ async def begin_power_off( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. @@ -1127,7 +1157,7 @@ async def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1152,7 +1182,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1170,10 +1206,10 @@ async def _restart_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1228,9 +1264,9 @@ async def begin_restart( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1250,7 +1286,7 @@ async def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1275,7 +1311,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1293,10 +1335,10 @@ async def _start_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1351,9 +1393,9 @@ async def begin_start( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1373,7 +1415,7 @@ async def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1398,7 +1440,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1416,10 +1464,10 @@ async def _redeploy_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1474,9 +1522,9 @@ async def begin_redeploy( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. @@ -1497,7 +1545,7 @@ async def begin_redeploy( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1522,7 +1570,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1540,10 +1594,10 @@ async def _perform_maintenance_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1598,9 +1652,9 @@ async def begin_perform_maintenance( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- @@ -1623,7 +1677,7 @@ async def begin_perform_maintenance( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1648,7 +1702,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1666,10 +1726,10 @@ async def _update_instances_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1721,9 +1781,9 @@ async def begin_update_instances( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1743,7 +1803,7 @@ async def begin_update_instances( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1768,7 +1828,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1786,10 +1852,10 @@ async def _reimage_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1844,9 +1910,9 @@ async def begin_reimage( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1866,7 +1932,7 @@ async def begin_reimage( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1891,7 +1957,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1909,10 +1981,10 @@ async def _reimage_all_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1967,9 +2039,9 @@ async def begin_reimage_all( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. @@ -1990,7 +2062,7 @@ async def begin_reimage_all( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2015,7 +2087,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -2035,7 +2113,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( vm_scale_set_name: str, platform_update_domain: int, **kwargs - ) -> "models.RecoveryWalkResponse": + ) -> "_models.RecoveryWalkResponse": """Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. @@ -2051,7 +2129,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( :rtype: ~azure.mgmt.compute.v2017_12_01.models.RecoveryWalkResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryWalkResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_sizes_operations.py index fba192be46c5..dc21b067c3ae 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_sizes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VirtualMachineSizesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes for a subscription in a location. :param location: The location upon which virtual-machine-sizes is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machines_operations.py index 4fe031ebdc97..7faf9fdfc548 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machines_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachinesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,7 +49,7 @@ async def get_extensions( vm_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtensionsListResult": + ) -> "_models.VirtualMachineExtensionsListResult": """The operation to get all extensions of a Virtual Machine. :param resource_group_name: The name of the resource group. @@ -63,7 +63,7 @@ async def get_extensions( :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineExtensionsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,7 +110,7 @@ def list_by_location( self, location: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Gets all the virtual machines under the specified subscription for the specified location. :param location: The location for which virtual machines under the subscription are queried. @@ -120,7 +120,7 @@ def list_by_location( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -180,10 +180,10 @@ async def _capture_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineCaptureParameters", + parameters: "_models.VirtualMachineCaptureParameters", **kwargs - ) -> Optional["models.VirtualMachineCaptureResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + ) -> Optional["_models.VirtualMachineCaptureResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualMachineCaptureResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,9 +235,9 @@ async def begin_capture( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineCaptureParameters", + parameters: "_models.VirtualMachineCaptureParameters", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineCaptureResult"]: + ) -> AsyncLROPoller["_models.VirtualMachineCaptureResult"]: """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -258,7 +258,7 @@ async def begin_capture( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -283,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -301,10 +307,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachine", + parameters: "_models.VirtualMachine", **kwargs - ) -> "models.VirtualMachine": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + ) -> "_models.VirtualMachine": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -358,9 +364,9 @@ async def begin_create_or_update( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachine", + parameters: "_models.VirtualMachine", **kwargs - ) -> AsyncLROPoller["models.VirtualMachine"]: + ) -> AsyncLROPoller["_models.VirtualMachine"]: """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -380,7 +386,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -405,7 +411,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -423,10 +435,10 @@ async def _update_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineUpdate", + parameters: "_models.VirtualMachineUpdate", **kwargs - ) -> "models.VirtualMachine": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + ) -> "_models.VirtualMachine": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -480,9 +492,9 @@ async def begin_update( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineUpdate", + parameters: "_models.VirtualMachineUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachine"]: + ) -> AsyncLROPoller["_models.VirtualMachine"]: """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -502,7 +514,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -527,7 +539,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -546,8 +564,8 @@ async def _delete_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -595,7 +613,7 @@ async def begin_delete( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -613,7 +631,7 @@ async def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -637,7 +655,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -657,7 +681,7 @@ async def get( vm_name: str, expand: Optional[str] = "instanceView", **kwargs - ) -> "models.VirtualMachine": + ) -> "_models.VirtualMachine": """Retrieves information about the model view or the instance view of a virtual machine. :param resource_group_name: The name of the resource group. @@ -671,7 +695,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachine :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -719,7 +743,7 @@ async def instance_view( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.VirtualMachineInstanceView": + ) -> "_models.VirtualMachineInstanceView": """Retrieves information about the run-time state of a virtual machine. :param resource_group_name: The name of the resource group. @@ -731,7 +755,7 @@ async def instance_view( :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -777,8 +801,8 @@ async def _convert_to_managed_disks_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -826,7 +850,7 @@ async def begin_convert_to_managed_disks( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- deallocated before invoking this operation. @@ -845,7 +869,7 @@ async def begin_convert_to_managed_disks( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -869,7 +893,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -888,8 +918,8 @@ async def _deallocate_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -937,7 +967,7 @@ async def begin_deallocate( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. @@ -956,7 +986,7 @@ async def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -980,7 +1010,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -999,7 +1035,7 @@ async def generalize( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.OperationStatusResponse": + ) -> "_models.OperationStatusResponse": """Sets the state of the virtual machine to generalized. :param resource_group_name: The name of the resource group. @@ -1011,7 +1047,7 @@ async def generalize( :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1056,7 +1092,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. @@ -1067,7 +1103,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1126,7 +1162,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. @@ -1135,7 +1171,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1195,7 +1231,7 @@ def list_available_sizes( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes to which the specified virtual machine can be resized. @@ -1208,7 +1244,7 @@ def list_available_sizes( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1270,8 +1306,8 @@ async def _power_off_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1319,7 +1355,7 @@ async def begin_power_off( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. @@ -1338,7 +1374,7 @@ async def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1362,7 +1398,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1381,8 +1423,8 @@ async def _restart_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1430,7 +1472,7 @@ async def begin_restart( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1448,7 +1490,7 @@ async def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1472,7 +1514,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1491,8 +1539,8 @@ async def _start_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1540,7 +1588,7 @@ async def begin_start( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1558,7 +1606,7 @@ async def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1582,7 +1630,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1601,8 +1655,8 @@ async def _redeploy_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1650,7 +1704,7 @@ async def begin_redeploy( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1668,7 +1722,7 @@ async def begin_redeploy( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1692,7 +1746,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1711,8 +1771,8 @@ async def _perform_maintenance_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.OperationStatusResponse"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + ) -> Optional["_models.OperationStatusResponse"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1760,7 +1820,7 @@ async def begin_perform_maintenance( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.OperationStatusResponse"]: + ) -> AsyncLROPoller["_models.OperationStatusResponse"]: """The operation to perform maintenance on a virtual machine. :param resource_group_name: The name of the resource group. @@ -1778,7 +1838,7 @@ async def begin_perform_maintenance( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1802,7 +1862,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1820,10 +1886,10 @@ async def _run_command_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> Optional["models.RunCommandResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + ) -> Optional["_models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1875,9 +1941,9 @@ async def begin_run_command( self, resource_group_name: str, vm_name: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> AsyncLROPoller["models.RunCommandResult"]: + ) -> AsyncLROPoller["_models.RunCommandResult"]: """Run command on the VM. :param resource_group_name: The name of the resource group. @@ -1897,7 +1963,7 @@ async def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1922,7 +1988,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_availability_sets_operations.py index 3947c78c0965..a38cbc39e245 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_availability_sets_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailabilitySetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str availability_set_name, # type: str - parameters, # type: "models.AvailabilitySet" + parameters, # type: "_models.AvailabilitySet" **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Create or update an availability set. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~azure.mgmt.compute.v2017_12_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,10 +116,10 @@ def update( self, resource_group_name, # type: str availability_set_name, # type: str - parameters, # type: "models.AvailabilitySetUpdate" + parameters, # type: "_models.AvailabilitySetUpdate" **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Update an availability set. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ def update( :rtype: ~azure.mgmt.compute.v2017_12_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -185,7 +185,7 @@ def delete( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] + # type: (...) -> Optional["_models.OperationStatusResponse"] """Delete an availability set. :param resource_group_name: The name of the resource group. @@ -197,7 +197,7 @@ def delete( :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -246,7 +246,7 @@ def get( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Retrieves information about an availability set. :param resource_group_name: The name of the resource group. @@ -258,7 +258,7 @@ def get( :rtype: ~azure.mgmt.compute.v2017_12_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -304,7 +304,7 @@ def list_by_subscription( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailabilitySetListResult"] + # type: (...) -> Iterable["_models.AvailabilitySetListResult"] """Lists all availability sets in a subscription. :param expand: The expand expression to apply to the operation. Allowed values are @@ -315,7 +315,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_12_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -377,7 +377,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailabilitySetListResult"] + # type: (...) -> Iterable["_models.AvailabilitySetListResult"] """Lists all availability sets in a resource group. :param resource_group_name: The name of the resource group. @@ -387,7 +387,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_12_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -449,7 +449,7 @@ def list_available_sizes( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. @@ -462,7 +462,7 @@ def list_available_sizes( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_images_operations.py index f7883de12a4e..2eaa07ae4aec 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.Image" + parameters, # type: "_models.Image" **kwargs # type: Any ): - # type: (...) -> "models.Image" - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + # type: (...) -> "_models.Image" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.Image" + parameters, # type: "_models.Image" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Image"] + # type: (...) -> LROPoller["_models.Image"] """Create or update an image. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -175,11 +181,11 @@ def _update_initial( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.ImageUpdate" + parameters, # type: "_models.ImageUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Image" - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + # type: (...) -> "_models.Image" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -233,10 +239,10 @@ def begin_update( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.ImageUpdate" + parameters, # type: "_models.ImageUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Image"] + # type: (...) -> LROPoller["_models.Image"] """Update an image. :param resource_group_name: The name of the resource group. @@ -256,7 +262,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -281,7 +287,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -301,8 +313,8 @@ def _delete_initial( image_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -351,7 +363,7 @@ def begin_delete( image_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deletes an Image. :param resource_group_name: The name of the resource group. @@ -369,7 +381,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -393,7 +405,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -414,7 +432,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Image" + # type: (...) -> "_models.Image" """Gets an image. :param resource_group_name: The name of the resource group. @@ -428,7 +446,7 @@ def get( :rtype: ~azure.mgmt.compute.v2017_12_01.models.Image :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +494,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ImageListResult"] + # type: (...) -> Iterable["_models.ImageListResult"] """Gets the list of images under a resource group. :param resource_group_name: The name of the resource group. @@ -486,7 +504,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_12_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -546,7 +564,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ImageListResult"] + # type: (...) -> Iterable["_models.ImageListResult"] """Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. @@ -555,7 +573,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_12_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_log_analytics_operations.py index c2ebc332ba1b..896b2e8b4156 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_log_analytics_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class LogAnalyticsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,11 +49,11 @@ def __init__(self, client, config, serializer, deserializer): def _export_request_rate_by_interval_initial( self, location, # type: str - parameters, # type: "models.RequestRateByIntervalInput" + parameters, # type: "_models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> Optional["models.LogAnalyticsOperationResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + # type: (...) -> Optional["_models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -103,10 +103,10 @@ def _export_request_rate_by_interval_initial( def begin_export_request_rate_by_interval( self, location, # type: str - parameters, # type: "models.RequestRateByIntervalInput" + parameters, # type: "_models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] + # type: (...) -> LROPoller["_models.LogAnalyticsOperationResult"] """Export logs that show Api requests made by this subscription in the given time window to show throttling activities. @@ -125,7 +125,7 @@ def begin_export_request_rate_by_interval( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -149,7 +149,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -166,11 +171,11 @@ def get_long_running_output(pipeline_response): def _export_throttled_requests_initial( self, location, # type: str - parameters, # type: "models.LogAnalyticsInputBase" + parameters, # type: "_models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> Optional["models.LogAnalyticsOperationResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + # type: (...) -> Optional["_models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,10 +225,10 @@ def _export_throttled_requests_initial( def begin_export_throttled_requests( self, location, # type: str - parameters, # type: "models.LogAnalyticsInputBase" + parameters, # type: "_models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] + # type: (...) -> LROPoller["_models.LogAnalyticsOperationResult"] """Export logs that show total throttled Api requests for this subscription in the given time window. @@ -242,7 +247,7 @@ def begin_export_throttled_requests( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -266,7 +271,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_operations.py index 70571ce82704..4e7caf566901 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ComputeOperationListResult"] + # type: (...) -> Iterable["_models.ComputeOperationListResult"] """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_12_01.models.ComputeOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeOperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_usage_operations.py index 0ebc0aa6bc26..13017bce982d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsageOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListUsagesResult"] + # type: (...) -> Iterable["_models.ListUsagesResult"] """Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_12_01.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extension_images_operations.py index 24c7d71a9905..9ed90523be3c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extension_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VirtualMachineExtensionImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( version, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtensionImage" + # type: (...) -> "_models.VirtualMachineExtensionImage" """Gets a virtual machine extension image. :param location: The name of a supported Azure region. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineExtensionImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def list_types( publisher_name, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineExtensionImage"] + # type: (...) -> List["_models.VirtualMachineExtensionImage"] """Gets a list of virtual machine extension image types. :param location: The name of a supported Azure region. @@ -129,7 +129,7 @@ def list_types( :rtype: list[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -180,7 +180,7 @@ def list_versions( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineExtensionImage"] + # type: (...) -> List["_models.VirtualMachineExtensionImage"] """Gets a list of virtual machine extension image versions. :param location: The name of a supported Azure region. @@ -200,7 +200,7 @@ def list_versions( :rtype: list[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extensions_operations.py index f8933d5aa9d4..e9baa58c9a15 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VirtualMachineExtensionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineExtension"] """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -183,11 +190,11 @@ def _update_initial( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -239,10 +246,10 @@ def begin_update( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineExtension"] """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -265,7 +272,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -291,7 +298,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -312,8 +326,8 @@ def _delete_initial( vm_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -364,7 +378,7 @@ def begin_delete( vm_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -384,7 +398,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -409,7 +423,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -431,7 +452,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" + # type: (...) -> "_models.VirtualMachineExtension" """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -447,7 +468,7 @@ def get( :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_images_operations.py index fa6d5c0ad310..16cdc4efcce4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VirtualMachineImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( version, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineImage" + # type: (...) -> "_models.VirtualMachineImage" """Gets a virtual machine image. :param location: The name of a supported Azure region. @@ -71,7 +71,7 @@ def get( :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -126,7 +126,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. @@ -149,7 +149,7 @@ def list( :rtype: list[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -204,7 +204,7 @@ def list_offers( publisher_name, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image offers for the specified location and publisher. :param location: The name of a supported Azure region. @@ -216,7 +216,7 @@ def list_offers( :rtype: list[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,7 +262,7 @@ def list_publishers( location, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image publishers for the specified Azure location. :param location: The name of a supported Azure region. @@ -272,7 +272,7 @@ def list_publishers( :rtype: list[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -319,7 +319,7 @@ def list_skus( offer, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. :param location: The name of a supported Azure region. @@ -333,7 +333,7 @@ def list_skus( :rtype: list[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_run_commands_operations.py index b7c14f970db2..a0fe433da375 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_run_commands_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VirtualMachineRunCommandsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RunCommandListResult"] + # type: (...) -> Iterable["_models.RunCommandListResult"] """Lists all available run commands for a subscription in a location. :param location: The location upon which run commands is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_12_01.models.RunCommandListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def get( command_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RunCommandDocument" + # type: (...) -> "_models.RunCommandDocument" """Gets specific run command for a subscription in a location. :param location: The location upon which run commands is queried. @@ -134,7 +134,7 @@ def get( :rtype: ~azure.mgmt.compute.v2017_12_01.models.RunCommandDocument :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandDocument"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_extensions_operations.py index 9b478cd1e2fe..72de407521c8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetExtensionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str vm_scale_set_name, # type: str vmss_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineScaleSetExtension" + extension_parameters, # type: "_models.VirtualMachineScaleSetExtension" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + # type: (...) -> "_models.VirtualMachineScaleSetExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def begin_create_or_update( resource_group_name, # type: str vm_scale_set_name, # type: str vmss_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineScaleSetExtension" + extension_parameters, # type: "_models.VirtualMachineScaleSetExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSetExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSetExtension"] """The operation to create or update an extension. :param resource_group_name: The name of the resource group. @@ -139,7 +139,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -165,7 +165,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -186,8 +193,8 @@ def _delete_initial( vmss_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -238,7 +245,7 @@ def begin_delete( vmss_extension_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to delete the extension. :param resource_group_name: The name of the resource group. @@ -258,7 +265,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -283,7 +290,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -305,7 +319,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetExtension" + # type: (...) -> "_models.VirtualMachineScaleSetExtension" """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -321,7 +335,7 @@ def get( :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -371,7 +385,7 @@ def list( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetExtensionListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetExtensionListResult"] """Gets a list of all extensions in a VM scale set. :param resource_group_name: The name of the resource group. @@ -383,7 +397,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetExtensionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtensionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index c2b2244e22cd..d8fd7deb508a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VirtualMachineScaleSetRollingUpgradesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,8 +52,8 @@ def _cancel_initial( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def begin_cancel( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Cancels the current virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -120,7 +120,7 @@ def begin_cancel( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -144,7 +144,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -164,8 +170,8 @@ def _start_os_upgrade_initial( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -214,7 +220,7 @@ def begin_start_os_upgrade( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. @@ -234,7 +240,7 @@ def begin_start_os_upgrade( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -258,7 +264,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -278,7 +290,7 @@ def get_latest( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RollingUpgradeStatusInfo" + # type: (...) -> "_models.RollingUpgradeStatusInfo" """Gets the status of the latest virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -290,7 +302,7 @@ def get_latest( :rtype: ~azure.mgmt.compute.v2017_12_01.models.RollingUpgradeStatusInfo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RollingUpgradeStatusInfo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_vms_operations.py index af0c14cfd33a..70a662c7cbc4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetVMsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,8 +54,8 @@ def _reimage_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,7 +106,7 @@ def begin_reimage( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ def begin_reimage( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -172,8 +179,8 @@ def _reimage_all_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -224,7 +231,7 @@ def begin_reimage_all( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. @@ -245,7 +252,7 @@ def begin_reimage_all( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -270,7 +277,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -291,8 +305,8 @@ def _deallocate_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -343,7 +357,7 @@ def begin_deallocate( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. @@ -365,7 +379,7 @@ def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -390,7 +404,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -409,11 +430,11 @@ def _update_initial( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.VirtualMachineScaleSetVM" + parameters, # type: "_models.VirtualMachineScaleSetVM" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVM" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + # type: (...) -> "_models.VirtualMachineScaleSetVM" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -469,10 +490,10 @@ def begin_update( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.VirtualMachineScaleSetVM" + parameters, # type: "_models.VirtualMachineScaleSetVM" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSetVM"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSetVM"] """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. @@ -495,7 +516,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -521,7 +542,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -542,8 +570,8 @@ def _delete_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -594,7 +622,7 @@ def begin_delete( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deletes a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -614,7 +642,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -639,7 +667,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -660,7 +695,7 @@ def get( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVM" + # type: (...) -> "_models.VirtualMachineScaleSetVM" """Gets a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -674,7 +709,7 @@ def get( :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetVM :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -723,7 +758,7 @@ def get_instance_view( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVMInstanceView" + # type: (...) -> "_models.VirtualMachineScaleSetVMInstanceView" """Gets the status of a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -737,7 +772,7 @@ def get_instance_view( :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetVMInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -788,7 +823,7 @@ def list( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetVMListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetVMListResult"] """Gets a list of all virtual machines in a VM scale sets. :param resource_group_name: The name of the resource group. @@ -809,7 +844,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetVMListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -879,8 +914,8 @@ def _power_off_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -931,7 +966,7 @@ def begin_power_off( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. @@ -953,7 +988,7 @@ def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -978,7 +1013,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -999,8 +1041,8 @@ def _restart_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1051,7 +1093,7 @@ def begin_restart( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Restarts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1071,7 +1113,7 @@ def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1096,7 +1138,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1117,8 +1166,8 @@ def _start_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1169,7 +1218,7 @@ def begin_start( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Starts a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1189,7 +1238,7 @@ def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1214,7 +1263,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1235,8 +1291,8 @@ def _redeploy_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1287,7 +1343,7 @@ def begin_redeploy( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. @@ -1308,7 +1364,7 @@ def begin_redeploy( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1333,7 +1389,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1354,8 +1417,8 @@ def _perform_maintenance_initial( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1406,7 +1469,7 @@ def begin_perform_maintenance( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Performs maintenance on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1426,7 +1489,7 @@ def begin_perform_maintenance( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1451,7 +1514,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_sets_operations.py index 968d5bbc368e..a88880422fe6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSet" + parameters, # type: "_models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + # type: (...) -> "_models.VirtualMachineScaleSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSet" + parameters, # type: "_models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSet"] """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -175,11 +181,11 @@ def _update_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSetUpdate" + parameters, # type: "_models.VirtualMachineScaleSetUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + # type: (...) -> "_models.VirtualMachineScaleSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -229,10 +235,10 @@ def begin_update( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSetUpdate" + parameters, # type: "_models.VirtualMachineScaleSetUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSet"] """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -297,8 +309,8 @@ def _delete_initial( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -347,7 +359,7 @@ def begin_delete( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deletes a VM scale set. :param resource_group_name: The name of the resource group. @@ -365,7 +377,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -389,7 +401,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -409,7 +427,7 @@ def get( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" + # type: (...) -> "_models.VirtualMachineScaleSet" """Display information about a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -421,7 +439,7 @@ def get( :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,11 +484,11 @@ def _deallocate_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -525,10 +543,10 @@ def begin_deallocate( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. @@ -550,7 +568,7 @@ def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -575,7 +593,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -593,11 +617,11 @@ def _delete_instances_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -649,10 +673,10 @@ def begin_delete_instances( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Deletes virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -672,7 +696,7 @@ def begin_delete_instances( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -697,7 +721,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -717,7 +747,7 @@ def get_instance_view( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetInstanceView" + # type: (...) -> "_models.VirtualMachineScaleSetInstanceView" """Gets the status of a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -729,7 +759,7 @@ def get_instance_view( :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -775,7 +805,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListResult"] """Gets a list of all VM scale sets under a resource group. :param resource_group_name: The name of the resource group. @@ -785,7 +815,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -845,7 +875,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListWithLinkResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListWithLinkResult"] """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. @@ -855,7 +885,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetListWithLinkResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListWithLinkResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -916,7 +946,7 @@ def list_skus( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListSkusResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListSkusResult"] """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. @@ -929,7 +959,7 @@ def list_skus( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetListSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -992,7 +1022,7 @@ def get_os_upgrade_history( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListOSUpgradeHistory"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListOSUpgradeHistory"] """Gets list of OS upgrades on a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -1004,7 +1034,7 @@ def get_os_upgrade_history( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineScaleSetListOSUpgradeHistory] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListOSUpgradeHistory"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1065,11 +1095,11 @@ def _power_off_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1124,10 +1154,10 @@ def begin_power_off( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. @@ -1149,7 +1179,7 @@ def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1174,7 +1204,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1192,11 +1228,11 @@ def _restart_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1251,10 +1287,10 @@ def begin_restart( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Restarts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1274,7 +1310,7 @@ def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1299,7 +1335,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1317,11 +1359,11 @@ def _start_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1376,10 +1418,10 @@ def begin_start( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Starts one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1399,7 +1441,7 @@ def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1424,7 +1466,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1442,11 +1490,11 @@ def _redeploy_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1501,10 +1549,10 @@ def begin_redeploy( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. @@ -1525,7 +1573,7 @@ def begin_redeploy( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1550,7 +1598,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1568,11 +1622,11 @@ def _perform_maintenance_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1627,10 +1681,10 @@ def begin_perform_maintenance( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual- @@ -1653,7 +1707,7 @@ def begin_perform_maintenance( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1678,7 +1732,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1696,11 +1756,11 @@ def _update_instances_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1752,10 +1812,10 @@ def begin_update_instances( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. :param resource_group_name: The name of the resource group. @@ -1775,7 +1835,7 @@ def begin_update_instances( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1800,7 +1860,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1818,11 +1884,11 @@ def _reimage_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1877,10 +1943,10 @@ def begin_reimage( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1900,7 +1966,7 @@ def begin_reimage( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1925,7 +1991,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1943,11 +2015,11 @@ def _reimage_all_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2002,10 +2074,10 @@ def begin_reimage_all( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. @@ -2026,7 +2098,7 @@ def begin_reimage_all( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2051,7 +2123,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -2072,7 +2150,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( platform_update_domain, # type: int **kwargs # type: Any ): - # type: (...) -> "models.RecoveryWalkResponse" + # type: (...) -> "_models.RecoveryWalkResponse" """Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. @@ -2088,7 +2166,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( :rtype: ~azure.mgmt.compute.v2017_12_01.models.RecoveryWalkResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryWalkResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_sizes_operations.py index 2c4d0aa29068..ec47c1b2ed05 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_sizes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VirtualMachineSizesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes for a subscription in a location. :param location: The location upon which virtual-machine-sizes is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machines_operations.py index d3fdd9273b28..633d340b848b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machines_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachinesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -54,7 +54,7 @@ def get_extensions( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtensionsListResult" + # type: (...) -> "_models.VirtualMachineExtensionsListResult" """The operation to get all extensions of a Virtual Machine. :param resource_group_name: The name of the resource group. @@ -68,7 +68,7 @@ def get_extensions( :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineExtensionsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ def list_by_location( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Gets all the virtual machines under the specified subscription for the specified location. :param location: The location for which virtual machines under the subscription are queried. @@ -126,7 +126,7 @@ def list_by_location( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -186,11 +186,11 @@ def _capture_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineCaptureParameters" + parameters, # type: "_models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualMachineCaptureResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + # type: (...) -> Optional["_models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualMachineCaptureResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -242,10 +242,10 @@ def begin_capture( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineCaptureParameters" + parameters, # type: "_models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineCaptureResult"] + # type: (...) -> LROPoller["_models.VirtualMachineCaptureResult"] """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -266,7 +266,7 @@ def begin_capture( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -291,7 +291,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -309,11 +315,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachine" + parameters, # type: "_models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + # type: (...) -> "_models.VirtualMachine" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -367,10 +373,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachine" + parameters, # type: "_models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachine"] + # type: (...) -> LROPoller["_models.VirtualMachine"] """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -390,7 +396,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -415,7 +421,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -433,11 +445,11 @@ def _update_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineUpdate" + parameters, # type: "_models.VirtualMachineUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + # type: (...) -> "_models.VirtualMachine" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -491,10 +503,10 @@ def begin_update( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineUpdate" + parameters, # type: "_models.VirtualMachineUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachine"] + # type: (...) -> LROPoller["_models.VirtualMachine"] """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -514,7 +526,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -539,7 +551,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -559,8 +577,8 @@ def _delete_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -609,7 +627,7 @@ def begin_delete( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to delete a virtual machine. :param resource_group_name: The name of the resource group. @@ -627,7 +645,7 @@ def begin_delete( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -651,7 +669,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -672,7 +696,7 @@ def get( expand="instanceView", # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" + # type: (...) -> "_models.VirtualMachine" """Retrieves information about the model view or the instance view of a virtual machine. :param resource_group_name: The name of the resource group. @@ -686,7 +710,7 @@ def get( :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachine :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -735,7 +759,7 @@ def instance_view( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineInstanceView" + # type: (...) -> "_models.VirtualMachineInstanceView" """Retrieves information about the run-time state of a virtual machine. :param resource_group_name: The name of the resource group. @@ -747,7 +771,7 @@ def instance_view( :rtype: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -794,8 +818,8 @@ def _convert_to_managed_disks_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -844,7 +868,7 @@ def begin_convert_to_managed_disks( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- deallocated before invoking this operation. @@ -863,7 +887,7 @@ def begin_convert_to_managed_disks( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -887,7 +911,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -907,8 +937,8 @@ def _deallocate_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -957,7 +987,7 @@ def begin_deallocate( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. @@ -976,7 +1006,7 @@ def begin_deallocate( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1000,7 +1030,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1020,7 +1056,7 @@ def generalize( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OperationStatusResponse" + # type: (...) -> "_models.OperationStatusResponse" """Sets the state of the virtual machine to generalized. :param resource_group_name: The name of the resource group. @@ -1032,7 +1068,7 @@ def generalize( :rtype: ~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1078,7 +1114,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. @@ -1089,7 +1125,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1149,7 +1185,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. @@ -1158,7 +1194,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1219,7 +1255,7 @@ def list_available_sizes( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes to which the specified virtual machine can be resized. @@ -1232,7 +1268,7 @@ def list_available_sizes( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2017_12_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1295,8 +1331,8 @@ def _power_off_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1345,7 +1381,7 @@ def begin_power_off( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. @@ -1364,7 +1400,7 @@ def begin_power_off( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1388,7 +1424,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1408,8 +1450,8 @@ def _restart_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1458,7 +1500,7 @@ def begin_restart( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to restart a virtual machine. :param resource_group_name: The name of the resource group. @@ -1476,7 +1518,7 @@ def begin_restart( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1500,7 +1542,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1520,8 +1568,8 @@ def _start_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1570,7 +1618,7 @@ def begin_start( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to start a virtual machine. :param resource_group_name: The name of the resource group. @@ -1588,7 +1636,7 @@ def begin_start( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1612,7 +1660,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1632,8 +1686,8 @@ def _redeploy_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1682,7 +1736,7 @@ def begin_redeploy( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """Shuts down the virtual machine, moves it to a new node, and powers it back on. :param resource_group_name: The name of the resource group. @@ -1700,7 +1754,7 @@ def begin_redeploy( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1724,7 +1778,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1744,8 +1804,8 @@ def _perform_maintenance_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.OperationStatusResponse"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]] + # type: (...) -> Optional["_models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationStatusResponse"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1794,7 +1854,7 @@ def begin_perform_maintenance( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OperationStatusResponse"] + # type: (...) -> LROPoller["_models.OperationStatusResponse"] """The operation to perform maintenance on a virtual machine. :param resource_group_name: The name of the resource group. @@ -1812,7 +1872,7 @@ def begin_perform_maintenance( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResponse"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1836,7 +1896,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1854,11 +1920,11 @@ def _run_command_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> Optional["models.RunCommandResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + # type: (...) -> Optional["_models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1910,10 +1976,10 @@ def begin_run_command( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RunCommandResult"] + # type: (...) -> LROPoller["_models.RunCommandResult"] """Run command on the VM. :param resource_group_name: The name of the resource group. @@ -1933,7 +1999,7 @@ def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1958,7 +2024,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_compute_management_client.py index 66b3b35b3cbc..d6901f63cdda 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_compute_management_client.py @@ -101,7 +101,6 @@ def __init__( 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( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_metadata.json index fc09b853e778..1d932f19740d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/_compute_management_client.py index 5e5dd5ce489b..5b8f59f9cebb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/_compute_management_client.py @@ -98,7 +98,6 @@ def __init__( 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( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_availability_sets_operations.py index e4a56a8ee0f9..d0a641f7d11b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_availability_sets_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailabilitySetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, availability_set_name: str, - parameters: "models.AvailabilitySet", + parameters: "_models.AvailabilitySet", **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Create or update an availability set. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~azure.mgmt.compute.v2018_04_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,9 +111,9 @@ async def update( self, resource_group_name: str, availability_set_name: str, - parameters: "models.AvailabilitySetUpdate", + parameters: "_models.AvailabilitySetUpdate", **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Update an availability set. :param resource_group_name: The name of the resource group. @@ -127,7 +127,7 @@ async def update( :rtype: ~azure.mgmt.compute.v2018_04_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +231,7 @@ async def get( resource_group_name: str, availability_set_name: str, **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Retrieves information about an availability set. :param resource_group_name: The name of the resource group. @@ -243,7 +243,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_04_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,7 +288,7 @@ def list_by_subscription( self, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.AvailabilitySetListResult"]: + ) -> AsyncIterable["_models.AvailabilitySetListResult"]: """Lists all availability sets in a subscription. :param expand: The expand expression to apply to the operation. Allowed values are @@ -299,7 +299,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_04_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -360,7 +360,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailabilitySetListResult"]: + ) -> AsyncIterable["_models.AvailabilitySetListResult"]: """Lists all availability sets in a resource group. :param resource_group_name: The name of the resource group. @@ -370,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_04_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -431,7 +431,7 @@ def list_available_sizes( resource_group_name: str, availability_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. @@ -444,7 +444,7 @@ def list_available_sizes( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_disks_operations.py index 2f868603305c..15e0f18af6ca 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_disks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DisksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, disk_name: str, - disk: "models.Disk", + disk: "_models.Disk", **kwargs - ) -> "models.Disk": - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + ) -> "_models.Disk": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, disk_name: str, - disk: "models.Disk", + disk: "_models.Disk", **kwargs - ) -> AsyncLROPoller["models.Disk"]: + ) -> AsyncLROPoller["_models.Disk"]: """Creates or updates a disk. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -171,10 +177,10 @@ async def _update_initial( self, resource_group_name: str, disk_name: str, - disk: "models.DiskUpdate", + disk: "_models.DiskUpdate", **kwargs - ) -> "models.Disk": - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + ) -> "_models.Disk": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,9 +234,9 @@ async def begin_update( self, resource_group_name: str, disk_name: str, - disk: "models.DiskUpdate", + disk: "_models.DiskUpdate", **kwargs - ) -> AsyncLROPoller["models.Disk"]: + ) -> AsyncLROPoller["_models.Disk"]: """Updates (patches) a disk. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -296,7 +308,7 @@ async def get( resource_group_name: str, disk_name: str, **kwargs - ) -> "models.Disk": + ) -> "_models.Disk": """Gets information about a disk. :param resource_group_name: The name of the resource group. @@ -310,7 +322,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_04_01.models.Disk :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -457,7 +475,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DiskList"]: + ) -> AsyncIterable["_models.DiskList"]: """Lists all the disks under a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_04_01.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -526,7 +544,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.DiskList"]: + ) -> AsyncIterable["_models.DiskList"]: """Lists all the disks under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -534,7 +552,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_04_01.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -593,10 +611,10 @@ async def _grant_access_initial( self, resource_group_name: str, disk_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> Optional["models.AccessUri"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + ) -> Optional["_models.AccessUri"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -648,9 +666,9 @@ async def begin_grant_access( self, resource_group_name: str, disk_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> AsyncLROPoller["models.AccessUri"]: + ) -> AsyncLROPoller["_models.AccessUri"]: """Grants access to a disk. :param resource_group_name: The name of the resource group. @@ -673,7 +691,7 @@ async def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -698,7 +716,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -800,7 +824,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_images_operations.py index 491cb906cb5d..fffeb0fc8848 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, image_name: str, - parameters: "models.Image", + parameters: "_models.Image", **kwargs - ) -> "models.Image": - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + ) -> "_models.Image": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, image_name: str, - parameters: "models.Image", + parameters: "_models.Image", **kwargs - ) -> AsyncLROPoller["models.Image"]: + ) -> AsyncLROPoller["_models.Image"]: """Create or update an image. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -169,10 +175,10 @@ async def _update_initial( self, resource_group_name: str, image_name: str, - parameters: "models.ImageUpdate", + parameters: "_models.ImageUpdate", **kwargs - ) -> "models.Image": - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + ) -> "_models.Image": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -226,9 +232,9 @@ async def begin_update( self, resource_group_name: str, image_name: str, - parameters: "models.ImageUpdate", + parameters: "_models.ImageUpdate", **kwargs - ) -> AsyncLROPoller["models.Image"]: + ) -> AsyncLROPoller["_models.Image"]: """Update an image. :param resource_group_name: The name of the resource group. @@ -248,7 +254,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -273,7 +279,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -373,7 +385,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -393,7 +411,7 @@ async def get( image_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Image": + ) -> "_models.Image": """Gets an image. :param resource_group_name: The name of the resource group. @@ -407,7 +425,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_04_01.models.Image :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -454,7 +472,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ImageListResult"]: + ) -> AsyncIterable["_models.ImageListResult"]: """Gets the list of images under a resource group. :param resource_group_name: The name of the resource group. @@ -464,7 +482,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_04_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ImageListResult"]: + ) -> AsyncIterable["_models.ImageListResult"]: """Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. @@ -532,7 +550,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_04_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_log_analytics_operations.py index e95149f867db..1c116857402d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_log_analytics_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class LogAnalyticsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,10 +45,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def _export_request_rate_by_interval_initial( self, location: str, - parameters: "models.RequestRateByIntervalInput", + parameters: "_models.RequestRateByIntervalInput", **kwargs - ) -> Optional["models.LogAnalyticsOperationResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + ) -> Optional["_models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -98,9 +98,9 @@ async def _export_request_rate_by_interval_initial( async def begin_export_request_rate_by_interval( self, location: str, - parameters: "models.RequestRateByIntervalInput", + parameters: "_models.RequestRateByIntervalInput", **kwargs - ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: + ) -> AsyncLROPoller["_models.LogAnalyticsOperationResult"]: """Export logs that show Api requests made by this subscription in the given time window to show throttling activities. @@ -119,7 +119,7 @@ async def begin_export_request_rate_by_interval( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -143,7 +143,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -160,10 +165,10 @@ def get_long_running_output(pipeline_response): async def _export_throttled_requests_initial( self, location: str, - parameters: "models.LogAnalyticsInputBase", + parameters: "_models.LogAnalyticsInputBase", **kwargs - ) -> Optional["models.LogAnalyticsOperationResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + ) -> Optional["_models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -213,9 +218,9 @@ async def _export_throttled_requests_initial( async def begin_export_throttled_requests( self, location: str, - parameters: "models.LogAnalyticsInputBase", + parameters: "_models.LogAnalyticsInputBase", **kwargs - ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: + ) -> AsyncLROPoller["_models.LogAnalyticsOperationResult"]: """Export logs that show total throttled Api requests for this subscription in the given time window. @@ -234,7 +239,7 @@ async def begin_export_throttled_requests( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -258,7 +263,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_operations.py index 8a5cf4d06a83..3ae311719f3e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ComputeOperationListResult"]: + ) -> AsyncIterable["_models.ComputeOperationListResult"]: """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_04_01.models.ComputeOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeOperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_proximity_placement_groups_operations.py index 7a1d0702fc82..58476918bcb2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_proximity_placement_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ProximityPlacementGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, proximity_placement_group_name: str, - parameters: "models.ProximityPlacementGroup", + parameters: "_models.ProximityPlacementGroup", **kwargs - ) -> "models.ProximityPlacementGroup": + ) -> "_models.ProximityPlacementGroup": """Create or update a proximity placement group. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~azure.mgmt.compute.v2018_04_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,9 +115,9 @@ async def update( self, resource_group_name: str, proximity_placement_group_name: str, - parameters: "models.UpdateResource", + parameters: "_models.UpdateResource", **kwargs - ) -> "models.ProximityPlacementGroup": + ) -> "_models.ProximityPlacementGroup": """Update a proximity placement group. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def update( :rtype: ~azure.mgmt.compute.v2018_04_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,7 +235,7 @@ async def get( resource_group_name: str, proximity_placement_group_name: str, **kwargs - ) -> "models.ProximityPlacementGroup": + ) -> "_models.ProximityPlacementGroup": """Retrieves information about a proximity placement group . :param resource_group_name: The name of the resource group. @@ -247,7 +247,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_04_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -291,7 +291,7 @@ async def get( def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.ProximityPlacementGroupListResult"]: + ) -> AsyncIterable["_models.ProximityPlacementGroupListResult"]: """Lists all proximity placement groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -299,7 +299,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_04_01.models.ProximityPlacementGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -358,7 +358,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ProximityPlacementGroupListResult"]: + ) -> AsyncIterable["_models.ProximityPlacementGroupListResult"]: """Lists all proximity placement groups in a resource group. :param resource_group_name: The name of the resource group. @@ -368,7 +368,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_04_01.models.ProximityPlacementGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_snapshots_operations.py index a1c07a217735..2291a7a342b1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_snapshots_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SnapshotsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.Snapshot", + snapshot: "_models.Snapshot", **kwargs - ) -> "models.Snapshot": - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + ) -> "_models.Snapshot": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.Snapshot", + snapshot: "_models.Snapshot", **kwargs - ) -> AsyncLROPoller["models.Snapshot"]: + ) -> AsyncLROPoller["_models.Snapshot"]: """Creates or updates a snapshot. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -171,10 +177,10 @@ async def _update_initial( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.SnapshotUpdate", + snapshot: "_models.SnapshotUpdate", **kwargs - ) -> "models.Snapshot": - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + ) -> "_models.Snapshot": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,9 +234,9 @@ async def begin_update( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.SnapshotUpdate", + snapshot: "_models.SnapshotUpdate", **kwargs - ) -> AsyncLROPoller["models.Snapshot"]: + ) -> AsyncLROPoller["_models.Snapshot"]: """Updates (patches) a snapshot. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -296,7 +308,7 @@ async def get( resource_group_name: str, snapshot_name: str, **kwargs - ) -> "models.Snapshot": + ) -> "_models.Snapshot": """Gets information about a snapshot. :param resource_group_name: The name of the resource group. @@ -310,7 +322,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_04_01.models.Snapshot :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -457,7 +475,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.SnapshotList"]: + ) -> AsyncIterable["_models.SnapshotList"]: """Lists snapshots under a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_04_01.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -526,7 +544,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.SnapshotList"]: + ) -> AsyncIterable["_models.SnapshotList"]: """Lists snapshots under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -534,7 +552,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_04_01.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -593,10 +611,10 @@ async def _grant_access_initial( self, resource_group_name: str, snapshot_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> Optional["models.AccessUri"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + ) -> Optional["_models.AccessUri"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -648,9 +666,9 @@ async def begin_grant_access( self, resource_group_name: str, snapshot_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> AsyncLROPoller["models.AccessUri"]: + ) -> AsyncLROPoller["_models.AccessUri"]: """Grants access to a snapshot. :param resource_group_name: The name of the resource group. @@ -673,7 +691,7 @@ async def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -698,7 +716,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -800,7 +824,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_usage_operations.py index 92f33bd4613a..6fbad8dde605 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsageOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.ListUsagesResult"]: + ) -> AsyncIterable["_models.ListUsagesResult"]: """Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_04_01.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extension_images_operations.py index 1f38e994082b..d39ae83ac780 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VirtualMachineExtensionImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( type: str, version: str, **kwargs - ) -> "models.VirtualMachineExtensionImage": + ) -> "_models.VirtualMachineExtensionImage": """Gets a virtual machine extension image. :param location: The name of a supported Azure region. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineExtensionImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,7 +111,7 @@ async def list_types( location: str, publisher_name: str, **kwargs - ) -> List["models.VirtualMachineExtensionImage"]: + ) -> List["_models.VirtualMachineExtensionImage"]: """Gets a list of virtual machine extension image types. :param location: The name of a supported Azure region. @@ -123,7 +123,7 @@ async def list_types( :rtype: list[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -173,7 +173,7 @@ async def list_versions( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> List["models.VirtualMachineExtensionImage"]: + ) -> List["_models.VirtualMachineExtensionImage"]: """Gets a list of virtual machine extension image versions. :param location: The name of a supported Azure region. @@ -193,7 +193,7 @@ async def list_versions( :rtype: list[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extensions_operations.py index 1a800a50d5f3..21f5e8086565 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VirtualMachineExtensionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineExtension", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineExtension", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineExtension"]: """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -177,10 +184,10 @@ async def _update_initial( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineExtensionUpdate", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -232,9 +239,9 @@ async def begin_update( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineExtensionUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineExtension"]: """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -257,7 +264,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -283,7 +290,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -389,7 +403,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -410,7 +431,7 @@ async def get( vm_extension_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtension": + ) -> "_models.VirtualMachineExtension": """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -426,7 +447,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +497,7 @@ async def list( vm_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtensionsListResult": + ) -> "_models.VirtualMachineExtensionsListResult": """The operation to get all extensions of a Virtual Machine. :param resource_group_name: The name of the resource group. @@ -490,7 +511,7 @@ async def list( :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineExtensionsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_images_operations.py index 120ee6a274bd..7abff1bf5eb3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VirtualMachineImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( skus: str, version: str, **kwargs - ) -> "models.VirtualMachineImage": + ) -> "_models.VirtualMachineImage": """Gets a virtual machine image. :param location: The name of a supported Azure region. @@ -66,7 +66,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,7 +120,7 @@ async def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. @@ -143,7 +143,7 @@ async def list( :rtype: list[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -197,7 +197,7 @@ async def list_offers( location: str, publisher_name: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image offers for the specified location and publisher. :param location: The name of a supported Azure region. @@ -209,7 +209,7 @@ async def list_offers( :rtype: list[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -254,7 +254,7 @@ async def list_publishers( self, location: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image publishers for the specified Azure location. :param location: The name of a supported Azure region. @@ -264,7 +264,7 @@ async def list_publishers( :rtype: list[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -310,7 +310,7 @@ async def list_skus( publisher_name: str, offer: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. :param location: The name of a supported Azure region. @@ -324,7 +324,7 @@ async def list_skus( :rtype: list[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_run_commands_operations.py index 6d7a0ade0bd9..86c5a121a13f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VirtualMachineRunCommandsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.RunCommandListResult"]: + ) -> AsyncIterable["_models.RunCommandListResult"]: """Lists all available run commands for a subscription in a location. :param location: The location upon which run commands is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_04_01.models.RunCommandListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ async def get( location: str, command_id: str, **kwargs - ) -> "models.RunCommandDocument": + ) -> "_models.RunCommandDocument": """Gets specific run command for a subscription in a location. :param location: The location upon which run commands is queried. @@ -128,7 +128,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_04_01.models.RunCommandDocument :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandDocument"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index 06dbedaea5fe..e286715defed 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetExtensionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, vm_scale_set_name: str, vmss_extension_name: str, - extension_parameters: "models.VirtualMachineScaleSetExtension", + extension_parameters: "_models.VirtualMachineScaleSetExtension", **kwargs - ) -> "models.VirtualMachineScaleSetExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + ) -> "_models.VirtualMachineScaleSetExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def begin_create_or_update( resource_group_name: str, vm_scale_set_name: str, vmss_extension_name: str, - extension_parameters: "models.VirtualMachineScaleSetExtension", + extension_parameters: "_models.VirtualMachineScaleSetExtension", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSetExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSetExtension"]: """The operation to create or update an extension. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -265,7 +272,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -286,7 +300,7 @@ async def get( vmss_extension_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineScaleSetExtension": + ) -> "_models.VirtualMachineScaleSetExtension": """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -302,7 +316,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSetExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -351,7 +365,7 @@ def list( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetExtensionListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetExtensionListResult"]: """Gets a list of all extensions in a VM scale set. :param resource_group_name: The name of the resource group. @@ -363,7 +377,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSetExtensionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtensionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 33a62bd00a4a..e44bad6b6d77 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VirtualMachineScaleSetRollingUpgradesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -128,7 +128,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -230,7 +236,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -249,7 +261,7 @@ async def get_latest( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.RollingUpgradeStatusInfo": + ) -> "_models.RollingUpgradeStatusInfo": """Gets the status of the latest virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -261,7 +273,7 @@ async def get_latest( :rtype: ~azure.mgmt.compute.v2018_04_01.models.RollingUpgradeStatusInfo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RollingUpgradeStatusInfo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 37f18e3b550a..70fff4941c3b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetVMsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -135,7 +135,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -242,7 +249,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -350,7 +364,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -369,10 +390,10 @@ async def _update_initial( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.VirtualMachineScaleSetVM", + parameters: "_models.VirtualMachineScaleSetVM", **kwargs - ) -> "models.VirtualMachineScaleSetVM": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + ) -> "_models.VirtualMachineScaleSetVM": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -428,9 +449,9 @@ async def begin_update( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.VirtualMachineScaleSetVM", + parameters: "_models.VirtualMachineScaleSetVM", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSetVM"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSetVM"]: """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. @@ -453,7 +474,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -479,7 +500,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -585,7 +613,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -605,7 +640,7 @@ async def get( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.VirtualMachineScaleSetVM": + ) -> "_models.VirtualMachineScaleSetVM": """Gets a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -619,7 +654,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSetVM :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -667,7 +702,7 @@ async def get_instance_view( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.VirtualMachineScaleSetVMInstanceView": + ) -> "_models.VirtualMachineScaleSetVMInstanceView": """Gets the status of a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -681,7 +716,7 @@ async def get_instance_view( :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSetVMInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -731,7 +766,7 @@ def list( select: Optional[str] = None, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetVMListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetVMListResult"]: """Gets a list of all virtual machines in a VM scale sets. :param resource_group_name: The name of the resource group. @@ -752,7 +787,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSetVMListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -909,7 +944,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1015,7 +1057,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1121,7 +1170,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1228,7 +1284,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1334,7 +1397,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1353,10 +1423,10 @@ async def _run_command_initial( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> Optional["models.RunCommandResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + ) -> Optional["_models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1410,9 +1480,9 @@ async def begin_run_command( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> AsyncLROPoller["models.RunCommandResult"]: + ) -> AsyncLROPoller["_models.RunCommandResult"]: """Run command on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1434,7 +1504,7 @@ async def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1460,7 +1530,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_sets_operations.py index 94250943027e..49ffc413210b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSet", + parameters: "_models.VirtualMachineScaleSet", **kwargs - ) -> "models.VirtualMachineScaleSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + ) -> "_models.VirtualMachineScaleSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSet", + parameters: "_models.VirtualMachineScaleSet", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSet"]: """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -169,10 +175,10 @@ async def _update_initial( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSetUpdate", + parameters: "_models.VirtualMachineScaleSetUpdate", **kwargs - ) -> "models.VirtualMachineScaleSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + ) -> "_models.VirtualMachineScaleSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -222,9 +228,9 @@ async def begin_update( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSetUpdate", + parameters: "_models.VirtualMachineScaleSetUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSet"]: """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -244,7 +250,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -269,7 +275,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -369,7 +381,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -388,7 +406,7 @@ async def get( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> "_models.VirtualMachineScaleSet": """Display information about a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -400,7 +418,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -445,7 +463,7 @@ async def _deallocate_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -496,7 +514,7 @@ async def begin_deallocate( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and @@ -542,7 +560,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -560,7 +584,7 @@ async def _delete_instances_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -608,7 +632,7 @@ async def begin_delete_instances( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs ) -> AsyncLROPoller[None]: """Deletes virtual machines in a VM scale set. @@ -652,7 +676,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -671,7 +701,7 @@ async def get_instance_view( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.VirtualMachineScaleSetInstanceView": + ) -> "_models.VirtualMachineScaleSetInstanceView": """Gets the status of a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -683,7 +713,7 @@ async def get_instance_view( :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSetInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -728,7 +758,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListResult"]: """Gets a list of all VM scale sets under a resource group. :param resource_group_name: The name of the resource group. @@ -738,7 +768,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -797,7 +827,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListWithLinkResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListWithLinkResult"]: """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. @@ -807,7 +837,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSetListWithLinkResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListWithLinkResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -867,7 +897,7 @@ def list_skus( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListSkusResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListSkusResult"]: """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. @@ -880,7 +910,7 @@ def list_skus( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSetListSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -942,7 +972,7 @@ def get_os_upgrade_history( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListOSUpgradeHistory"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListOSUpgradeHistory"]: """Gets list of OS upgrades on a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -954,7 +984,7 @@ def get_os_upgrade_history( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSetListOSUpgradeHistory] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListOSUpgradeHistory"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1015,7 +1045,7 @@ async def _power_off_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1066,7 +1096,7 @@ async def begin_power_off( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still @@ -1112,7 +1142,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1130,7 +1166,7 @@ async def _restart_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1181,7 +1217,7 @@ async def begin_restart( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Restarts one or more virtual machines in a VM scale set. @@ -1225,7 +1261,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1243,7 +1285,7 @@ async def _start_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1294,7 +1336,7 @@ async def begin_start( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Starts one or more virtual machines in a VM scale set. @@ -1338,7 +1380,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1356,7 +1404,7 @@ async def _redeploy_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1407,7 +1455,7 @@ async def begin_redeploy( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, @@ -1452,7 +1500,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1470,7 +1524,7 @@ async def _perform_maintenance_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1521,7 +1575,7 @@ async def begin_perform_maintenance( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances @@ -1568,7 +1622,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1586,7 +1646,7 @@ async def _update_instances_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1634,7 +1694,7 @@ async def begin_update_instances( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs ) -> AsyncLROPoller[None]: """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. @@ -1678,7 +1738,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1696,7 +1762,7 @@ async def _reimage_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1747,7 +1813,7 @@ async def begin_reimage( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set. @@ -1791,7 +1857,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1809,7 +1881,7 @@ async def _reimage_all_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1860,7 +1932,7 @@ async def begin_reimage_all( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This @@ -1905,7 +1977,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1925,7 +2003,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( vm_scale_set_name: str, platform_update_domain: int, **kwargs - ) -> "models.RecoveryWalkResponse": + ) -> "_models.RecoveryWalkResponse": """Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. @@ -1941,7 +2019,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( :rtype: ~azure.mgmt.compute.v2018_04_01.models.RecoveryWalkResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryWalkResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_sizes_operations.py index 96cdb97e69b7..b9cce48c8ec4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_sizes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VirtualMachineSizesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes for a subscription in a location. :param location: The location upon which virtual-machine-sizes is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machines_operations.py index 49596af1595b..08301a83c5d6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machines_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachinesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list_by_location( self, location: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Gets all the virtual machines under the specified subscription for the specified location. :param location: The location for which virtual machines under the subscription are queried. @@ -57,7 +57,7 @@ def list_by_location( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,10 +117,10 @@ async def _capture_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineCaptureParameters", + parameters: "_models.VirtualMachineCaptureParameters", **kwargs - ) -> Optional["models.VirtualMachineCaptureResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + ) -> Optional["_models.VirtualMachineCaptureResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualMachineCaptureResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -172,9 +172,9 @@ async def begin_capture( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineCaptureParameters", + parameters: "_models.VirtualMachineCaptureParameters", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineCaptureResult"]: + ) -> AsyncLROPoller["_models.VirtualMachineCaptureResult"]: """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -195,7 +195,7 @@ async def begin_capture( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -220,7 +220,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -238,10 +244,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachine", + parameters: "_models.VirtualMachine", **kwargs - ) -> "models.VirtualMachine": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + ) -> "_models.VirtualMachine": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,9 +301,9 @@ async def begin_create_or_update( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachine", + parameters: "_models.VirtualMachine", **kwargs - ) -> AsyncLROPoller["models.VirtualMachine"]: + ) -> AsyncLROPoller["_models.VirtualMachine"]: """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -317,7 +323,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +348,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -360,10 +372,10 @@ async def _update_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineUpdate", + parameters: "_models.VirtualMachineUpdate", **kwargs - ) -> "models.VirtualMachine": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + ) -> "_models.VirtualMachine": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -417,9 +429,9 @@ async def begin_update( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineUpdate", + parameters: "_models.VirtualMachineUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachine"]: + ) -> AsyncLROPoller["_models.VirtualMachine"]: """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -439,7 +451,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -464,7 +476,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -564,7 +582,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -584,7 +608,7 @@ async def get( vm_name: str, expand: Optional[str] = "instanceView", **kwargs - ) -> "models.VirtualMachine": + ) -> "_models.VirtualMachine": """Retrieves information about the model view or the instance view of a virtual machine. :param resource_group_name: The name of the resource group. @@ -598,7 +622,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachine :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -646,7 +670,7 @@ async def instance_view( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.VirtualMachineInstanceView": + ) -> "_models.VirtualMachineInstanceView": """Retrieves information about the run-time state of a virtual machine. :param resource_group_name: The name of the resource group. @@ -658,7 +682,7 @@ async def instance_view( :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -786,7 +810,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -887,7 +917,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -958,7 +994,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. @@ -969,7 +1005,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1028,7 +1064,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. @@ -1037,7 +1073,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1097,7 +1133,7 @@ def list_available_sizes( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes to which the specified virtual machine can be resized. @@ -1110,7 +1146,7 @@ def list_available_sizes( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1254,7 +1290,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1354,7 +1396,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1454,7 +1502,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1554,7 +1608,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1654,7 +1714,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1672,10 +1738,10 @@ async def _run_command_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> Optional["models.RunCommandResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + ) -> Optional["_models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1727,9 +1793,9 @@ async def begin_run_command( self, resource_group_name: str, vm_name: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> AsyncLROPoller["models.RunCommandResult"]: + ) -> AsyncLROPoller["_models.RunCommandResult"]: """Run command on the VM. :param resource_group_name: The name of the resource group. @@ -1749,7 +1815,7 @@ async def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1774,7 +1840,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_availability_sets_operations.py index eae7943fee83..4ef10196fc5d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_availability_sets_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailabilitySetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str availability_set_name, # type: str - parameters, # type: "models.AvailabilitySet" + parameters, # type: "_models.AvailabilitySet" **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Create or update an availability set. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~azure.mgmt.compute.v2018_04_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,10 +116,10 @@ def update( self, resource_group_name, # type: str availability_set_name, # type: str - parameters, # type: "models.AvailabilitySetUpdate" + parameters, # type: "_models.AvailabilitySetUpdate" **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Update an availability set. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ def update( :rtype: ~azure.mgmt.compute.v2018_04_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -239,7 +239,7 @@ def get( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Retrieves information about an availability set. :param resource_group_name: The name of the resource group. @@ -251,7 +251,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_04_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -297,7 +297,7 @@ def list_by_subscription( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailabilitySetListResult"] + # type: (...) -> Iterable["_models.AvailabilitySetListResult"] """Lists all availability sets in a subscription. :param expand: The expand expression to apply to the operation. Allowed values are @@ -308,7 +308,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_04_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -370,7 +370,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailabilitySetListResult"] + # type: (...) -> Iterable["_models.AvailabilitySetListResult"] """Lists all availability sets in a resource group. :param resource_group_name: The name of the resource group. @@ -380,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_04_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -442,7 +442,7 @@ def list_available_sizes( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. @@ -455,7 +455,7 @@ def list_available_sizes( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_disks_operations.py index 56977a4bb9f8..6dd290cffc39 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_disks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DisksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.Disk" + disk, # type: "_models.Disk" **kwargs # type: Any ): - # type: (...) -> "models.Disk" - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + # type: (...) -> "_models.Disk" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.Disk" + disk, # type: "_models.Disk" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Disk"] + # type: (...) -> LROPoller["_models.Disk"] """Creates or updates a disk. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -177,11 +183,11 @@ def _update_initial( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.DiskUpdate" + disk, # type: "_models.DiskUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Disk" - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + # type: (...) -> "_models.Disk" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,10 +241,10 @@ def begin_update( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.DiskUpdate" + disk, # type: "_models.DiskUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Disk"] + # type: (...) -> LROPoller["_models.Disk"] """Updates (patches) a disk. :param resource_group_name: The name of the resource group. @@ -260,7 +266,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -285,7 +291,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -305,7 +317,7 @@ def get( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Disk" + # type: (...) -> "_models.Disk" """Gets information about a disk. :param resource_group_name: The name of the resource group. @@ -319,7 +331,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_04_01.models.Disk :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -450,7 +462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -469,7 +487,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskList"] + # type: (...) -> Iterable["_models.DiskList"] """Lists all the disks under a resource group. :param resource_group_name: The name of the resource group. @@ -479,7 +497,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_04_01.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -539,7 +557,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskList"] + # type: (...) -> Iterable["_models.DiskList"] """Lists all the disks under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -547,7 +565,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_04_01.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -606,11 +624,11 @@ def _grant_access_initial( self, resource_group_name, # type: str disk_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> Optional["models.AccessUri"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + # type: (...) -> Optional["_models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -662,10 +680,10 @@ def begin_grant_access( self, resource_group_name, # type: str disk_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AccessUri"] + # type: (...) -> LROPoller["_models.AccessUri"] """Grants access to a disk. :param resource_group_name: The name of the resource group. @@ -688,7 +706,7 @@ def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -713,7 +731,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -817,7 +841,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_images_operations.py index 2fcb274119c0..260f63c82bb2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.Image" + parameters, # type: "_models.Image" **kwargs # type: Any ): - # type: (...) -> "models.Image" - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + # type: (...) -> "_models.Image" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.Image" + parameters, # type: "_models.Image" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Image"] + # type: (...) -> LROPoller["_models.Image"] """Create or update an image. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -175,11 +181,11 @@ def _update_initial( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.ImageUpdate" + parameters, # type: "_models.ImageUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Image" - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + # type: (...) -> "_models.Image" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -233,10 +239,10 @@ def begin_update( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.ImageUpdate" + parameters, # type: "_models.ImageUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Image"] + # type: (...) -> LROPoller["_models.Image"] """Update an image. :param resource_group_name: The name of the resource group. @@ -256,7 +262,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -281,7 +287,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -383,7 +395,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -404,7 +422,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Image" + # type: (...) -> "_models.Image" """Gets an image. :param resource_group_name: The name of the resource group. @@ -418,7 +436,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_04_01.models.Image :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +484,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ImageListResult"] + # type: (...) -> Iterable["_models.ImageListResult"] """Gets the list of images under a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +494,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_04_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -536,7 +554,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ImageListResult"] + # type: (...) -> Iterable["_models.ImageListResult"] """Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. @@ -545,7 +563,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_04_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_log_analytics_operations.py index c946f111fc29..0c30e4972a20 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_log_analytics_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class LogAnalyticsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,11 +49,11 @@ def __init__(self, client, config, serializer, deserializer): def _export_request_rate_by_interval_initial( self, location, # type: str - parameters, # type: "models.RequestRateByIntervalInput" + parameters, # type: "_models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> Optional["models.LogAnalyticsOperationResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + # type: (...) -> Optional["_models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -103,10 +103,10 @@ def _export_request_rate_by_interval_initial( def begin_export_request_rate_by_interval( self, location, # type: str - parameters, # type: "models.RequestRateByIntervalInput" + parameters, # type: "_models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] + # type: (...) -> LROPoller["_models.LogAnalyticsOperationResult"] """Export logs that show Api requests made by this subscription in the given time window to show throttling activities. @@ -125,7 +125,7 @@ def begin_export_request_rate_by_interval( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -149,7 +149,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -166,11 +171,11 @@ def get_long_running_output(pipeline_response): def _export_throttled_requests_initial( self, location, # type: str - parameters, # type: "models.LogAnalyticsInputBase" + parameters, # type: "_models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> Optional["models.LogAnalyticsOperationResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + # type: (...) -> Optional["_models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,10 +225,10 @@ def _export_throttled_requests_initial( def begin_export_throttled_requests( self, location, # type: str - parameters, # type: "models.LogAnalyticsInputBase" + parameters, # type: "_models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] + # type: (...) -> LROPoller["_models.LogAnalyticsOperationResult"] """Export logs that show total throttled Api requests for this subscription in the given time window. @@ -242,7 +247,7 @@ def begin_export_throttled_requests( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -266,7 +271,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_operations.py index f8f4aeab8ce1..26763cb96dc2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ComputeOperationListResult"] + # type: (...) -> Iterable["_models.ComputeOperationListResult"] """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_04_01.models.ComputeOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeOperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_proximity_placement_groups_operations.py index a24378a6ca49..497c3e38a180 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_proximity_placement_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ProximityPlacementGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str proximity_placement_group_name, # type: str - parameters, # type: "models.ProximityPlacementGroup" + parameters, # type: "_models.ProximityPlacementGroup" **kwargs # type: Any ): - # type: (...) -> "models.ProximityPlacementGroup" + # type: (...) -> "_models.ProximityPlacementGroup" """Create or update a proximity placement group. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~azure.mgmt.compute.v2018_04_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,10 +120,10 @@ def update( self, resource_group_name, # type: str proximity_placement_group_name, # type: str - parameters, # type: "models.UpdateResource" + parameters, # type: "_models.UpdateResource" **kwargs # type: Any ): - # type: (...) -> "models.ProximityPlacementGroup" + # type: (...) -> "_models.ProximityPlacementGroup" """Update a proximity placement group. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def update( :rtype: ~azure.mgmt.compute.v2018_04_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -243,7 +243,7 @@ def get( proximity_placement_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ProximityPlacementGroup" + # type: (...) -> "_models.ProximityPlacementGroup" """Retrieves information about a proximity placement group . :param resource_group_name: The name of the resource group. @@ -255,7 +255,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_04_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -300,7 +300,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProximityPlacementGroupListResult"] + # type: (...) -> Iterable["_models.ProximityPlacementGroupListResult"] """Lists all proximity placement groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -308,7 +308,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_04_01.models.ProximityPlacementGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -368,7 +368,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProximityPlacementGroupListResult"] + # type: (...) -> Iterable["_models.ProximityPlacementGroupListResult"] """Lists all proximity placement groups in a resource group. :param resource_group_name: The name of the resource group. @@ -378,7 +378,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_04_01.models.ProximityPlacementGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_snapshots_operations.py index c23e48566fbb..cc3c780f3fb4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_snapshots_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SnapshotsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.Snapshot" + snapshot, # type: "_models.Snapshot" **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + # type: (...) -> "_models.Snapshot" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.Snapshot" + snapshot, # type: "_models.Snapshot" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Snapshot"] + # type: (...) -> LROPoller["_models.Snapshot"] """Creates or updates a snapshot. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -177,11 +183,11 @@ def _update_initial( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.SnapshotUpdate" + snapshot, # type: "_models.SnapshotUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + # type: (...) -> "_models.Snapshot" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,10 +241,10 @@ def begin_update( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.SnapshotUpdate" + snapshot, # type: "_models.SnapshotUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Snapshot"] + # type: (...) -> LROPoller["_models.Snapshot"] """Updates (patches) a snapshot. :param resource_group_name: The name of the resource group. @@ -260,7 +266,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -285,7 +291,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -305,7 +317,7 @@ def get( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" + # type: (...) -> "_models.Snapshot" """Gets information about a snapshot. :param resource_group_name: The name of the resource group. @@ -319,7 +331,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_04_01.models.Snapshot :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -450,7 +462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -469,7 +487,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SnapshotList"] + # type: (...) -> Iterable["_models.SnapshotList"] """Lists snapshots under a resource group. :param resource_group_name: The name of the resource group. @@ -479,7 +497,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_04_01.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -539,7 +557,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.SnapshotList"] + # type: (...) -> Iterable["_models.SnapshotList"] """Lists snapshots under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -547,7 +565,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_04_01.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -606,11 +624,11 @@ def _grant_access_initial( self, resource_group_name, # type: str snapshot_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> Optional["models.AccessUri"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + # type: (...) -> Optional["_models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -662,10 +680,10 @@ def begin_grant_access( self, resource_group_name, # type: str snapshot_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AccessUri"] + # type: (...) -> LROPoller["_models.AccessUri"] """Grants access to a snapshot. :param resource_group_name: The name of the resource group. @@ -688,7 +706,7 @@ def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -713,7 +731,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -817,7 +841,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_usage_operations.py index 5ec8febc3115..1b67da073082 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsageOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListUsagesResult"] + # type: (...) -> Iterable["_models.ListUsagesResult"] """Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_04_01.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extension_images_operations.py index b27018de5e36..f77ab6fd2ace 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extension_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VirtualMachineExtensionImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( version, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtensionImage" + # type: (...) -> "_models.VirtualMachineExtensionImage" """Gets a virtual machine extension image. :param location: The name of a supported Azure region. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineExtensionImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def list_types( publisher_name, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineExtensionImage"] + # type: (...) -> List["_models.VirtualMachineExtensionImage"] """Gets a list of virtual machine extension image types. :param location: The name of a supported Azure region. @@ -129,7 +129,7 @@ def list_types( :rtype: list[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -180,7 +180,7 @@ def list_versions( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineExtensionImage"] + # type: (...) -> List["_models.VirtualMachineExtensionImage"] """Gets a list of virtual machine extension image versions. :param location: The name of a supported Azure region. @@ -200,7 +200,7 @@ def list_versions( :rtype: list[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extensions_operations.py index 90dd93e2b322..433ccb33586c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VirtualMachineExtensionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineExtension"] """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -183,11 +190,11 @@ def _update_initial( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -239,10 +246,10 @@ def begin_update( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineExtension"] """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -265,7 +272,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -291,7 +298,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -399,7 +413,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -421,7 +442,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" + # type: (...) -> "_models.VirtualMachineExtension" """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -437,7 +458,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,7 +509,7 @@ def list( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtensionsListResult" + # type: (...) -> "_models.VirtualMachineExtensionsListResult" """The operation to get all extensions of a Virtual Machine. :param resource_group_name: The name of the resource group. @@ -502,7 +523,7 @@ def list( :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineExtensionsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_images_operations.py index 9664f71b8022..3755c2dbe129 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VirtualMachineImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( version, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineImage" + # type: (...) -> "_models.VirtualMachineImage" """Gets a virtual machine image. :param location: The name of a supported Azure region. @@ -71,7 +71,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -126,7 +126,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. @@ -149,7 +149,7 @@ def list( :rtype: list[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -204,7 +204,7 @@ def list_offers( publisher_name, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image offers for the specified location and publisher. :param location: The name of a supported Azure region. @@ -216,7 +216,7 @@ def list_offers( :rtype: list[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,7 +262,7 @@ def list_publishers( location, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image publishers for the specified Azure location. :param location: The name of a supported Azure region. @@ -272,7 +272,7 @@ def list_publishers( :rtype: list[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -319,7 +319,7 @@ def list_skus( offer, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. :param location: The name of a supported Azure region. @@ -333,7 +333,7 @@ def list_skus( :rtype: list[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_run_commands_operations.py index 6f49682ee01c..d8e657facc16 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_run_commands_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VirtualMachineRunCommandsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RunCommandListResult"] + # type: (...) -> Iterable["_models.RunCommandListResult"] """Lists all available run commands for a subscription in a location. :param location: The location upon which run commands is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_04_01.models.RunCommandListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def get( command_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RunCommandDocument" + # type: (...) -> "_models.RunCommandDocument" """Gets specific run command for a subscription in a location. :param location: The location upon which run commands is queried. @@ -134,7 +134,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_04_01.models.RunCommandDocument :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandDocument"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_extensions_operations.py index 55624024ea2a..3cc0a26ece5d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetExtensionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str vm_scale_set_name, # type: str vmss_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineScaleSetExtension" + extension_parameters, # type: "_models.VirtualMachineScaleSetExtension" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + # type: (...) -> "_models.VirtualMachineScaleSetExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def begin_create_or_update( resource_group_name, # type: str vm_scale_set_name, # type: str vmss_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineScaleSetExtension" + extension_parameters, # type: "_models.VirtualMachineScaleSetExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSetExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSetExtension"] """The operation to create or update an extension. :param resource_group_name: The name of the resource group. @@ -139,7 +139,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -165,7 +165,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -273,7 +280,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -295,7 +309,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetExtension" + # type: (...) -> "_models.VirtualMachineScaleSetExtension" """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -311,7 +325,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSetExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -361,7 +375,7 @@ def list( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetExtensionListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetExtensionListResult"] """Gets a list of all extensions in a VM scale set. :param resource_group_name: The name of the resource group. @@ -373,7 +387,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSetExtensionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtensionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 2b8670ef6463..a336d9b69910 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VirtualMachineScaleSetRollingUpgradesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -134,7 +134,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -238,7 +244,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -258,7 +270,7 @@ def get_latest( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RollingUpgradeStatusInfo" + # type: (...) -> "_models.RollingUpgradeStatusInfo" """Gets the status of the latest virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -270,7 +282,7 @@ def get_latest( :rtype: ~azure.mgmt.compute.v2018_04_01.models.RollingUpgradeStatusInfo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RollingUpgradeStatusInfo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_vms_operations.py index 44f86e484688..1731c2dcb534 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetVMsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -141,7 +141,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -250,7 +257,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -360,7 +374,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -379,11 +400,11 @@ def _update_initial( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.VirtualMachineScaleSetVM" + parameters, # type: "_models.VirtualMachineScaleSetVM" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVM" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + # type: (...) -> "_models.VirtualMachineScaleSetVM" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -439,10 +460,10 @@ def begin_update( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.VirtualMachineScaleSetVM" + parameters, # type: "_models.VirtualMachineScaleSetVM" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSetVM"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSetVM"] """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. @@ -465,7 +486,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -491,7 +512,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -599,7 +627,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -620,7 +655,7 @@ def get( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVM" + # type: (...) -> "_models.VirtualMachineScaleSetVM" """Gets a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -634,7 +669,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSetVM :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -683,7 +718,7 @@ def get_instance_view( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVMInstanceView" + # type: (...) -> "_models.VirtualMachineScaleSetVMInstanceView" """Gets the status of a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -697,7 +732,7 @@ def get_instance_view( :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSetVMInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -748,7 +783,7 @@ def list( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetVMListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetVMListResult"] """Gets a list of all virtual machines in a VM scale sets. :param resource_group_name: The name of the resource group. @@ -769,7 +804,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSetVMListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -928,7 +963,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1036,7 +1078,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1144,7 +1193,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1253,7 +1309,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1361,7 +1424,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1380,11 +1450,11 @@ def _run_command_initial( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> Optional["models.RunCommandResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + # type: (...) -> Optional["_models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1438,10 +1508,10 @@ def begin_run_command( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RunCommandResult"] + # type: (...) -> LROPoller["_models.RunCommandResult"] """Run command on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1463,7 +1533,7 @@ def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1489,7 +1559,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_sets_operations.py index 269f76379f9e..dfb5a7541488 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSet" + parameters, # type: "_models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + # type: (...) -> "_models.VirtualMachineScaleSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSet" + parameters, # type: "_models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSet"] """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -175,11 +181,11 @@ def _update_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSetUpdate" + parameters, # type: "_models.VirtualMachineScaleSetUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + # type: (...) -> "_models.VirtualMachineScaleSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -229,10 +235,10 @@ def begin_update( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSetUpdate" + parameters, # type: "_models.VirtualMachineScaleSetUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSet"] """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -379,7 +391,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -399,7 +417,7 @@ def get( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" + # type: (...) -> "_models.VirtualMachineScaleSet" """Display information about a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -411,7 +429,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -456,7 +474,7 @@ def _deallocate_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -508,7 +526,7 @@ def begin_deallocate( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -555,7 +573,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -573,7 +597,7 @@ def _delete_instances_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): # type: (...) -> None @@ -622,7 +646,7 @@ def begin_delete_instances( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -667,7 +691,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -687,7 +717,7 @@ def get_instance_view( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetInstanceView" + # type: (...) -> "_models.VirtualMachineScaleSetInstanceView" """Gets the status of a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -699,7 +729,7 @@ def get_instance_view( :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSetInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -745,7 +775,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListResult"] """Gets a list of all VM scale sets under a resource group. :param resource_group_name: The name of the resource group. @@ -755,7 +785,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -815,7 +845,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListWithLinkResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListWithLinkResult"] """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. @@ -825,7 +855,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSetListWithLinkResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListWithLinkResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -886,7 +916,7 @@ def list_skus( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListSkusResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListSkusResult"] """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. @@ -899,7 +929,7 @@ def list_skus( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSetListSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -962,7 +992,7 @@ def get_os_upgrade_history( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListOSUpgradeHistory"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListOSUpgradeHistory"] """Gets list of OS upgrades on a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -974,7 +1004,7 @@ def get_os_upgrade_history( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineScaleSetListOSUpgradeHistory] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListOSUpgradeHistory"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1035,7 +1065,7 @@ def _power_off_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1087,7 +1117,7 @@ def begin_power_off( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1134,7 +1164,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1152,7 +1188,7 @@ def _restart_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1204,7 +1240,7 @@ def begin_restart( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1249,7 +1285,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1267,7 +1309,7 @@ def _start_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1319,7 +1361,7 @@ def begin_start( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1364,7 +1406,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1382,7 +1430,7 @@ def _redeploy_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1434,7 +1482,7 @@ def begin_redeploy( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1480,7 +1528,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1498,7 +1552,7 @@ def _perform_maintenance_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1550,7 +1604,7 @@ def begin_perform_maintenance( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1598,7 +1652,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1616,7 +1676,7 @@ def _update_instances_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): # type: (...) -> None @@ -1665,7 +1725,7 @@ def begin_update_instances( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1710,7 +1770,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1728,7 +1794,7 @@ def _reimage_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1780,7 +1846,7 @@ def begin_reimage( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1825,7 +1891,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1843,7 +1915,7 @@ def _reimage_all_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1895,7 +1967,7 @@ def begin_reimage_all( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1941,7 +2013,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1962,7 +2040,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( platform_update_domain, # type: int **kwargs # type: Any ): - # type: (...) -> "models.RecoveryWalkResponse" + # type: (...) -> "_models.RecoveryWalkResponse" """Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. @@ -1978,7 +2056,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( :rtype: ~azure.mgmt.compute.v2018_04_01.models.RecoveryWalkResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryWalkResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_sizes_operations.py index 7afb07599303..5f8ab2ed45f6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_sizes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VirtualMachineSizesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes for a subscription in a location. :param location: The location upon which virtual-machine-sizes is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machines_operations.py index f6311307902d..4047e2beb0f4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machines_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachinesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list_by_location( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Gets all the virtual machines under the specified subscription for the specified location. :param location: The location for which virtual machines under the subscription are queried. @@ -62,7 +62,7 @@ def list_by_location( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,11 +122,11 @@ def _capture_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineCaptureParameters" + parameters, # type: "_models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualMachineCaptureResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + # type: (...) -> Optional["_models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualMachineCaptureResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -178,10 +178,10 @@ def begin_capture( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineCaptureParameters" + parameters, # type: "_models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineCaptureResult"] + # type: (...) -> LROPoller["_models.VirtualMachineCaptureResult"] """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -202,7 +202,7 @@ def begin_capture( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -227,7 +227,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -245,11 +251,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachine" + parameters, # type: "_models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + # type: (...) -> "_models.VirtualMachine" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,10 +309,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachine" + parameters, # type: "_models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachine"] + # type: (...) -> LROPoller["_models.VirtualMachine"] """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -326,7 +332,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +357,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -369,11 +381,11 @@ def _update_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineUpdate" + parameters, # type: "_models.VirtualMachineUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + # type: (...) -> "_models.VirtualMachine" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -427,10 +439,10 @@ def begin_update( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineUpdate" + parameters, # type: "_models.VirtualMachineUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachine"] + # type: (...) -> LROPoller["_models.VirtualMachine"] """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -450,7 +462,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -475,7 +487,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -577,7 +595,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -598,7 +622,7 @@ def get( expand="instanceView", # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" + # type: (...) -> "_models.VirtualMachine" """Retrieves information about the model view or the instance view of a virtual machine. :param resource_group_name: The name of the resource group. @@ -612,7 +636,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachine :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -661,7 +685,7 @@ def instance_view( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineInstanceView" + # type: (...) -> "_models.VirtualMachineInstanceView" """Retrieves information about the run-time state of a virtual machine. :param resource_group_name: The name of the resource group. @@ -673,7 +697,7 @@ def instance_view( :rtype: ~azure.mgmt.compute.v2018_04_01.models.VirtualMachineInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -803,7 +827,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -906,7 +936,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -979,7 +1015,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. @@ -990,7 +1026,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1050,7 +1086,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. @@ -1059,7 +1095,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1120,7 +1156,7 @@ def list_available_sizes( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes to which the specified virtual machine can be resized. @@ -1133,7 +1169,7 @@ def list_available_sizes( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_04_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1279,7 +1315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1381,7 +1423,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1483,7 +1531,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1585,7 +1639,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1687,7 +1747,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1705,11 +1771,11 @@ def _run_command_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> Optional["models.RunCommandResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + # type: (...) -> Optional["_models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1761,10 +1827,10 @@ def begin_run_command( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RunCommandResult"] + # type: (...) -> LROPoller["_models.RunCommandResult"] """Run command on the VM. :param resource_group_name: The name of the resource group. @@ -1784,7 +1850,7 @@ def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1809,7 +1875,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_compute_management_client.py index b4d1044819de..c5ea10d2c456 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_compute_management_client.py @@ -110,7 +110,6 @@ def __init__( 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( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_metadata.json index a641efba8a8d..87dcb6cf550e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/_compute_management_client.py index 030b7ef0107e..db8c7aee77a9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/_compute_management_client.py @@ -107,7 +107,6 @@ def __init__( 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( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_availability_sets_operations.py index 55744ec3528a..78d03dea71d6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_availability_sets_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailabilitySetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, availability_set_name: str, - parameters: "models.AvailabilitySet", + parameters: "_models.AvailabilitySet", **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Create or update an availability set. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~azure.mgmt.compute.v2018_06_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,9 +111,9 @@ async def update( self, resource_group_name: str, availability_set_name: str, - parameters: "models.AvailabilitySetUpdate", + parameters: "_models.AvailabilitySetUpdate", **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Update an availability set. :param resource_group_name: The name of the resource group. @@ -127,7 +127,7 @@ async def update( :rtype: ~azure.mgmt.compute.v2018_06_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +231,7 @@ async def get( resource_group_name: str, availability_set_name: str, **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Retrieves information about an availability set. :param resource_group_name: The name of the resource group. @@ -243,7 +243,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,7 +288,7 @@ def list_by_subscription( self, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.AvailabilitySetListResult"]: + ) -> AsyncIterable["_models.AvailabilitySetListResult"]: """Lists all availability sets in a subscription. :param expand: The expand expression to apply to the operation. Allowed values are @@ -299,7 +299,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -360,7 +360,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailabilitySetListResult"]: + ) -> AsyncIterable["_models.AvailabilitySetListResult"]: """Lists all availability sets in a resource group. :param resource_group_name: The name of the resource group. @@ -370,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -431,7 +431,7 @@ def list_available_sizes( resource_group_name: str, availability_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. @@ -444,7 +444,7 @@ def list_available_sizes( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_disks_operations.py index b2814cadadcd..778a6406b0dc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_disks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DisksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, disk_name: str, - disk: "models.Disk", + disk: "_models.Disk", **kwargs - ) -> "models.Disk": - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + ) -> "_models.Disk": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, disk_name: str, - disk: "models.Disk", + disk: "_models.Disk", **kwargs - ) -> AsyncLROPoller["models.Disk"]: + ) -> AsyncLROPoller["_models.Disk"]: """Creates or updates a disk. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -171,10 +177,10 @@ async def _update_initial( self, resource_group_name: str, disk_name: str, - disk: "models.DiskUpdate", + disk: "_models.DiskUpdate", **kwargs - ) -> "models.Disk": - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + ) -> "_models.Disk": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,9 +234,9 @@ async def begin_update( self, resource_group_name: str, disk_name: str, - disk: "models.DiskUpdate", + disk: "_models.DiskUpdate", **kwargs - ) -> AsyncLROPoller["models.Disk"]: + ) -> AsyncLROPoller["_models.Disk"]: """Updates (patches) a disk. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -296,7 +308,7 @@ async def get( resource_group_name: str, disk_name: str, **kwargs - ) -> "models.Disk": + ) -> "_models.Disk": """Gets information about a disk. :param resource_group_name: The name of the resource group. @@ -310,7 +322,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.Disk :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -457,7 +475,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DiskList"]: + ) -> AsyncIterable["_models.DiskList"]: """Lists all the disks under a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -526,7 +544,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.DiskList"]: + ) -> AsyncIterable["_models.DiskList"]: """Lists all the disks under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -534,7 +552,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -593,10 +611,10 @@ async def _grant_access_initial( self, resource_group_name: str, disk_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> Optional["models.AccessUri"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + ) -> Optional["_models.AccessUri"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -648,9 +666,9 @@ async def begin_grant_access( self, resource_group_name: str, disk_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> AsyncLROPoller["models.AccessUri"]: + ) -> AsyncLROPoller["_models.AccessUri"]: """Grants access to a disk. :param resource_group_name: The name of the resource group. @@ -673,7 +691,7 @@ async def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -698,7 +716,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -800,7 +824,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_galleries_operations.py index ab2cf83008c2..61ce8e7d69c9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_galleries_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class GalleriesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gallery_name: str, - gallery: "models.Gallery", + gallery: "_models.Gallery", **kwargs - ) -> "models.Gallery": - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + ) -> "_models.Gallery": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def begin_create_or_update( self, resource_group_name: str, gallery_name: str, - gallery: "models.Gallery", + gallery: "_models.Gallery", **kwargs - ) -> AsyncLROPoller["models.Gallery"]: + ) -> AsyncLROPoller["_models.Gallery"]: """Create or update a Shared Image Gallery. :param resource_group_name: The name of the resource group. @@ -130,7 +130,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -155,7 +155,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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: @@ -174,7 +180,7 @@ async def get( resource_group_name: str, gallery_name: str, **kwargs - ) -> "models.Gallery": + ) -> "_models.Gallery": """Retrieves information about a Shared Image Gallery. :param resource_group_name: The name of the resource group. @@ -186,7 +192,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.Gallery :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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: @@ -333,7 +345,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.GalleryList"]: + ) -> AsyncIterable["_models.GalleryList"]: """List galleries under a resource group. :param resource_group_name: The name of the resource group. @@ -343,7 +355,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.GalleryList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -402,7 +414,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.GalleryList"]: + ) -> AsyncIterable["_models.GalleryList"]: """List galleries under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -410,7 +422,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.GalleryList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_image_versions_operations.py index 07ce0c83964d..7c88b5714c06 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_image_versions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class GalleryImageVersionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,10 +49,10 @@ async def _create_or_update_initial( gallery_name: str, gallery_image_name: str, gallery_image_version_name: str, - gallery_image_version: "models.GalleryImageVersion", + gallery_image_version: "_models.GalleryImageVersion", **kwargs - ) -> "models.GalleryImageVersion": - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + ) -> "_models.GalleryImageVersion": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,9 +113,9 @@ async def begin_create_or_update( gallery_name: str, gallery_image_name: str, gallery_image_version_name: str, - gallery_image_version: "models.GalleryImageVersion", + gallery_image_version: "_models.GalleryImageVersion", **kwargs - ) -> AsyncLROPoller["models.GalleryImageVersion"]: + ) -> AsyncLROPoller["_models.GalleryImageVersion"]: """Create or update a gallery Image Version. :param resource_group_name: The name of the resource group. @@ -145,7 +145,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -172,7 +172,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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: @@ -192,9 +200,9 @@ async def get( gallery_name: str, gallery_image_name: str, gallery_image_version_name: str, - expand: Optional[Union[str, "models.ReplicationStatusTypes"]] = None, + expand: Optional[Union[str, "_models.ReplicationStatusTypes"]] = None, **kwargs - ) -> "models.GalleryImageVersion": + ) -> "_models.GalleryImageVersion": """Retrieves information about a gallery Image Version. :param resource_group_name: The name of the resource group. @@ -214,7 +222,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.GalleryImageVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -361,7 +369,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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: @@ -381,7 +397,7 @@ def list_by_gallery_image( gallery_name: str, gallery_image_name: str, **kwargs - ) -> AsyncIterable["models.GalleryImageVersionList"]: + ) -> AsyncIterable["_models.GalleryImageVersionList"]: """List gallery Image Versions in a gallery Image Definition. :param resource_group_name: The name of the resource group. @@ -397,7 +413,7 @@ def list_by_gallery_image( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.GalleryImageVersionList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_images_operations.py index 2c370a08b5a3..9abd5b10fef0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class GalleryImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, gallery_name: str, gallery_image_name: str, - gallery_image: "models.GalleryImage", + gallery_image: "_models.GalleryImage", **kwargs - ) -> "models.GalleryImage": - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + ) -> "_models.GalleryImage": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,9 +110,9 @@ async def begin_create_or_update( resource_group_name: str, gallery_name: str, gallery_image_name: str, - gallery_image: "models.GalleryImage", + gallery_image: "_models.GalleryImage", **kwargs - ) -> AsyncLROPoller["models.GalleryImage"]: + ) -> AsyncLROPoller["_models.GalleryImage"]: """Create or update a gallery Image Definition. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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: @@ -183,7 +190,7 @@ async def get( gallery_name: str, gallery_image_name: str, **kwargs - ) -> "models.GalleryImage": + ) -> "_models.GalleryImage": """Retrieves information about a gallery Image Definition. :param resource_group_name: The name of the resource group. @@ -198,7 +205,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.GalleryImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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: @@ -354,7 +368,7 @@ def list_by_gallery( resource_group_name: str, gallery_name: str, **kwargs - ) -> AsyncIterable["models.GalleryImageList"]: + ) -> AsyncIterable["_models.GalleryImageList"]: """List gallery Image Definitions in a gallery. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list_by_gallery( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.GalleryImageList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_images_operations.py index 653719fec5fb..7232ea83cb4c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, image_name: str, - parameters: "models.Image", + parameters: "_models.Image", **kwargs - ) -> "models.Image": - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + ) -> "_models.Image": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, image_name: str, - parameters: "models.Image", + parameters: "_models.Image", **kwargs - ) -> AsyncLROPoller["models.Image"]: + ) -> AsyncLROPoller["_models.Image"]: """Create or update an image. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -169,10 +175,10 @@ async def _update_initial( self, resource_group_name: str, image_name: str, - parameters: "models.ImageUpdate", + parameters: "_models.ImageUpdate", **kwargs - ) -> "models.Image": - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + ) -> "_models.Image": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -226,9 +232,9 @@ async def begin_update( self, resource_group_name: str, image_name: str, - parameters: "models.ImageUpdate", + parameters: "_models.ImageUpdate", **kwargs - ) -> AsyncLROPoller["models.Image"]: + ) -> AsyncLROPoller["_models.Image"]: """Update an image. :param resource_group_name: The name of the resource group. @@ -248,7 +254,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -273,7 +279,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -373,7 +385,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -393,7 +411,7 @@ async def get( image_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Image": + ) -> "_models.Image": """Gets an image. :param resource_group_name: The name of the resource group. @@ -407,7 +425,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.Image :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -454,7 +472,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ImageListResult"]: + ) -> AsyncIterable["_models.ImageListResult"]: """Gets the list of images under a resource group. :param resource_group_name: The name of the resource group. @@ -464,7 +482,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ImageListResult"]: + ) -> AsyncIterable["_models.ImageListResult"]: """Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. @@ -532,7 +550,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_log_analytics_operations.py index b9bf1ddb52f1..fc994ca8f48f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_log_analytics_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class LogAnalyticsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,10 +45,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def _export_request_rate_by_interval_initial( self, location: str, - parameters: "models.RequestRateByIntervalInput", + parameters: "_models.RequestRateByIntervalInput", **kwargs - ) -> Optional["models.LogAnalyticsOperationResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + ) -> Optional["_models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -98,9 +98,9 @@ async def _export_request_rate_by_interval_initial( async def begin_export_request_rate_by_interval( self, location: str, - parameters: "models.RequestRateByIntervalInput", + parameters: "_models.RequestRateByIntervalInput", **kwargs - ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: + ) -> AsyncLROPoller["_models.LogAnalyticsOperationResult"]: """Export logs that show Api requests made by this subscription in the given time window to show throttling activities. @@ -119,7 +119,7 @@ async def begin_export_request_rate_by_interval( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -143,7 +143,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -160,10 +165,10 @@ def get_long_running_output(pipeline_response): async def _export_throttled_requests_initial( self, location: str, - parameters: "models.LogAnalyticsInputBase", + parameters: "_models.LogAnalyticsInputBase", **kwargs - ) -> Optional["models.LogAnalyticsOperationResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + ) -> Optional["_models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -213,9 +218,9 @@ async def _export_throttled_requests_initial( async def begin_export_throttled_requests( self, location: str, - parameters: "models.LogAnalyticsInputBase", + parameters: "_models.LogAnalyticsInputBase", **kwargs - ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: + ) -> AsyncLROPoller["_models.LogAnalyticsOperationResult"]: """Export logs that show total throttled Api requests for this subscription in the given time window. @@ -234,7 +239,7 @@ async def begin_export_throttled_requests( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -258,7 +263,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_operations.py index 03a13039d6c3..279070387501 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ComputeOperationListResult"]: + ) -> AsyncIterable["_models.ComputeOperationListResult"]: """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.ComputeOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeOperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_proximity_placement_groups_operations.py index 441e365ba37a..2a8b777091c9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_proximity_placement_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ProximityPlacementGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, proximity_placement_group_name: str, - parameters: "models.ProximityPlacementGroup", + parameters: "_models.ProximityPlacementGroup", **kwargs - ) -> "models.ProximityPlacementGroup": + ) -> "_models.ProximityPlacementGroup": """Create or update a proximity placement group. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~azure.mgmt.compute.v2018_06_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,9 +115,9 @@ async def update( self, resource_group_name: str, proximity_placement_group_name: str, - parameters: "models.UpdateResource", + parameters: "_models.UpdateResource", **kwargs - ) -> "models.ProximityPlacementGroup": + ) -> "_models.ProximityPlacementGroup": """Update a proximity placement group. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def update( :rtype: ~azure.mgmt.compute.v2018_06_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,7 +235,7 @@ async def get( resource_group_name: str, proximity_placement_group_name: str, **kwargs - ) -> "models.ProximityPlacementGroup": + ) -> "_models.ProximityPlacementGroup": """Retrieves information about a proximity placement group . :param resource_group_name: The name of the resource group. @@ -247,7 +247,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -291,7 +291,7 @@ async def get( def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.ProximityPlacementGroupListResult"]: + ) -> AsyncIterable["_models.ProximityPlacementGroupListResult"]: """Lists all proximity placement groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -299,7 +299,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.ProximityPlacementGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -358,7 +358,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ProximityPlacementGroupListResult"]: + ) -> AsyncIterable["_models.ProximityPlacementGroupListResult"]: """Lists all proximity placement groups in a resource group. :param resource_group_name: The name of the resource group. @@ -368,7 +368,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.ProximityPlacementGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_snapshots_operations.py index 7aaa7c5dece6..d19e528787e8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_snapshots_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SnapshotsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.Snapshot", + snapshot: "_models.Snapshot", **kwargs - ) -> "models.Snapshot": - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + ) -> "_models.Snapshot": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.Snapshot", + snapshot: "_models.Snapshot", **kwargs - ) -> AsyncLROPoller["models.Snapshot"]: + ) -> AsyncLROPoller["_models.Snapshot"]: """Creates or updates a snapshot. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -171,10 +177,10 @@ async def _update_initial( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.SnapshotUpdate", + snapshot: "_models.SnapshotUpdate", **kwargs - ) -> "models.Snapshot": - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + ) -> "_models.Snapshot": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,9 +234,9 @@ async def begin_update( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.SnapshotUpdate", + snapshot: "_models.SnapshotUpdate", **kwargs - ) -> AsyncLROPoller["models.Snapshot"]: + ) -> AsyncLROPoller["_models.Snapshot"]: """Updates (patches) a snapshot. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -296,7 +308,7 @@ async def get( resource_group_name: str, snapshot_name: str, **kwargs - ) -> "models.Snapshot": + ) -> "_models.Snapshot": """Gets information about a snapshot. :param resource_group_name: The name of the resource group. @@ -310,7 +322,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.Snapshot :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -457,7 +475,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.SnapshotList"]: + ) -> AsyncIterable["_models.SnapshotList"]: """Lists snapshots under a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -526,7 +544,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.SnapshotList"]: + ) -> AsyncIterable["_models.SnapshotList"]: """Lists snapshots under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -534,7 +552,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -593,10 +611,10 @@ async def _grant_access_initial( self, resource_group_name: str, snapshot_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> Optional["models.AccessUri"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + ) -> Optional["_models.AccessUri"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -648,9 +666,9 @@ async def begin_grant_access( self, resource_group_name: str, snapshot_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> AsyncLROPoller["models.AccessUri"]: + ) -> AsyncLROPoller["_models.AccessUri"]: """Grants access to a snapshot. :param resource_group_name: The name of the resource group. @@ -673,7 +691,7 @@ async def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -698,7 +716,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -800,7 +824,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_usage_operations.py index e67fa93c39e8..fd1f4887a1ac 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsageOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.ListUsagesResult"]: + ) -> AsyncIterable["_models.ListUsagesResult"]: """Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extension_images_operations.py index 1051b94f2b5c..fe156c4acbc0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VirtualMachineExtensionImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( type: str, version: str, **kwargs - ) -> "models.VirtualMachineExtensionImage": + ) -> "_models.VirtualMachineExtensionImage": """Gets a virtual machine extension image. :param location: The name of a supported Azure region. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineExtensionImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,7 +111,7 @@ async def list_types( location: str, publisher_name: str, **kwargs - ) -> List["models.VirtualMachineExtensionImage"]: + ) -> List["_models.VirtualMachineExtensionImage"]: """Gets a list of virtual machine extension image types. :param location: The name of a supported Azure region. @@ -123,7 +123,7 @@ async def list_types( :rtype: list[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -173,7 +173,7 @@ async def list_versions( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> List["models.VirtualMachineExtensionImage"]: + ) -> List["_models.VirtualMachineExtensionImage"]: """Gets a list of virtual machine extension image versions. :param location: The name of a supported Azure region. @@ -193,7 +193,7 @@ async def list_versions( :rtype: list[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extensions_operations.py index ff954e27742f..6a29a3c46599 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VirtualMachineExtensionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineExtension", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineExtension", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineExtension"]: """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -177,10 +184,10 @@ async def _update_initial( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineExtensionUpdate", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -232,9 +239,9 @@ async def begin_update( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineExtensionUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineExtension"]: """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -257,7 +264,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -283,7 +290,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -389,7 +403,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -410,7 +431,7 @@ async def get( vm_extension_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtension": + ) -> "_models.VirtualMachineExtension": """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -426,7 +447,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +497,7 @@ async def list( vm_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtensionsListResult": + ) -> "_models.VirtualMachineExtensionsListResult": """The operation to get all extensions of a Virtual Machine. :param resource_group_name: The name of the resource group. @@ -490,7 +511,7 @@ async def list( :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineExtensionsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_images_operations.py index 43681c79a032..91a84772d0c7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VirtualMachineImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( skus: str, version: str, **kwargs - ) -> "models.VirtualMachineImage": + ) -> "_models.VirtualMachineImage": """Gets a virtual machine image. :param location: The name of a supported Azure region. @@ -66,7 +66,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,7 +120,7 @@ async def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. @@ -143,7 +143,7 @@ async def list( :rtype: list[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -197,7 +197,7 @@ async def list_offers( location: str, publisher_name: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image offers for the specified location and publisher. :param location: The name of a supported Azure region. @@ -209,7 +209,7 @@ async def list_offers( :rtype: list[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -254,7 +254,7 @@ async def list_publishers( self, location: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image publishers for the specified Azure location. :param location: The name of a supported Azure region. @@ -264,7 +264,7 @@ async def list_publishers( :rtype: list[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -310,7 +310,7 @@ async def list_skus( publisher_name: str, offer: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. :param location: The name of a supported Azure region. @@ -324,7 +324,7 @@ async def list_skus( :rtype: list[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_run_commands_operations.py index ae68dd96f544..4193b00ed5df 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VirtualMachineRunCommandsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.RunCommandListResult"]: + ) -> AsyncIterable["_models.RunCommandListResult"]: """Lists all available run commands for a subscription in a location. :param location: The location upon which run commands is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.RunCommandListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ async def get( location: str, command_id: str, **kwargs - ) -> "models.RunCommandDocument": + ) -> "_models.RunCommandDocument": """Gets specific run command for a subscription in a location. :param location: The location upon which run commands is queried. @@ -128,7 +128,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.RunCommandDocument :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandDocument"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index d108286c3f22..c183d51c17e9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetExtensionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, vm_scale_set_name: str, vmss_extension_name: str, - extension_parameters: "models.VirtualMachineScaleSetExtension", + extension_parameters: "_models.VirtualMachineScaleSetExtension", **kwargs - ) -> "models.VirtualMachineScaleSetExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + ) -> "_models.VirtualMachineScaleSetExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def begin_create_or_update( resource_group_name: str, vm_scale_set_name: str, vmss_extension_name: str, - extension_parameters: "models.VirtualMachineScaleSetExtension", + extension_parameters: "_models.VirtualMachineScaleSetExtension", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSetExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSetExtension"]: """The operation to create or update an extension. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -265,7 +272,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -286,7 +300,7 @@ async def get( vmss_extension_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineScaleSetExtension": + ) -> "_models.VirtualMachineScaleSetExtension": """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -302,7 +316,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSetExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -351,7 +365,7 @@ def list( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetExtensionListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetExtensionListResult"]: """Gets a list of all extensions in a VM scale set. :param resource_group_name: The name of the resource group. @@ -363,7 +377,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSetExtensionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtensionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 62a38c8f81a1..38a8f788f8cf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VirtualMachineScaleSetRollingUpgradesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -128,7 +128,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -230,7 +236,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -332,7 +344,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -351,7 +369,7 @@ async def get_latest( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.RollingUpgradeStatusInfo": + ) -> "_models.RollingUpgradeStatusInfo": """Gets the status of the latest virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -363,7 +381,7 @@ async def get_latest( :rtype: ~azure.mgmt.compute.v2018_06_01.models.RollingUpgradeStatusInfo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RollingUpgradeStatusInfo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 4abeefb7f12b..1a24f9eb8e84 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetVMsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def _reimage_initial( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - vm_scale_set_vm_reimage_input: Optional["models.VirtualMachineReimageParameters"] = None, + vm_scale_set_vm_reimage_input: Optional["_models.VirtualMachineReimageParameters"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -101,7 +101,7 @@ async def begin_reimage( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - vm_scale_set_vm_reimage_input: Optional["models.VirtualMachineReimageParameters"] = None, + vm_scale_set_vm_reimage_input: Optional["_models.VirtualMachineReimageParameters"] = None, **kwargs ) -> AsyncLROPoller[None]: """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. @@ -148,7 +148,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -255,7 +262,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -363,7 +377,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -382,10 +403,10 @@ async def _update_initial( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.VirtualMachineScaleSetVM", + parameters: "_models.VirtualMachineScaleSetVM", **kwargs - ) -> "models.VirtualMachineScaleSetVM": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + ) -> "_models.VirtualMachineScaleSetVM": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -441,9 +462,9 @@ async def begin_update( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.VirtualMachineScaleSetVM", + parameters: "_models.VirtualMachineScaleSetVM", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSetVM"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSetVM"]: """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. @@ -466,7 +487,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -492,7 +513,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -598,7 +626,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -618,7 +653,7 @@ async def get( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.VirtualMachineScaleSetVM": + ) -> "_models.VirtualMachineScaleSetVM": """Gets a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -632,7 +667,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSetVM :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -680,7 +715,7 @@ async def get_instance_view( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.VirtualMachineScaleSetVMInstanceView": + ) -> "_models.VirtualMachineScaleSetVMInstanceView": """Gets the status of a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -694,7 +729,7 @@ async def get_instance_view( :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSetVMInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -744,7 +779,7 @@ def list( select: Optional[str] = None, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetVMListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetVMListResult"]: """Gets a list of all virtual machines in a VM scale sets. :param resource_group_name: The name of the resource group. @@ -765,7 +800,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSetVMListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -922,7 +957,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1028,7 +1070,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1134,7 +1183,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1241,7 +1297,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1347,7 +1410,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1366,10 +1436,10 @@ async def _run_command_initial( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> Optional["models.RunCommandResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + ) -> Optional["_models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1423,9 +1493,9 @@ async def begin_run_command( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> AsyncLROPoller["models.RunCommandResult"]: + ) -> AsyncLROPoller["_models.RunCommandResult"]: """Run command on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1447,7 +1517,7 @@ async def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1473,7 +1543,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_sets_operations.py index 6aa857640138..65a29cd46390 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSet", + parameters: "_models.VirtualMachineScaleSet", **kwargs - ) -> "models.VirtualMachineScaleSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + ) -> "_models.VirtualMachineScaleSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSet", + parameters: "_models.VirtualMachineScaleSet", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSet"]: """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -169,10 +175,10 @@ async def _update_initial( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSetUpdate", + parameters: "_models.VirtualMachineScaleSetUpdate", **kwargs - ) -> "models.VirtualMachineScaleSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + ) -> "_models.VirtualMachineScaleSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -222,9 +228,9 @@ async def begin_update( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSetUpdate", + parameters: "_models.VirtualMachineScaleSetUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSet"]: """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -244,7 +250,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -269,7 +275,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -369,7 +381,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -388,7 +406,7 @@ async def get( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> "_models.VirtualMachineScaleSet": """Display information about a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -400,7 +418,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -445,7 +463,7 @@ async def _deallocate_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -496,7 +514,7 @@ async def begin_deallocate( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and @@ -542,7 +560,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -560,7 +584,7 @@ async def _delete_instances_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -608,7 +632,7 @@ async def begin_delete_instances( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs ) -> AsyncLROPoller[None]: """Deletes virtual machines in a VM scale set. @@ -652,7 +676,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -671,7 +701,7 @@ async def get_instance_view( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.VirtualMachineScaleSetInstanceView": + ) -> "_models.VirtualMachineScaleSetInstanceView": """Gets the status of a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -683,7 +713,7 @@ async def get_instance_view( :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSetInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -728,7 +758,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListResult"]: """Gets a list of all VM scale sets under a resource group. :param resource_group_name: The name of the resource group. @@ -738,7 +768,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -797,7 +827,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListWithLinkResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListWithLinkResult"]: """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. @@ -807,7 +837,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSetListWithLinkResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListWithLinkResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -867,7 +897,7 @@ def list_skus( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListSkusResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListSkusResult"]: """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. @@ -880,7 +910,7 @@ def list_skus( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSetListSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -942,7 +972,7 @@ def get_os_upgrade_history( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListOSUpgradeHistory"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListOSUpgradeHistory"]: """Gets list of OS upgrades on a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -954,7 +984,7 @@ def get_os_upgrade_history( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSetListOSUpgradeHistory] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListOSUpgradeHistory"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1015,7 +1045,7 @@ async def _power_off_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1066,7 +1096,7 @@ async def begin_power_off( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still @@ -1112,7 +1142,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1130,7 +1166,7 @@ async def _restart_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1181,7 +1217,7 @@ async def begin_restart( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Restarts one or more virtual machines in a VM scale set. @@ -1225,7 +1261,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1243,7 +1285,7 @@ async def _start_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1294,7 +1336,7 @@ async def begin_start( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Starts one or more virtual machines in a VM scale set. @@ -1338,7 +1380,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1356,7 +1404,7 @@ async def _redeploy_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1407,7 +1455,7 @@ async def begin_redeploy( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, @@ -1452,7 +1500,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1470,7 +1524,7 @@ async def _perform_maintenance_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1521,7 +1575,7 @@ async def begin_perform_maintenance( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances @@ -1568,7 +1622,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1586,7 +1646,7 @@ async def _update_instances_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1634,7 +1694,7 @@ async def begin_update_instances( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs ) -> AsyncLROPoller[None]: """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. @@ -1678,7 +1738,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1696,7 +1762,7 @@ async def _reimage_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_scale_set_reimage_input: Optional["models.VirtualMachineScaleSetReimageParameters"] = None, + vm_scale_set_reimage_input: Optional["_models.VirtualMachineScaleSetReimageParameters"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1747,7 +1813,7 @@ async def begin_reimage( self, resource_group_name: str, vm_scale_set_name: str, - vm_scale_set_reimage_input: Optional["models.VirtualMachineScaleSetReimageParameters"] = None, + vm_scale_set_reimage_input: Optional["_models.VirtualMachineScaleSetReimageParameters"] = None, **kwargs ) -> AsyncLROPoller[None]: """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which @@ -1793,7 +1859,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1811,7 +1883,7 @@ async def _reimage_all_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1862,7 +1934,7 @@ async def begin_reimage_all( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This @@ -1907,7 +1979,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1927,7 +2005,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( vm_scale_set_name: str, platform_update_domain: int, **kwargs - ) -> "models.RecoveryWalkResponse": + ) -> "_models.RecoveryWalkResponse": """Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. @@ -1943,7 +2021,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( :rtype: ~azure.mgmt.compute.v2018_06_01.models.RecoveryWalkResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryWalkResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_sizes_operations.py index 1f59de878e93..68a993e8eaed 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_sizes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VirtualMachineSizesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """This API is deprecated. Use `Resources Skus `_. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machines_operations.py index 64f52f13e1ac..6955c2023873 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machines_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachinesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list_by_location( self, location: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Gets all the virtual machines under the specified subscription for the specified location. :param location: The location for which virtual machines under the subscription are queried. @@ -57,7 +57,7 @@ def list_by_location( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,10 +117,10 @@ async def _capture_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineCaptureParameters", + parameters: "_models.VirtualMachineCaptureParameters", **kwargs - ) -> Optional["models.VirtualMachineCaptureResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + ) -> Optional["_models.VirtualMachineCaptureResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualMachineCaptureResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -172,9 +172,9 @@ async def begin_capture( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineCaptureParameters", + parameters: "_models.VirtualMachineCaptureParameters", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineCaptureResult"]: + ) -> AsyncLROPoller["_models.VirtualMachineCaptureResult"]: """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -195,7 +195,7 @@ async def begin_capture( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -220,7 +220,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -238,10 +244,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachine", + parameters: "_models.VirtualMachine", **kwargs - ) -> "models.VirtualMachine": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + ) -> "_models.VirtualMachine": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,9 +301,9 @@ async def begin_create_or_update( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachine", + parameters: "_models.VirtualMachine", **kwargs - ) -> AsyncLROPoller["models.VirtualMachine"]: + ) -> AsyncLROPoller["_models.VirtualMachine"]: """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -317,7 +323,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +348,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -360,10 +372,10 @@ async def _update_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineUpdate", + parameters: "_models.VirtualMachineUpdate", **kwargs - ) -> "models.VirtualMachine": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + ) -> "_models.VirtualMachine": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -417,9 +429,9 @@ async def begin_update( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineUpdate", + parameters: "_models.VirtualMachineUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachine"]: + ) -> AsyncLROPoller["_models.VirtualMachine"]: """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -439,7 +451,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -464,7 +476,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -564,7 +582,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -584,7 +608,7 @@ async def get( vm_name: str, expand: Optional[str] = "instanceView", **kwargs - ) -> "models.VirtualMachine": + ) -> "_models.VirtualMachine": """Retrieves information about the model view or the instance view of a virtual machine. :param resource_group_name: The name of the resource group. @@ -598,7 +622,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachine :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -646,7 +670,7 @@ async def instance_view( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.VirtualMachineInstanceView": + ) -> "_models.VirtualMachineInstanceView": """Retrieves information about the run-time state of a virtual machine. :param resource_group_name: The name of the resource group. @@ -658,7 +682,7 @@ async def instance_view( :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -786,7 +810,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -887,7 +917,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -958,7 +994,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. @@ -969,7 +1005,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1028,7 +1064,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. @@ -1037,7 +1073,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1097,7 +1133,7 @@ def list_available_sizes( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes to which the specified virtual machine can be resized. @@ -1110,7 +1146,7 @@ def list_available_sizes( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1254,7 +1290,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1354,7 +1396,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1454,7 +1502,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1554,7 +1608,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1572,7 +1632,7 @@ async def _reimage_initial( self, resource_group_name: str, vm_name: str, - parameters: Optional["models.VirtualMachineReimageParameters"] = None, + parameters: Optional["_models.VirtualMachineReimageParameters"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1623,7 +1683,7 @@ async def begin_reimage( self, resource_group_name: str, vm_name: str, - parameters: Optional["models.VirtualMachineReimageParameters"] = None, + parameters: Optional["_models.VirtualMachineReimageParameters"] = None, **kwargs ) -> AsyncLROPoller[None]: """Reimages the virtual machine which has an ephemeral OS disk back to its initial state. @@ -1667,7 +1727,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1767,7 +1833,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1785,10 +1857,10 @@ async def _run_command_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> Optional["models.RunCommandResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + ) -> Optional["_models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1840,9 +1912,9 @@ async def begin_run_command( self, resource_group_name: str, vm_name: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> AsyncLROPoller["models.RunCommandResult"]: + ) -> AsyncLROPoller["_models.RunCommandResult"]: """Run command on the VM. :param resource_group_name: The name of the resource group. @@ -1862,7 +1934,7 @@ async def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1887,7 +1959,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/__init__.py index 95ecd5b869e5..afc8b980202f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/__init__.py @@ -19,8 +19,6 @@ from ._models_py3 import AvailabilitySetUpdate from ._models_py3 import BootDiagnostics from ._models_py3 import BootDiagnosticsInstanceView - from ._models_py3 import Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties - from ._models_py3 import ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties from ._models_py3 import ComputeOperationListResult from ._models_py3 import ComputeOperationValue from ._models_py3 import CreationData @@ -125,6 +123,7 @@ from ._models_py3 import UpgradePolicy from ._models_py3 import Usage from ._models_py3 import UsageName + from ._models_py3 import UserAssignedIdentitiesValue from ._models_py3 import VaultCertificate from ._models_py3 import VaultSecretGroup from ._models_py3 import VirtualHardDisk @@ -152,6 +151,7 @@ from ._models_py3 import VirtualMachineScaleSetExtensionProfile from ._models_py3 import VirtualMachineScaleSetIPConfiguration from ._models_py3 import VirtualMachineScaleSetIdentity + from ._models_py3 import VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue from ._models_py3 import VirtualMachineScaleSetInstanceView from ._models_py3 import VirtualMachineScaleSetInstanceViewStatusesSummary from ._models_py3 import VirtualMachineScaleSetIpTag @@ -208,8 +208,6 @@ from ._models import AvailabilitySetUpdate # type: ignore from ._models import BootDiagnostics # type: ignore from ._models import BootDiagnosticsInstanceView # type: ignore - from ._models import Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore - from ._models import ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore from ._models import ComputeOperationListResult # type: ignore from ._models import ComputeOperationValue # type: ignore from ._models import CreationData # type: ignore @@ -314,6 +312,7 @@ from ._models import UpgradePolicy # type: ignore from ._models import Usage # type: ignore from ._models import UsageName # type: ignore + from ._models import UserAssignedIdentitiesValue # type: ignore from ._models import VaultCertificate # type: ignore from ._models import VaultSecretGroup # type: ignore from ._models import VirtualHardDisk # type: ignore @@ -341,6 +340,7 @@ from ._models import VirtualMachineScaleSetExtensionProfile # type: ignore from ._models import VirtualMachineScaleSetIPConfiguration # type: ignore from ._models import VirtualMachineScaleSetIdentity # type: ignore + from ._models import VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue # type: ignore from ._models import VirtualMachineScaleSetInstanceView # type: ignore from ._models import VirtualMachineScaleSetInstanceViewStatusesSummary # type: ignore from ._models import VirtualMachineScaleSetIpTag # type: ignore @@ -436,8 +436,6 @@ 'AvailabilitySetUpdate', 'BootDiagnostics', 'BootDiagnosticsInstanceView', - 'Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties', - 'ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties', 'ComputeOperationListResult', 'ComputeOperationValue', 'CreationData', @@ -542,6 +540,7 @@ 'UpgradePolicy', 'Usage', 'UsageName', + 'UserAssignedIdentitiesValue', 'VaultCertificate', 'VaultSecretGroup', 'VirtualHardDisk', @@ -569,6 +568,7 @@ 'VirtualMachineScaleSetExtensionProfile', 'VirtualMachineScaleSetIPConfiguration', 'VirtualMachineScaleSetIdentity', + 'VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue', 'VirtualMachineScaleSetInstanceView', 'VirtualMachineScaleSetInstanceViewStatusesSummary', 'VirtualMachineScaleSetIpTag', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/_models.py index 829c0f4aaaee..b734d5847773 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/_models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/_models.py @@ -479,66 +479,6 @@ def __init__( self.status = None -class Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - class ComputeOperationListResult(msrest.serialization.Model): """The List Compute Operation operation response. @@ -4389,6 +4329,36 @@ def __init__( self.localized_value = kwargs.get('localized_value', None) +class UserAssignedIdentitiesValue(msrest.serialization.Model): + """UserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class VaultCertificate(msrest.serialization.Model): """Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM. @@ -5033,7 +5003,7 @@ class VirtualMachineIdentity(msrest.serialization.Model): Machine. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :type user_assigned_identities: dict[str, - ~azure.mgmt.compute.v2018_06_01.models.Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties] + ~azure.mgmt.compute.v2018_06_01.models.UserAssignedIdentitiesValue] """ _validation = { @@ -5045,7 +5015,7 @@ class VirtualMachineIdentity(msrest.serialization.Model): 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentitiesValue}'}, } def __init__( @@ -5573,7 +5543,7 @@ class VirtualMachineScaleSetIdentity(msrest.serialization.Model): form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :type user_assigned_identities: dict[str, - ~azure.mgmt.compute.v2018_06_01.models.ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties] + ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue] """ _validation = { @@ -5585,7 +5555,7 @@ class VirtualMachineScaleSetIdentity(msrest.serialization.Model): 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue}'}, } def __init__( @@ -5599,6 +5569,36 @@ def __init__( self.user_assigned_identities = kwargs.get('user_assigned_identities', None) +class VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue(msrest.serialization.Model): + """VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class VirtualMachineScaleSetInstanceView(msrest.serialization.Model): """The instance view of a virtual machine scale set. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/_models_py3.py index 4c0cdcb2d3e9..bf978938e0cd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/_models_py3.py @@ -529,66 +529,6 @@ def __init__( self.status = None -class Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - class ComputeOperationListResult(msrest.serialization.Model): """The List Compute Operation operation response. @@ -4800,6 +4740,36 @@ def __init__( self.localized_value = localized_value +class UserAssignedIdentitiesValue(msrest.serialization.Model): + """UserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class VaultCertificate(msrest.serialization.Model): """Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM. @@ -5517,7 +5487,7 @@ class VirtualMachineIdentity(msrest.serialization.Model): Machine. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :type user_assigned_identities: dict[str, - ~azure.mgmt.compute.v2018_06_01.models.Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties] + ~azure.mgmt.compute.v2018_06_01.models.UserAssignedIdentitiesValue] """ _validation = { @@ -5529,14 +5499,14 @@ class VirtualMachineIdentity(msrest.serialization.Model): 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentitiesValue}'}, } def __init__( self, *, type: Optional[Union[str, "ResourceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, "Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + user_assigned_identities: Optional[Dict[str, "UserAssignedIdentitiesValue"]] = None, **kwargs ): super(VirtualMachineIdentity, self).__init__(**kwargs) @@ -6128,7 +6098,7 @@ class VirtualMachineScaleSetIdentity(msrest.serialization.Model): form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :type user_assigned_identities: dict[str, - ~azure.mgmt.compute.v2018_06_01.models.ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties] + ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue] """ _validation = { @@ -6140,14 +6110,14 @@ class VirtualMachineScaleSetIdentity(msrest.serialization.Model): 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue}'}, } def __init__( self, *, type: Optional[Union[str, "ResourceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, "ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + user_assigned_identities: Optional[Dict[str, "VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue"]] = None, **kwargs ): super(VirtualMachineScaleSetIdentity, self).__init__(**kwargs) @@ -6157,6 +6127,36 @@ def __init__( self.user_assigned_identities = user_assigned_identities +class VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue(msrest.serialization.Model): + """VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class VirtualMachineScaleSetInstanceView(msrest.serialization.Model): """The instance view of a virtual machine scale set. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_availability_sets_operations.py index 21f921de79ff..b4f0af88de6e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_availability_sets_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailabilitySetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str availability_set_name, # type: str - parameters, # type: "models.AvailabilitySet" + parameters, # type: "_models.AvailabilitySet" **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Create or update an availability set. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~azure.mgmt.compute.v2018_06_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,10 +116,10 @@ def update( self, resource_group_name, # type: str availability_set_name, # type: str - parameters, # type: "models.AvailabilitySetUpdate" + parameters, # type: "_models.AvailabilitySetUpdate" **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Update an availability set. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ def update( :rtype: ~azure.mgmt.compute.v2018_06_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -239,7 +239,7 @@ def get( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Retrieves information about an availability set. :param resource_group_name: The name of the resource group. @@ -251,7 +251,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -297,7 +297,7 @@ def list_by_subscription( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailabilitySetListResult"] + # type: (...) -> Iterable["_models.AvailabilitySetListResult"] """Lists all availability sets in a subscription. :param expand: The expand expression to apply to the operation. Allowed values are @@ -308,7 +308,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -370,7 +370,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailabilitySetListResult"] + # type: (...) -> Iterable["_models.AvailabilitySetListResult"] """Lists all availability sets in a resource group. :param resource_group_name: The name of the resource group. @@ -380,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -442,7 +442,7 @@ def list_available_sizes( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. @@ -455,7 +455,7 @@ def list_available_sizes( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_disks_operations.py index 4bba7562aa28..75699410763d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_disks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DisksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.Disk" + disk, # type: "_models.Disk" **kwargs # type: Any ): - # type: (...) -> "models.Disk" - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + # type: (...) -> "_models.Disk" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.Disk" + disk, # type: "_models.Disk" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Disk"] + # type: (...) -> LROPoller["_models.Disk"] """Creates or updates a disk. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -177,11 +183,11 @@ def _update_initial( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.DiskUpdate" + disk, # type: "_models.DiskUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Disk" - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + # type: (...) -> "_models.Disk" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,10 +241,10 @@ def begin_update( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.DiskUpdate" + disk, # type: "_models.DiskUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Disk"] + # type: (...) -> LROPoller["_models.Disk"] """Updates (patches) a disk. :param resource_group_name: The name of the resource group. @@ -260,7 +266,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -285,7 +291,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -305,7 +317,7 @@ def get( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Disk" + # type: (...) -> "_models.Disk" """Gets information about a disk. :param resource_group_name: The name of the resource group. @@ -319,7 +331,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.Disk :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -450,7 +462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -469,7 +487,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskList"] + # type: (...) -> Iterable["_models.DiskList"] """Lists all the disks under a resource group. :param resource_group_name: The name of the resource group. @@ -479,7 +497,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -539,7 +557,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskList"] + # type: (...) -> Iterable["_models.DiskList"] """Lists all the disks under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -547,7 +565,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -606,11 +624,11 @@ def _grant_access_initial( self, resource_group_name, # type: str disk_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> Optional["models.AccessUri"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + # type: (...) -> Optional["_models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -662,10 +680,10 @@ def begin_grant_access( self, resource_group_name, # type: str disk_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AccessUri"] + # type: (...) -> LROPoller["_models.AccessUri"] """Grants access to a disk. :param resource_group_name: The name of the resource group. @@ -688,7 +706,7 @@ def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -713,7 +731,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -817,7 +841,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_galleries_operations.py index 120e3554f413..827ad6a7a533 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_galleries_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class GalleriesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gallery_name, # type: str - gallery, # type: "models.Gallery" + gallery, # type: "_models.Gallery" **kwargs # type: Any ): - # type: (...) -> "models.Gallery" - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + # type: (...) -> "_models.Gallery" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gallery_name, # type: str - gallery, # type: "models.Gallery" + gallery, # type: "_models.Gallery" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Gallery"] + # type: (...) -> LROPoller["_models.Gallery"] """Create or update a Shared Image Gallery. :param resource_group_name: The name of the resource group. @@ -136,7 +136,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -161,7 +161,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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: @@ -181,7 +187,7 @@ def get( gallery_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Gallery" + # type: (...) -> "_models.Gallery" """Retrieves information about a Shared Image Gallery. :param resource_group_name: The name of the resource group. @@ -193,7 +199,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.Gallery :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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: @@ -343,7 +355,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.GalleryList"] + # type: (...) -> Iterable["_models.GalleryList"] """List galleries under a resource group. :param resource_group_name: The name of the resource group. @@ -353,7 +365,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.GalleryList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,7 +425,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.GalleryList"] + # type: (...) -> Iterable["_models.GalleryList"] """List galleries under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -421,7 +433,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.GalleryList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_image_versions_operations.py index f235045ac12f..08d18f5aa661 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_image_versions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class GalleryImageVersionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,11 +53,11 @@ def _create_or_update_initial( gallery_name, # type: str gallery_image_name, # type: str gallery_image_version_name, # type: str - gallery_image_version, # type: "models.GalleryImageVersion" + gallery_image_version, # type: "_models.GalleryImageVersion" **kwargs # type: Any ): - # type: (...) -> "models.GalleryImageVersion" - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + # type: (...) -> "_models.GalleryImageVersion" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,10 +118,10 @@ def begin_create_or_update( gallery_name, # type: str gallery_image_name, # type: str gallery_image_version_name, # type: str - gallery_image_version, # type: "models.GalleryImageVersion" + gallery_image_version, # type: "_models.GalleryImageVersion" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GalleryImageVersion"] + # type: (...) -> LROPoller["_models.GalleryImageVersion"] """Create or update a gallery Image Version. :param resource_group_name: The name of the resource group. @@ -151,7 +151,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -178,7 +178,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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: @@ -198,10 +206,10 @@ def get( gallery_name, # type: str gallery_image_name, # type: str gallery_image_version_name, # type: str - expand=None, # type: Optional[Union[str, "models.ReplicationStatusTypes"]] + expand=None, # type: Optional[Union[str, "_models.ReplicationStatusTypes"]] **kwargs # type: Any ): - # type: (...) -> "models.GalleryImageVersion" + # type: (...) -> "_models.GalleryImageVersion" """Retrieves information about a gallery Image Version. :param resource_group_name: The name of the resource group. @@ -221,7 +229,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.GalleryImageVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -370,7 +378,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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: @@ -391,7 +407,7 @@ def list_by_gallery_image( gallery_image_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.GalleryImageVersionList"] + # type: (...) -> Iterable["_models.GalleryImageVersionList"] """List gallery Image Versions in a gallery Image Definition. :param resource_group_name: The name of the resource group. @@ -407,7 +423,7 @@ def list_by_gallery_image( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.GalleryImageVersionList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_images_operations.py index 2ac6299f0d00..79c634102c09 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class GalleryImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str gallery_name, # type: str gallery_image_name, # type: str - gallery_image, # type: "models.GalleryImage" + gallery_image, # type: "_models.GalleryImage" **kwargs # type: Any ): - # type: (...) -> "models.GalleryImage" - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + # type: (...) -> "_models.GalleryImage" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,10 +115,10 @@ def begin_create_or_update( resource_group_name, # type: str gallery_name, # type: str gallery_image_name, # type: str - gallery_image, # type: "models.GalleryImage" + gallery_image, # type: "_models.GalleryImage" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GalleryImage"] + # type: (...) -> LROPoller["_models.GalleryImage"] """Create or update a gallery Image Definition. :param resource_group_name: The name of the resource group. @@ -143,7 +143,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -169,7 +169,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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: @@ -190,7 +197,7 @@ def get( gallery_image_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GalleryImage" + # type: (...) -> "_models.GalleryImage" """Retrieves information about a gallery Image Definition. :param resource_group_name: The name of the resource group. @@ -205,7 +212,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.GalleryImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -344,7 +351,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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: @@ -364,7 +378,7 @@ def list_by_gallery( gallery_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.GalleryImageList"] + # type: (...) -> Iterable["_models.GalleryImageList"] """List gallery Image Definitions in a gallery. :param resource_group_name: The name of the resource group. @@ -377,7 +391,7 @@ def list_by_gallery( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.GalleryImageList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_images_operations.py index 32ed41d3ef4b..25a040cf0c08 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.Image" + parameters, # type: "_models.Image" **kwargs # type: Any ): - # type: (...) -> "models.Image" - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + # type: (...) -> "_models.Image" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.Image" + parameters, # type: "_models.Image" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Image"] + # type: (...) -> LROPoller["_models.Image"] """Create or update an image. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -175,11 +181,11 @@ def _update_initial( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.ImageUpdate" + parameters, # type: "_models.ImageUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Image" - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + # type: (...) -> "_models.Image" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -233,10 +239,10 @@ def begin_update( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.ImageUpdate" + parameters, # type: "_models.ImageUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Image"] + # type: (...) -> LROPoller["_models.Image"] """Update an image. :param resource_group_name: The name of the resource group. @@ -256,7 +262,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -281,7 +287,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -383,7 +395,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -404,7 +422,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Image" + # type: (...) -> "_models.Image" """Gets an image. :param resource_group_name: The name of the resource group. @@ -418,7 +436,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.Image :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +484,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ImageListResult"] + # type: (...) -> Iterable["_models.ImageListResult"] """Gets the list of images under a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +494,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -536,7 +554,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ImageListResult"] + # type: (...) -> Iterable["_models.ImageListResult"] """Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. @@ -545,7 +563,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_log_analytics_operations.py index e2a607b062f2..40183d929fa9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_log_analytics_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class LogAnalyticsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,11 +49,11 @@ def __init__(self, client, config, serializer, deserializer): def _export_request_rate_by_interval_initial( self, location, # type: str - parameters, # type: "models.RequestRateByIntervalInput" + parameters, # type: "_models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> Optional["models.LogAnalyticsOperationResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + # type: (...) -> Optional["_models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -103,10 +103,10 @@ def _export_request_rate_by_interval_initial( def begin_export_request_rate_by_interval( self, location, # type: str - parameters, # type: "models.RequestRateByIntervalInput" + parameters, # type: "_models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] + # type: (...) -> LROPoller["_models.LogAnalyticsOperationResult"] """Export logs that show Api requests made by this subscription in the given time window to show throttling activities. @@ -125,7 +125,7 @@ def begin_export_request_rate_by_interval( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -149,7 +149,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -166,11 +171,11 @@ def get_long_running_output(pipeline_response): def _export_throttled_requests_initial( self, location, # type: str - parameters, # type: "models.LogAnalyticsInputBase" + parameters, # type: "_models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> Optional["models.LogAnalyticsOperationResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + # type: (...) -> Optional["_models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,10 +225,10 @@ def _export_throttled_requests_initial( def begin_export_throttled_requests( self, location, # type: str - parameters, # type: "models.LogAnalyticsInputBase" + parameters, # type: "_models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] + # type: (...) -> LROPoller["_models.LogAnalyticsOperationResult"] """Export logs that show total throttled Api requests for this subscription in the given time window. @@ -242,7 +247,7 @@ def begin_export_throttled_requests( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -266,7 +271,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_operations.py index 6a2801b31f2b..cc9b72c601bb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ComputeOperationListResult"] + # type: (...) -> Iterable["_models.ComputeOperationListResult"] """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.ComputeOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeOperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_proximity_placement_groups_operations.py index 0fe788f27d6d..4566c34f4e1e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_proximity_placement_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ProximityPlacementGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str proximity_placement_group_name, # type: str - parameters, # type: "models.ProximityPlacementGroup" + parameters, # type: "_models.ProximityPlacementGroup" **kwargs # type: Any ): - # type: (...) -> "models.ProximityPlacementGroup" + # type: (...) -> "_models.ProximityPlacementGroup" """Create or update a proximity placement group. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~azure.mgmt.compute.v2018_06_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,10 +120,10 @@ def update( self, resource_group_name, # type: str proximity_placement_group_name, # type: str - parameters, # type: "models.UpdateResource" + parameters, # type: "_models.UpdateResource" **kwargs # type: Any ): - # type: (...) -> "models.ProximityPlacementGroup" + # type: (...) -> "_models.ProximityPlacementGroup" """Update a proximity placement group. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def update( :rtype: ~azure.mgmt.compute.v2018_06_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -243,7 +243,7 @@ def get( proximity_placement_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ProximityPlacementGroup" + # type: (...) -> "_models.ProximityPlacementGroup" """Retrieves information about a proximity placement group . :param resource_group_name: The name of the resource group. @@ -255,7 +255,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -300,7 +300,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProximityPlacementGroupListResult"] + # type: (...) -> Iterable["_models.ProximityPlacementGroupListResult"] """Lists all proximity placement groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -308,7 +308,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.ProximityPlacementGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -368,7 +368,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProximityPlacementGroupListResult"] + # type: (...) -> Iterable["_models.ProximityPlacementGroupListResult"] """Lists all proximity placement groups in a resource group. :param resource_group_name: The name of the resource group. @@ -378,7 +378,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.ProximityPlacementGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_snapshots_operations.py index 9cf24d7f51df..469fdb442a7d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_snapshots_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SnapshotsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.Snapshot" + snapshot, # type: "_models.Snapshot" **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + # type: (...) -> "_models.Snapshot" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.Snapshot" + snapshot, # type: "_models.Snapshot" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Snapshot"] + # type: (...) -> LROPoller["_models.Snapshot"] """Creates or updates a snapshot. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -177,11 +183,11 @@ def _update_initial( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.SnapshotUpdate" + snapshot, # type: "_models.SnapshotUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + # type: (...) -> "_models.Snapshot" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,10 +241,10 @@ def begin_update( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.SnapshotUpdate" + snapshot, # type: "_models.SnapshotUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Snapshot"] + # type: (...) -> LROPoller["_models.Snapshot"] """Updates (patches) a snapshot. :param resource_group_name: The name of the resource group. @@ -260,7 +266,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -285,7 +291,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -305,7 +317,7 @@ def get( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" + # type: (...) -> "_models.Snapshot" """Gets information about a snapshot. :param resource_group_name: The name of the resource group. @@ -319,7 +331,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.Snapshot :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -450,7 +462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -469,7 +487,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SnapshotList"] + # type: (...) -> Iterable["_models.SnapshotList"] """Lists snapshots under a resource group. :param resource_group_name: The name of the resource group. @@ -479,7 +497,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -539,7 +557,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.SnapshotList"] + # type: (...) -> Iterable["_models.SnapshotList"] """Lists snapshots under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -547,7 +565,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -606,11 +624,11 @@ def _grant_access_initial( self, resource_group_name, # type: str snapshot_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> Optional["models.AccessUri"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + # type: (...) -> Optional["_models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -662,10 +680,10 @@ def begin_grant_access( self, resource_group_name, # type: str snapshot_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AccessUri"] + # type: (...) -> LROPoller["_models.AccessUri"] """Grants access to a snapshot. :param resource_group_name: The name of the resource group. @@ -688,7 +706,7 @@ def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -713,7 +731,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -817,7 +841,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_usage_operations.py index 1a0d934a23a7..fdb06bc3c18b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsageOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListUsagesResult"] + # type: (...) -> Iterable["_models.ListUsagesResult"] """Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extension_images_operations.py index b3d8b8c8029e..b1614fed1c19 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extension_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VirtualMachineExtensionImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( version, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtensionImage" + # type: (...) -> "_models.VirtualMachineExtensionImage" """Gets a virtual machine extension image. :param location: The name of a supported Azure region. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineExtensionImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def list_types( publisher_name, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineExtensionImage"] + # type: (...) -> List["_models.VirtualMachineExtensionImage"] """Gets a list of virtual machine extension image types. :param location: The name of a supported Azure region. @@ -129,7 +129,7 @@ def list_types( :rtype: list[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -180,7 +180,7 @@ def list_versions( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineExtensionImage"] + # type: (...) -> List["_models.VirtualMachineExtensionImage"] """Gets a list of virtual machine extension image versions. :param location: The name of a supported Azure region. @@ -200,7 +200,7 @@ def list_versions( :rtype: list[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extensions_operations.py index 983b8c0d3271..81c312ccf4e7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VirtualMachineExtensionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineExtension"] """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -183,11 +190,11 @@ def _update_initial( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -239,10 +246,10 @@ def begin_update( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineExtension"] """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -265,7 +272,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -291,7 +298,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -399,7 +413,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -421,7 +442,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" + # type: (...) -> "_models.VirtualMachineExtension" """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -437,7 +458,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,7 +509,7 @@ def list( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtensionsListResult" + # type: (...) -> "_models.VirtualMachineExtensionsListResult" """The operation to get all extensions of a Virtual Machine. :param resource_group_name: The name of the resource group. @@ -502,7 +523,7 @@ def list( :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineExtensionsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_images_operations.py index 32f6e72db23a..63ed334d7203 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VirtualMachineImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( version, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineImage" + # type: (...) -> "_models.VirtualMachineImage" """Gets a virtual machine image. :param location: The name of a supported Azure region. @@ -71,7 +71,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -126,7 +126,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. @@ -149,7 +149,7 @@ def list( :rtype: list[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -204,7 +204,7 @@ def list_offers( publisher_name, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image offers for the specified location and publisher. :param location: The name of a supported Azure region. @@ -216,7 +216,7 @@ def list_offers( :rtype: list[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,7 +262,7 @@ def list_publishers( location, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image publishers for the specified Azure location. :param location: The name of a supported Azure region. @@ -272,7 +272,7 @@ def list_publishers( :rtype: list[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -319,7 +319,7 @@ def list_skus( offer, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. :param location: The name of a supported Azure region. @@ -333,7 +333,7 @@ def list_skus( :rtype: list[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_run_commands_operations.py index 7a731e0a646e..64ca3bd24a65 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_run_commands_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VirtualMachineRunCommandsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RunCommandListResult"] + # type: (...) -> Iterable["_models.RunCommandListResult"] """Lists all available run commands for a subscription in a location. :param location: The location upon which run commands is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.RunCommandListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def get( command_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RunCommandDocument" + # type: (...) -> "_models.RunCommandDocument" """Gets specific run command for a subscription in a location. :param location: The location upon which run commands is queried. @@ -134,7 +134,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.RunCommandDocument :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandDocument"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_extensions_operations.py index a46a768e2a36..fe33226dbdaf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetExtensionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str vm_scale_set_name, # type: str vmss_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineScaleSetExtension" + extension_parameters, # type: "_models.VirtualMachineScaleSetExtension" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + # type: (...) -> "_models.VirtualMachineScaleSetExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def begin_create_or_update( resource_group_name, # type: str vm_scale_set_name, # type: str vmss_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineScaleSetExtension" + extension_parameters, # type: "_models.VirtualMachineScaleSetExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSetExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSetExtension"] """The operation to create or update an extension. :param resource_group_name: The name of the resource group. @@ -139,7 +139,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -165,7 +165,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -273,7 +280,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -295,7 +309,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetExtension" + # type: (...) -> "_models.VirtualMachineScaleSetExtension" """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -311,7 +325,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSetExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -361,7 +375,7 @@ def list( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetExtensionListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetExtensionListResult"] """Gets a list of all extensions in a VM scale set. :param resource_group_name: The name of the resource group. @@ -373,7 +387,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSetExtensionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtensionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 7412e62f6bbf..5debeacb13b0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VirtualMachineScaleSetRollingUpgradesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -134,7 +134,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -238,7 +244,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -342,7 +354,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -362,7 +380,7 @@ def get_latest( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RollingUpgradeStatusInfo" + # type: (...) -> "_models.RollingUpgradeStatusInfo" """Gets the status of the latest virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -374,7 +392,7 @@ def get_latest( :rtype: ~azure.mgmt.compute.v2018_06_01.models.RollingUpgradeStatusInfo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RollingUpgradeStatusInfo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_vms_operations.py index 0c2ade06ca41..ac7d3cc3dbe8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetVMsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def _reimage_initial( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - vm_scale_set_vm_reimage_input=None, # type: Optional["models.VirtualMachineReimageParameters"] + vm_scale_set_vm_reimage_input=None, # type: Optional["_models.VirtualMachineReimageParameters"] **kwargs # type: Any ): # type: (...) -> None @@ -106,7 +106,7 @@ def begin_reimage( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - vm_scale_set_vm_reimage_input=None, # type: Optional["models.VirtualMachineReimageParameters"] + vm_scale_set_vm_reimage_input=None, # type: Optional["_models.VirtualMachineReimageParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -154,7 +154,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -263,7 +270,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -373,7 +387,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -392,11 +413,11 @@ def _update_initial( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.VirtualMachineScaleSetVM" + parameters, # type: "_models.VirtualMachineScaleSetVM" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVM" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + # type: (...) -> "_models.VirtualMachineScaleSetVM" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -452,10 +473,10 @@ def begin_update( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.VirtualMachineScaleSetVM" + parameters, # type: "_models.VirtualMachineScaleSetVM" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSetVM"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSetVM"] """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. @@ -478,7 +499,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -504,7 +525,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -612,7 +640,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -633,7 +668,7 @@ def get( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVM" + # type: (...) -> "_models.VirtualMachineScaleSetVM" """Gets a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -647,7 +682,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSetVM :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -696,7 +731,7 @@ def get_instance_view( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVMInstanceView" + # type: (...) -> "_models.VirtualMachineScaleSetVMInstanceView" """Gets the status of a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -710,7 +745,7 @@ def get_instance_view( :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSetVMInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -761,7 +796,7 @@ def list( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetVMListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetVMListResult"] """Gets a list of all virtual machines in a VM scale sets. :param resource_group_name: The name of the resource group. @@ -782,7 +817,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSetVMListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -941,7 +976,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1049,7 +1091,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1157,7 +1206,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1266,7 +1322,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1374,7 +1437,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1393,11 +1463,11 @@ def _run_command_initial( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> Optional["models.RunCommandResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + # type: (...) -> Optional["_models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1451,10 +1521,10 @@ def begin_run_command( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RunCommandResult"] + # type: (...) -> LROPoller["_models.RunCommandResult"] """Run command on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1476,7 +1546,7 @@ def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1502,7 +1572,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_sets_operations.py index dc0cfc850af4..d2cf79b5d8b0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSet" + parameters, # type: "_models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + # type: (...) -> "_models.VirtualMachineScaleSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSet" + parameters, # type: "_models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSet"] """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -175,11 +181,11 @@ def _update_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSetUpdate" + parameters, # type: "_models.VirtualMachineScaleSetUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + # type: (...) -> "_models.VirtualMachineScaleSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -229,10 +235,10 @@ def begin_update( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSetUpdate" + parameters, # type: "_models.VirtualMachineScaleSetUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSet"] """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -379,7 +391,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -399,7 +417,7 @@ def get( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" + # type: (...) -> "_models.VirtualMachineScaleSet" """Display information about a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -411,7 +429,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -456,7 +474,7 @@ def _deallocate_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -508,7 +526,7 @@ def begin_deallocate( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -555,7 +573,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -573,7 +597,7 @@ def _delete_instances_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): # type: (...) -> None @@ -622,7 +646,7 @@ def begin_delete_instances( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -667,7 +691,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -687,7 +717,7 @@ def get_instance_view( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetInstanceView" + # type: (...) -> "_models.VirtualMachineScaleSetInstanceView" """Gets the status of a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -699,7 +729,7 @@ def get_instance_view( :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSetInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -745,7 +775,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListResult"] """Gets a list of all VM scale sets under a resource group. :param resource_group_name: The name of the resource group. @@ -755,7 +785,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -815,7 +845,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListWithLinkResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListWithLinkResult"] """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. @@ -825,7 +855,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSetListWithLinkResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListWithLinkResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -886,7 +916,7 @@ def list_skus( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListSkusResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListSkusResult"] """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. @@ -899,7 +929,7 @@ def list_skus( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSetListSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -962,7 +992,7 @@ def get_os_upgrade_history( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListOSUpgradeHistory"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListOSUpgradeHistory"] """Gets list of OS upgrades on a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -974,7 +1004,7 @@ def get_os_upgrade_history( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineScaleSetListOSUpgradeHistory] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListOSUpgradeHistory"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1035,7 +1065,7 @@ def _power_off_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1087,7 +1117,7 @@ def begin_power_off( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1134,7 +1164,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1152,7 +1188,7 @@ def _restart_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1204,7 +1240,7 @@ def begin_restart( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1249,7 +1285,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1267,7 +1309,7 @@ def _start_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1319,7 +1361,7 @@ def begin_start( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1364,7 +1406,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1382,7 +1430,7 @@ def _redeploy_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1434,7 +1482,7 @@ def begin_redeploy( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1480,7 +1528,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1498,7 +1552,7 @@ def _perform_maintenance_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1550,7 +1604,7 @@ def begin_perform_maintenance( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1598,7 +1652,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1616,7 +1676,7 @@ def _update_instances_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): # type: (...) -> None @@ -1665,7 +1725,7 @@ def begin_update_instances( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1710,7 +1770,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1728,7 +1794,7 @@ def _reimage_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_scale_set_reimage_input=None, # type: Optional["models.VirtualMachineScaleSetReimageParameters"] + vm_scale_set_reimage_input=None, # type: Optional["_models.VirtualMachineScaleSetReimageParameters"] **kwargs # type: Any ): # type: (...) -> None @@ -1780,7 +1846,7 @@ def begin_reimage( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_scale_set_reimage_input=None, # type: Optional["models.VirtualMachineScaleSetReimageParameters"] + vm_scale_set_reimage_input=None, # type: Optional["_models.VirtualMachineScaleSetReimageParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1827,7 +1893,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1845,7 +1917,7 @@ def _reimage_all_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1897,7 +1969,7 @@ def begin_reimage_all( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1943,7 +2015,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1964,7 +2042,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( platform_update_domain, # type: int **kwargs # type: Any ): - # type: (...) -> "models.RecoveryWalkResponse" + # type: (...) -> "_models.RecoveryWalkResponse" """Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. @@ -1980,7 +2058,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( :rtype: ~azure.mgmt.compute.v2018_06_01.models.RecoveryWalkResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryWalkResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_sizes_operations.py index b42cff81154a..b28e79182942 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_sizes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VirtualMachineSizesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """This API is deprecated. Use `Resources Skus `_. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machines_operations.py index ea4497cdb4ea..2c4022aae735 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machines_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachinesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list_by_location( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Gets all the virtual machines under the specified subscription for the specified location. :param location: The location for which virtual machines under the subscription are queried. @@ -62,7 +62,7 @@ def list_by_location( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,11 +122,11 @@ def _capture_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineCaptureParameters" + parameters, # type: "_models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualMachineCaptureResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + # type: (...) -> Optional["_models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualMachineCaptureResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -178,10 +178,10 @@ def begin_capture( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineCaptureParameters" + parameters, # type: "_models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineCaptureResult"] + # type: (...) -> LROPoller["_models.VirtualMachineCaptureResult"] """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -202,7 +202,7 @@ def begin_capture( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -227,7 +227,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -245,11 +251,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachine" + parameters, # type: "_models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + # type: (...) -> "_models.VirtualMachine" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,10 +309,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachine" + parameters, # type: "_models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachine"] + # type: (...) -> LROPoller["_models.VirtualMachine"] """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -326,7 +332,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +357,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -369,11 +381,11 @@ def _update_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineUpdate" + parameters, # type: "_models.VirtualMachineUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + # type: (...) -> "_models.VirtualMachine" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -427,10 +439,10 @@ def begin_update( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineUpdate" + parameters, # type: "_models.VirtualMachineUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachine"] + # type: (...) -> LROPoller["_models.VirtualMachine"] """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -450,7 +462,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -475,7 +487,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -577,7 +595,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -598,7 +622,7 @@ def get( expand="instanceView", # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" + # type: (...) -> "_models.VirtualMachine" """Retrieves information about the model view or the instance view of a virtual machine. :param resource_group_name: The name of the resource group. @@ -612,7 +636,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachine :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -661,7 +685,7 @@ def instance_view( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineInstanceView" + # type: (...) -> "_models.VirtualMachineInstanceView" """Retrieves information about the run-time state of a virtual machine. :param resource_group_name: The name of the resource group. @@ -673,7 +697,7 @@ def instance_view( :rtype: ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -803,7 +827,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -906,7 +936,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -979,7 +1015,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. @@ -990,7 +1026,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1050,7 +1086,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. @@ -1059,7 +1095,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1120,7 +1156,7 @@ def list_available_sizes( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes to which the specified virtual machine can be resized. @@ -1133,7 +1169,7 @@ def list_available_sizes( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1279,7 +1315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1381,7 +1423,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1483,7 +1531,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1585,7 +1639,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1603,7 +1663,7 @@ def _reimage_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters=None, # type: Optional["models.VirtualMachineReimageParameters"] + parameters=None, # type: Optional["_models.VirtualMachineReimageParameters"] **kwargs # type: Any ): # type: (...) -> None @@ -1655,7 +1715,7 @@ def begin_reimage( self, resource_group_name, # type: str vm_name, # type: str - parameters=None, # type: Optional["models.VirtualMachineReimageParameters"] + parameters=None, # type: Optional["_models.VirtualMachineReimageParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1700,7 +1760,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1802,7 +1868,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1820,11 +1892,11 @@ def _run_command_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> Optional["models.RunCommandResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + # type: (...) -> Optional["_models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1876,10 +1948,10 @@ def begin_run_command( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RunCommandResult"] + # type: (...) -> LROPoller["_models.RunCommandResult"] """Run command on the VM. :param resource_group_name: The name of the resource group. @@ -1899,7 +1971,7 @@ def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1924,7 +1996,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_compute_management_client.py index d85a35770ba6..0b41e738e9af 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_compute_management_client.py @@ -53,7 +53,6 @@ def __init__( 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.disks = DisksOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_metadata.json index 0f60a6edcf79..8d4e2870a5cd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/_compute_management_client.py index 41d9fcafc629..553c60a12702 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/_compute_management_client.py @@ -50,7 +50,6 @@ def __init__( 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.disks = DisksOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_disks_operations.py index a019b5498207..2959de62ccfa 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_disks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DisksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, disk_name: str, - disk: "models.Disk", + disk: "_models.Disk", **kwargs - ) -> "models.Disk": - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + ) -> "_models.Disk": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, disk_name: str, - disk: "models.Disk", + disk: "_models.Disk", **kwargs - ) -> AsyncLROPoller["models.Disk"]: + ) -> AsyncLROPoller["_models.Disk"]: """Creates or updates a disk. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -171,10 +177,10 @@ async def _update_initial( self, resource_group_name: str, disk_name: str, - disk: "models.DiskUpdate", + disk: "_models.DiskUpdate", **kwargs - ) -> "models.Disk": - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + ) -> "_models.Disk": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,9 +234,9 @@ async def begin_update( self, resource_group_name: str, disk_name: str, - disk: "models.DiskUpdate", + disk: "_models.DiskUpdate", **kwargs - ) -> AsyncLROPoller["models.Disk"]: + ) -> AsyncLROPoller["_models.Disk"]: """Updates (patches) a disk. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -296,7 +308,7 @@ async def get( resource_group_name: str, disk_name: str, **kwargs - ) -> "models.Disk": + ) -> "_models.Disk": """Gets information about a disk. :param resource_group_name: The name of the resource group. @@ -310,7 +322,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_09_30.models.Disk :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -457,7 +475,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DiskList"]: + ) -> AsyncIterable["_models.DiskList"]: """Lists all the disks under a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_09_30.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -526,7 +544,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.DiskList"]: + ) -> AsyncIterable["_models.DiskList"]: """Lists all the disks under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -534,7 +552,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_09_30.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -593,10 +611,10 @@ async def _grant_access_initial( self, resource_group_name: str, disk_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> Optional["models.AccessUri"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + ) -> Optional["_models.AccessUri"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -648,9 +666,9 @@ async def begin_grant_access( self, resource_group_name: str, disk_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> AsyncLROPoller["models.AccessUri"]: + ) -> AsyncLROPoller["_models.AccessUri"]: """Grants access to a disk. :param resource_group_name: The name of the resource group. @@ -673,7 +691,7 @@ async def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -698,7 +716,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -800,7 +824,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_snapshots_operations.py index a88b96a45389..6676e7b832f0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_snapshots_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SnapshotsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.Snapshot", + snapshot: "_models.Snapshot", **kwargs - ) -> "models.Snapshot": - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + ) -> "_models.Snapshot": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.Snapshot", + snapshot: "_models.Snapshot", **kwargs - ) -> AsyncLROPoller["models.Snapshot"]: + ) -> AsyncLROPoller["_models.Snapshot"]: """Creates or updates a snapshot. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -171,10 +177,10 @@ async def _update_initial( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.SnapshotUpdate", + snapshot: "_models.SnapshotUpdate", **kwargs - ) -> "models.Snapshot": - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + ) -> "_models.Snapshot": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,9 +234,9 @@ async def begin_update( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.SnapshotUpdate", + snapshot: "_models.SnapshotUpdate", **kwargs - ) -> AsyncLROPoller["models.Snapshot"]: + ) -> AsyncLROPoller["_models.Snapshot"]: """Updates (patches) a snapshot. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -296,7 +308,7 @@ async def get( resource_group_name: str, snapshot_name: str, **kwargs - ) -> "models.Snapshot": + ) -> "_models.Snapshot": """Gets information about a snapshot. :param resource_group_name: The name of the resource group. @@ -310,7 +322,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_09_30.models.Snapshot :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -457,7 +475,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.SnapshotList"]: + ) -> AsyncIterable["_models.SnapshotList"]: """Lists snapshots under a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_09_30.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -526,7 +544,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.SnapshotList"]: + ) -> AsyncIterable["_models.SnapshotList"]: """Lists snapshots under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -534,7 +552,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_09_30.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -593,10 +611,10 @@ async def _grant_access_initial( self, resource_group_name: str, snapshot_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> Optional["models.AccessUri"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + ) -> Optional["_models.AccessUri"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -648,9 +666,9 @@ async def begin_grant_access( self, resource_group_name: str, snapshot_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> AsyncLROPoller["models.AccessUri"]: + ) -> AsyncLROPoller["_models.AccessUri"]: """Grants access to a snapshot. :param resource_group_name: The name of the resource group. @@ -673,7 +691,7 @@ async def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -698,7 +716,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -800,7 +824,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_disks_operations.py index 6125a88bd0d2..21abc4ff850f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_disks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DisksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.Disk" + disk, # type: "_models.Disk" **kwargs # type: Any ): - # type: (...) -> "models.Disk" - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + # type: (...) -> "_models.Disk" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.Disk" + disk, # type: "_models.Disk" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Disk"] + # type: (...) -> LROPoller["_models.Disk"] """Creates or updates a disk. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -177,11 +183,11 @@ def _update_initial( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.DiskUpdate" + disk, # type: "_models.DiskUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Disk" - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + # type: (...) -> "_models.Disk" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,10 +241,10 @@ def begin_update( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.DiskUpdate" + disk, # type: "_models.DiskUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Disk"] + # type: (...) -> LROPoller["_models.Disk"] """Updates (patches) a disk. :param resource_group_name: The name of the resource group. @@ -260,7 +266,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -285,7 +291,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -305,7 +317,7 @@ def get( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Disk" + # type: (...) -> "_models.Disk" """Gets information about a disk. :param resource_group_name: The name of the resource group. @@ -319,7 +331,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_09_30.models.Disk :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -450,7 +462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -469,7 +487,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskList"] + # type: (...) -> Iterable["_models.DiskList"] """Lists all the disks under a resource group. :param resource_group_name: The name of the resource group. @@ -479,7 +497,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_09_30.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -539,7 +557,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskList"] + # type: (...) -> Iterable["_models.DiskList"] """Lists all the disks under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -547,7 +565,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_09_30.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -606,11 +624,11 @@ def _grant_access_initial( self, resource_group_name, # type: str disk_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> Optional["models.AccessUri"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + # type: (...) -> Optional["_models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -662,10 +680,10 @@ def begin_grant_access( self, resource_group_name, # type: str disk_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AccessUri"] + # type: (...) -> LROPoller["_models.AccessUri"] """Grants access to a disk. :param resource_group_name: The name of the resource group. @@ -688,7 +706,7 @@ def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -713,7 +731,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -817,7 +841,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_snapshots_operations.py index e1f514608065..c91c4a8ba992 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_snapshots_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SnapshotsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.Snapshot" + snapshot, # type: "_models.Snapshot" **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + # type: (...) -> "_models.Snapshot" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.Snapshot" + snapshot, # type: "_models.Snapshot" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Snapshot"] + # type: (...) -> LROPoller["_models.Snapshot"] """Creates or updates a snapshot. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -177,11 +183,11 @@ def _update_initial( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.SnapshotUpdate" + snapshot, # type: "_models.SnapshotUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + # type: (...) -> "_models.Snapshot" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,10 +241,10 @@ def begin_update( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.SnapshotUpdate" + snapshot, # type: "_models.SnapshotUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Snapshot"] + # type: (...) -> LROPoller["_models.Snapshot"] """Updates (patches) a snapshot. :param resource_group_name: The name of the resource group. @@ -260,7 +266,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -285,7 +291,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -305,7 +317,7 @@ def get( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" + # type: (...) -> "_models.Snapshot" """Gets information about a snapshot. :param resource_group_name: The name of the resource group. @@ -319,7 +331,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_09_30.models.Snapshot :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -450,7 +462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -469,7 +487,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SnapshotList"] + # type: (...) -> Iterable["_models.SnapshotList"] """Lists snapshots under a resource group. :param resource_group_name: The name of the resource group. @@ -479,7 +497,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_09_30.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -539,7 +557,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.SnapshotList"] + # type: (...) -> Iterable["_models.SnapshotList"] """Lists snapshots under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -547,7 +565,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_09_30.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -606,11 +624,11 @@ def _grant_access_initial( self, resource_group_name, # type: str snapshot_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> Optional["models.AccessUri"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + # type: (...) -> Optional["_models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -662,10 +680,10 @@ def begin_grant_access( self, resource_group_name, # type: str snapshot_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AccessUri"] + # type: (...) -> LROPoller["_models.AccessUri"] """Grants access to a snapshot. :param resource_group_name: The name of the resource group. @@ -688,7 +706,7 @@ def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -713,7 +731,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -817,7 +841,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_compute_management_client.py index f205577bc9ed..8891128c9fd0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_compute_management_client.py @@ -95,7 +95,6 @@ def __init__( 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( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_metadata.json index 5de12bc8c9e1..802f47d3e80e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_compute_management_client.py index 4109da03e7d8..54e61613647c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_compute_management_client.py @@ -92,7 +92,6 @@ def __init__( 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( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_availability_sets_operations.py index dcfc7d96f5bd..79d9d14574c2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_availability_sets_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailabilitySetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, availability_set_name: str, - parameters: "models.AvailabilitySet", + parameters: "_models.AvailabilitySet", **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Create or update an availability set. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~azure.mgmt.compute.v2018_10_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,9 +111,9 @@ async def update( self, resource_group_name: str, availability_set_name: str, - parameters: "models.AvailabilitySetUpdate", + parameters: "_models.AvailabilitySetUpdate", **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Update an availability set. :param resource_group_name: The name of the resource group. @@ -127,7 +127,7 @@ async def update( :rtype: ~azure.mgmt.compute.v2018_10_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +231,7 @@ async def get( resource_group_name: str, availability_set_name: str, **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Retrieves information about an availability set. :param resource_group_name: The name of the resource group. @@ -243,7 +243,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_10_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,7 +288,7 @@ def list_by_subscription( self, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.AvailabilitySetListResult"]: + ) -> AsyncIterable["_models.AvailabilitySetListResult"]: """Lists all availability sets in a subscription. :param expand: The expand expression to apply to the operation. Allowed values are @@ -299,7 +299,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_10_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -360,7 +360,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailabilitySetListResult"]: + ) -> AsyncIterable["_models.AvailabilitySetListResult"]: """Lists all availability sets in a resource group. :param resource_group_name: The name of the resource group. @@ -370,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_10_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -431,7 +431,7 @@ def list_available_sizes( resource_group_name: str, availability_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. @@ -444,7 +444,7 @@ def list_available_sizes( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_images_operations.py index 73f1400bf8b6..8ff80d7646d3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, image_name: str, - parameters: "models.Image", + parameters: "_models.Image", **kwargs - ) -> "models.Image": - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + ) -> "_models.Image": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, image_name: str, - parameters: "models.Image", + parameters: "_models.Image", **kwargs - ) -> AsyncLROPoller["models.Image"]: + ) -> AsyncLROPoller["_models.Image"]: """Create or update an image. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -169,10 +175,10 @@ async def _update_initial( self, resource_group_name: str, image_name: str, - parameters: "models.ImageUpdate", + parameters: "_models.ImageUpdate", **kwargs - ) -> "models.Image": - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + ) -> "_models.Image": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -226,9 +232,9 @@ async def begin_update( self, resource_group_name: str, image_name: str, - parameters: "models.ImageUpdate", + parameters: "_models.ImageUpdate", **kwargs - ) -> AsyncLROPoller["models.Image"]: + ) -> AsyncLROPoller["_models.Image"]: """Update an image. :param resource_group_name: The name of the resource group. @@ -248,7 +254,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -273,7 +279,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -373,7 +385,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -393,7 +411,7 @@ async def get( image_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Image": + ) -> "_models.Image": """Gets an image. :param resource_group_name: The name of the resource group. @@ -407,7 +425,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_10_01.models.Image :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -454,7 +472,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ImageListResult"]: + ) -> AsyncIterable["_models.ImageListResult"]: """Gets the list of images under a resource group. :param resource_group_name: The name of the resource group. @@ -464,7 +482,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_10_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ImageListResult"]: + ) -> AsyncIterable["_models.ImageListResult"]: """Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. @@ -532,7 +550,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_10_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_log_analytics_operations.py index 8a1e2573fc6e..c8b83b0e8313 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_log_analytics_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class LogAnalyticsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,10 +45,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def _export_request_rate_by_interval_initial( self, location: str, - parameters: "models.RequestRateByIntervalInput", + parameters: "_models.RequestRateByIntervalInput", **kwargs - ) -> Optional["models.LogAnalyticsOperationResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + ) -> Optional["_models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -98,9 +98,9 @@ async def _export_request_rate_by_interval_initial( async def begin_export_request_rate_by_interval( self, location: str, - parameters: "models.RequestRateByIntervalInput", + parameters: "_models.RequestRateByIntervalInput", **kwargs - ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: + ) -> AsyncLROPoller["_models.LogAnalyticsOperationResult"]: """Export logs that show Api requests made by this subscription in the given time window to show throttling activities. @@ -119,7 +119,7 @@ async def begin_export_request_rate_by_interval( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -143,7 +143,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -160,10 +165,10 @@ def get_long_running_output(pipeline_response): async def _export_throttled_requests_initial( self, location: str, - parameters: "models.LogAnalyticsInputBase", + parameters: "_models.LogAnalyticsInputBase", **kwargs - ) -> Optional["models.LogAnalyticsOperationResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + ) -> Optional["_models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -213,9 +218,9 @@ async def _export_throttled_requests_initial( async def begin_export_throttled_requests( self, location: str, - parameters: "models.LogAnalyticsInputBase", + parameters: "_models.LogAnalyticsInputBase", **kwargs - ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: + ) -> AsyncLROPoller["_models.LogAnalyticsOperationResult"]: """Export logs that show total throttled Api requests for this subscription in the given time window. @@ -234,7 +239,7 @@ async def begin_export_throttled_requests( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -258,7 +263,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_operations.py index b7bd4f44fd5c..564bd11abdba 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ComputeOperationListResult"]: + ) -> AsyncIterable["_models.ComputeOperationListResult"]: """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_10_01.models.ComputeOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeOperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_proximity_placement_groups_operations.py index e20a4779acf1..3010d6010570 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_proximity_placement_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ProximityPlacementGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, proximity_placement_group_name: str, - parameters: "models.ProximityPlacementGroup", + parameters: "_models.ProximityPlacementGroup", **kwargs - ) -> "models.ProximityPlacementGroup": + ) -> "_models.ProximityPlacementGroup": """Create or update a proximity placement group. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~azure.mgmt.compute.v2018_10_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,9 +115,9 @@ async def update( self, resource_group_name: str, proximity_placement_group_name: str, - parameters: "models.UpdateResource", + parameters: "_models.UpdateResource", **kwargs - ) -> "models.ProximityPlacementGroup": + ) -> "_models.ProximityPlacementGroup": """Update a proximity placement group. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def update( :rtype: ~azure.mgmt.compute.v2018_10_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,7 +235,7 @@ async def get( resource_group_name: str, proximity_placement_group_name: str, **kwargs - ) -> "models.ProximityPlacementGroup": + ) -> "_models.ProximityPlacementGroup": """Retrieves information about a proximity placement group . :param resource_group_name: The name of the resource group. @@ -247,7 +247,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_10_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -291,7 +291,7 @@ async def get( def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.ProximityPlacementGroupListResult"]: + ) -> AsyncIterable["_models.ProximityPlacementGroupListResult"]: """Lists all proximity placement groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -299,7 +299,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_10_01.models.ProximityPlacementGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -358,7 +358,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ProximityPlacementGroupListResult"]: + ) -> AsyncIterable["_models.ProximityPlacementGroupListResult"]: """Lists all proximity placement groups in a resource group. :param resource_group_name: The name of the resource group. @@ -368,7 +368,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_10_01.models.ProximityPlacementGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_usage_operations.py index e1a888a3410d..ca2cd188f79d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsageOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.ListUsagesResult"]: + ) -> AsyncIterable["_models.ListUsagesResult"]: """Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_10_01.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extension_images_operations.py index e3bba4df7f2f..1852b658bb79 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VirtualMachineExtensionImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( type: str, version: str, **kwargs - ) -> "models.VirtualMachineExtensionImage": + ) -> "_models.VirtualMachineExtensionImage": """Gets a virtual machine extension image. :param location: The name of a supported Azure region. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineExtensionImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,7 +111,7 @@ async def list_types( location: str, publisher_name: str, **kwargs - ) -> List["models.VirtualMachineExtensionImage"]: + ) -> List["_models.VirtualMachineExtensionImage"]: """Gets a list of virtual machine extension image types. :param location: The name of a supported Azure region. @@ -123,7 +123,7 @@ async def list_types( :rtype: list[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -173,7 +173,7 @@ async def list_versions( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> List["models.VirtualMachineExtensionImage"]: + ) -> List["_models.VirtualMachineExtensionImage"]: """Gets a list of virtual machine extension image versions. :param location: The name of a supported Azure region. @@ -193,7 +193,7 @@ async def list_versions( :rtype: list[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extensions_operations.py index 6919b7208d07..f5712880ff4d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VirtualMachineExtensionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineExtension", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineExtension", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineExtension"]: """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -177,10 +184,10 @@ async def _update_initial( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineExtensionUpdate", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -232,9 +239,9 @@ async def begin_update( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineExtensionUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineExtension"]: """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -257,7 +264,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -283,7 +290,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -389,7 +403,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -410,7 +431,7 @@ async def get( vm_extension_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtension": + ) -> "_models.VirtualMachineExtension": """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -426,7 +447,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +497,7 @@ async def list( vm_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtensionsListResult": + ) -> "_models.VirtualMachineExtensionsListResult": """The operation to get all extensions of a Virtual Machine. :param resource_group_name: The name of the resource group. @@ -490,7 +511,7 @@ async def list( :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineExtensionsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_images_operations.py index 1dd01edc9418..e4bd6c017677 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VirtualMachineImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( skus: str, version: str, **kwargs - ) -> "models.VirtualMachineImage": + ) -> "_models.VirtualMachineImage": """Gets a virtual machine image. :param location: The name of a supported Azure region. @@ -66,7 +66,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,7 +120,7 @@ async def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. @@ -143,7 +143,7 @@ async def list( :rtype: list[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -197,7 +197,7 @@ async def list_offers( location: str, publisher_name: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image offers for the specified location and publisher. :param location: The name of a supported Azure region. @@ -209,7 +209,7 @@ async def list_offers( :rtype: list[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -254,7 +254,7 @@ async def list_publishers( self, location: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image publishers for the specified Azure location. :param location: The name of a supported Azure region. @@ -264,7 +264,7 @@ async def list_publishers( :rtype: list[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -310,7 +310,7 @@ async def list_skus( publisher_name: str, offer: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. :param location: The name of a supported Azure region. @@ -324,7 +324,7 @@ async def list_skus( :rtype: list[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_run_commands_operations.py index 23b11859fa2a..54c9df205aad 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VirtualMachineRunCommandsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.RunCommandListResult"]: + ) -> AsyncIterable["_models.RunCommandListResult"]: """Lists all available run commands for a subscription in a location. :param location: The location upon which run commands is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_10_01.models.RunCommandListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ async def get( location: str, command_id: str, **kwargs - ) -> "models.RunCommandDocument": + ) -> "_models.RunCommandDocument": """Gets specific run command for a subscription in a location. :param location: The location upon which run commands is queried. @@ -128,7 +128,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_10_01.models.RunCommandDocument :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandDocument"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index c20989f40bff..f0844afa7883 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetExtensionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, vm_scale_set_name: str, vmss_extension_name: str, - extension_parameters: "models.VirtualMachineScaleSetExtension", + extension_parameters: "_models.VirtualMachineScaleSetExtension", **kwargs - ) -> "models.VirtualMachineScaleSetExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + ) -> "_models.VirtualMachineScaleSetExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def begin_create_or_update( resource_group_name: str, vm_scale_set_name: str, vmss_extension_name: str, - extension_parameters: "models.VirtualMachineScaleSetExtension", + extension_parameters: "_models.VirtualMachineScaleSetExtension", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSetExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSetExtension"]: """The operation to create or update an extension. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -265,7 +272,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -286,7 +300,7 @@ async def get( vmss_extension_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineScaleSetExtension": + ) -> "_models.VirtualMachineScaleSetExtension": """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -302,7 +316,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSetExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -351,7 +365,7 @@ def list( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetExtensionListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetExtensionListResult"]: """Gets a list of all extensions in a VM scale set. :param resource_group_name: The name of the resource group. @@ -363,7 +377,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSetExtensionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtensionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index b5fdc6b300a1..78ade1a8ff7e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VirtualMachineScaleSetRollingUpgradesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -128,7 +128,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -230,7 +236,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -332,7 +344,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -351,7 +369,7 @@ async def get_latest( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.RollingUpgradeStatusInfo": + ) -> "_models.RollingUpgradeStatusInfo": """Gets the status of the latest virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -363,7 +381,7 @@ async def get_latest( :rtype: ~azure.mgmt.compute.v2018_10_01.models.RollingUpgradeStatusInfo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RollingUpgradeStatusInfo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index e650f108cb98..783368d74a3b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetVMsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def _reimage_initial( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - vm_scale_set_vm_reimage_input: Optional["models.VirtualMachineReimageParameters"] = None, + vm_scale_set_vm_reimage_input: Optional["_models.VirtualMachineReimageParameters"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -101,7 +101,7 @@ async def begin_reimage( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - vm_scale_set_vm_reimage_input: Optional["models.VirtualMachineReimageParameters"] = None, + vm_scale_set_vm_reimage_input: Optional["_models.VirtualMachineReimageParameters"] = None, **kwargs ) -> AsyncLROPoller[None]: """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. @@ -148,7 +148,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -255,7 +262,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -363,7 +377,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -382,10 +403,10 @@ async def _update_initial( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.VirtualMachineScaleSetVM", + parameters: "_models.VirtualMachineScaleSetVM", **kwargs - ) -> "models.VirtualMachineScaleSetVM": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + ) -> "_models.VirtualMachineScaleSetVM": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -441,9 +462,9 @@ async def begin_update( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.VirtualMachineScaleSetVM", + parameters: "_models.VirtualMachineScaleSetVM", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSetVM"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSetVM"]: """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. @@ -466,7 +487,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -492,7 +513,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -598,7 +626,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -618,7 +653,7 @@ async def get( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.VirtualMachineScaleSetVM": + ) -> "_models.VirtualMachineScaleSetVM": """Gets a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -632,7 +667,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSetVM :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -680,7 +715,7 @@ async def get_instance_view( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.VirtualMachineScaleSetVMInstanceView": + ) -> "_models.VirtualMachineScaleSetVMInstanceView": """Gets the status of a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -694,7 +729,7 @@ async def get_instance_view( :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSetVMInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -744,7 +779,7 @@ def list( select: Optional[str] = None, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetVMListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetVMListResult"]: """Gets a list of all virtual machines in a VM scale sets. :param resource_group_name: The name of the resource group. @@ -765,7 +800,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSetVMListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -922,7 +957,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1028,7 +1070,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1134,7 +1183,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1241,7 +1297,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1347,7 +1410,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1366,10 +1436,10 @@ async def _run_command_initial( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> Optional["models.RunCommandResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + ) -> Optional["_models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1423,9 +1493,9 @@ async def begin_run_command( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> AsyncLROPoller["models.RunCommandResult"]: + ) -> AsyncLROPoller["_models.RunCommandResult"]: """Run command on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1447,7 +1517,7 @@ async def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1473,7 +1543,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_sets_operations.py index 9739ddc65635..5cb62be64907 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSet", + parameters: "_models.VirtualMachineScaleSet", **kwargs - ) -> "models.VirtualMachineScaleSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + ) -> "_models.VirtualMachineScaleSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSet", + parameters: "_models.VirtualMachineScaleSet", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSet"]: """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -169,10 +175,10 @@ async def _update_initial( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSetUpdate", + parameters: "_models.VirtualMachineScaleSetUpdate", **kwargs - ) -> "models.VirtualMachineScaleSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + ) -> "_models.VirtualMachineScaleSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -222,9 +228,9 @@ async def begin_update( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSetUpdate", + parameters: "_models.VirtualMachineScaleSetUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSet"]: """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -244,7 +250,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -269,7 +275,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -369,7 +381,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -388,7 +406,7 @@ async def get( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> "_models.VirtualMachineScaleSet": """Display information about a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -400,7 +418,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -445,7 +463,7 @@ async def _deallocate_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -496,7 +514,7 @@ async def begin_deallocate( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and @@ -542,7 +560,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -560,7 +584,7 @@ async def _delete_instances_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -608,7 +632,7 @@ async def begin_delete_instances( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs ) -> AsyncLROPoller[None]: """Deletes virtual machines in a VM scale set. @@ -652,7 +676,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -671,7 +701,7 @@ async def get_instance_view( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.VirtualMachineScaleSetInstanceView": + ) -> "_models.VirtualMachineScaleSetInstanceView": """Gets the status of a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -683,7 +713,7 @@ async def get_instance_view( :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSetInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -728,7 +758,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListResult"]: """Gets a list of all VM scale sets under a resource group. :param resource_group_name: The name of the resource group. @@ -738,7 +768,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -797,7 +827,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListWithLinkResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListWithLinkResult"]: """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. @@ -807,7 +837,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSetListWithLinkResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListWithLinkResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -867,7 +897,7 @@ def list_skus( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListSkusResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListSkusResult"]: """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. @@ -880,7 +910,7 @@ def list_skus( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSetListSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -942,7 +972,7 @@ def get_os_upgrade_history( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListOSUpgradeHistory"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListOSUpgradeHistory"]: """Gets list of OS upgrades on a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -954,7 +984,7 @@ def get_os_upgrade_history( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSetListOSUpgradeHistory] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListOSUpgradeHistory"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1015,7 +1045,7 @@ async def _power_off_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1066,7 +1096,7 @@ async def begin_power_off( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still @@ -1112,7 +1142,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1130,7 +1166,7 @@ async def _restart_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1181,7 +1217,7 @@ async def begin_restart( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Restarts one or more virtual machines in a VM scale set. @@ -1225,7 +1261,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1243,7 +1285,7 @@ async def _start_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1294,7 +1336,7 @@ async def begin_start( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Starts one or more virtual machines in a VM scale set. @@ -1338,7 +1380,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1356,7 +1404,7 @@ async def _redeploy_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1407,7 +1455,7 @@ async def begin_redeploy( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, @@ -1452,7 +1500,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1470,7 +1524,7 @@ async def _perform_maintenance_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1521,7 +1575,7 @@ async def begin_perform_maintenance( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances @@ -1568,7 +1622,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1586,7 +1646,7 @@ async def _update_instances_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1634,7 +1694,7 @@ async def begin_update_instances( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs ) -> AsyncLROPoller[None]: """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. @@ -1678,7 +1738,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1696,7 +1762,7 @@ async def _reimage_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_scale_set_reimage_input: Optional["models.VirtualMachineScaleSetReimageParameters"] = None, + vm_scale_set_reimage_input: Optional["_models.VirtualMachineScaleSetReimageParameters"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1747,7 +1813,7 @@ async def begin_reimage( self, resource_group_name: str, vm_scale_set_name: str, - vm_scale_set_reimage_input: Optional["models.VirtualMachineScaleSetReimageParameters"] = None, + vm_scale_set_reimage_input: Optional["_models.VirtualMachineScaleSetReimageParameters"] = None, **kwargs ) -> AsyncLROPoller[None]: """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which @@ -1793,7 +1859,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1811,7 +1883,7 @@ async def _reimage_all_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1862,7 +1934,7 @@ async def begin_reimage_all( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This @@ -1907,7 +1979,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1927,7 +2005,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( vm_scale_set_name: str, platform_update_domain: int, **kwargs - ) -> "models.RecoveryWalkResponse": + ) -> "_models.RecoveryWalkResponse": """Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. @@ -1943,7 +2021,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( :rtype: ~azure.mgmt.compute.v2018_10_01.models.RecoveryWalkResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryWalkResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_sizes_operations.py index dbcc7aa672d5..5023b2c4dfa2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_sizes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VirtualMachineSizesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """This API is deprecated. Use `Resources Skus `_. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machines_operations.py index 7748cd0d4173..e58a660c2aea 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machines_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachinesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list_by_location( self, location: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Gets all the virtual machines under the specified subscription for the specified location. :param location: The location for which virtual machines under the subscription are queried. @@ -57,7 +57,7 @@ def list_by_location( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,10 +117,10 @@ async def _capture_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineCaptureParameters", + parameters: "_models.VirtualMachineCaptureParameters", **kwargs - ) -> Optional["models.VirtualMachineCaptureResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + ) -> Optional["_models.VirtualMachineCaptureResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualMachineCaptureResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -172,9 +172,9 @@ async def begin_capture( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineCaptureParameters", + parameters: "_models.VirtualMachineCaptureParameters", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineCaptureResult"]: + ) -> AsyncLROPoller["_models.VirtualMachineCaptureResult"]: """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -195,7 +195,7 @@ async def begin_capture( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -220,7 +220,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -238,10 +244,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachine", + parameters: "_models.VirtualMachine", **kwargs - ) -> "models.VirtualMachine": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + ) -> "_models.VirtualMachine": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,9 +301,9 @@ async def begin_create_or_update( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachine", + parameters: "_models.VirtualMachine", **kwargs - ) -> AsyncLROPoller["models.VirtualMachine"]: + ) -> AsyncLROPoller["_models.VirtualMachine"]: """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -317,7 +323,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +348,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -360,10 +372,10 @@ async def _update_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineUpdate", + parameters: "_models.VirtualMachineUpdate", **kwargs - ) -> "models.VirtualMachine": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + ) -> "_models.VirtualMachine": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -417,9 +429,9 @@ async def begin_update( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineUpdate", + parameters: "_models.VirtualMachineUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachine"]: + ) -> AsyncLROPoller["_models.VirtualMachine"]: """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -439,7 +451,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -464,7 +476,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -564,7 +582,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -584,7 +608,7 @@ async def get( vm_name: str, expand: Optional[str] = "instanceView", **kwargs - ) -> "models.VirtualMachine": + ) -> "_models.VirtualMachine": """Retrieves information about the model view or the instance view of a virtual machine. :param resource_group_name: The name of the resource group. @@ -598,7 +622,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachine :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -646,7 +670,7 @@ async def instance_view( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.VirtualMachineInstanceView": + ) -> "_models.VirtualMachineInstanceView": """Retrieves information about the run-time state of a virtual machine. :param resource_group_name: The name of the resource group. @@ -658,7 +682,7 @@ async def instance_view( :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -786,7 +810,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -887,7 +917,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -958,7 +994,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. @@ -969,7 +1005,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1028,7 +1064,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. @@ -1037,7 +1073,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1097,7 +1133,7 @@ def list_available_sizes( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes to which the specified virtual machine can be resized. @@ -1110,7 +1146,7 @@ def list_available_sizes( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1254,7 +1290,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1354,7 +1396,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1454,7 +1502,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1554,7 +1608,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1572,7 +1632,7 @@ async def _reimage_initial( self, resource_group_name: str, vm_name: str, - parameters: Optional["models.VirtualMachineReimageParameters"] = None, + parameters: Optional["_models.VirtualMachineReimageParameters"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1623,7 +1683,7 @@ async def begin_reimage( self, resource_group_name: str, vm_name: str, - parameters: Optional["models.VirtualMachineReimageParameters"] = None, + parameters: Optional["_models.VirtualMachineReimageParameters"] = None, **kwargs ) -> AsyncLROPoller[None]: """Reimages the virtual machine which has an ephemeral OS disk back to its initial state. @@ -1667,7 +1727,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1767,7 +1833,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1785,10 +1857,10 @@ async def _run_command_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> Optional["models.RunCommandResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + ) -> Optional["_models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1840,9 +1912,9 @@ async def begin_run_command( self, resource_group_name: str, vm_name: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> AsyncLROPoller["models.RunCommandResult"]: + ) -> AsyncLROPoller["_models.RunCommandResult"]: """Run command on the VM. :param resource_group_name: The name of the resource group. @@ -1862,7 +1934,7 @@ async def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1887,7 +1959,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/__init__.py index 1c402e150e24..d5aa33f73a9e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/__init__.py @@ -20,8 +20,6 @@ from ._models_py3 import AvailabilitySetUpdate from ._models_py3 import BootDiagnostics from ._models_py3 import BootDiagnosticsInstanceView - from ._models_py3 import Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties - from ._models_py3 import ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties from ._models_py3 import ComputeOperationListResult from ._models_py3 import ComputeOperationValue from ._models_py3 import DataDisk @@ -88,6 +86,7 @@ from ._models_py3 import UpgradePolicy from ._models_py3 import Usage from ._models_py3 import UsageName + from ._models_py3 import UserAssignedIdentitiesValue from ._models_py3 import VaultCertificate from ._models_py3 import VaultSecretGroup from ._models_py3 import VirtualHardDisk @@ -115,6 +114,7 @@ from ._models_py3 import VirtualMachineScaleSetExtensionProfile from ._models_py3 import VirtualMachineScaleSetIPConfiguration from ._models_py3 import VirtualMachineScaleSetIdentity + from ._models_py3 import VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue from ._models_py3 import VirtualMachineScaleSetInstanceView from ._models_py3 import VirtualMachineScaleSetInstanceViewStatusesSummary from ._models_py3 import VirtualMachineScaleSetIpTag @@ -172,8 +172,6 @@ from ._models import AvailabilitySetUpdate # type: ignore from ._models import BootDiagnostics # type: ignore from ._models import BootDiagnosticsInstanceView # type: ignore - from ._models import Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore - from ._models import ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore from ._models import ComputeOperationListResult # type: ignore from ._models import ComputeOperationValue # type: ignore from ._models import DataDisk # type: ignore @@ -240,6 +238,7 @@ from ._models import UpgradePolicy # type: ignore from ._models import Usage # type: ignore from ._models import UsageName # type: ignore + from ._models import UserAssignedIdentitiesValue # type: ignore from ._models import VaultCertificate # type: ignore from ._models import VaultSecretGroup # type: ignore from ._models import VirtualHardDisk # type: ignore @@ -267,6 +266,7 @@ from ._models import VirtualMachineScaleSetExtensionProfile # type: ignore from ._models import VirtualMachineScaleSetIPConfiguration # type: ignore from ._models import VirtualMachineScaleSetIdentity # type: ignore + from ._models import VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue # type: ignore from ._models import VirtualMachineScaleSetInstanceView # type: ignore from ._models import VirtualMachineScaleSetInstanceViewStatusesSummary # type: ignore from ._models import VirtualMachineScaleSetIpTag # type: ignore @@ -352,8 +352,6 @@ 'AvailabilitySetUpdate', 'BootDiagnostics', 'BootDiagnosticsInstanceView', - 'Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties', - 'ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties', 'ComputeOperationListResult', 'ComputeOperationValue', 'DataDisk', @@ -420,6 +418,7 @@ 'UpgradePolicy', 'Usage', 'UsageName', + 'UserAssignedIdentitiesValue', 'VaultCertificate', 'VaultSecretGroup', 'VirtualHardDisk', @@ -447,6 +446,7 @@ 'VirtualMachineScaleSetExtensionProfile', 'VirtualMachineScaleSetIPConfiguration', 'VirtualMachineScaleSetIdentity', + 'VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue', 'VirtualMachineScaleSetInstanceView', 'VirtualMachineScaleSetInstanceViewStatusesSummary', 'VirtualMachineScaleSetIpTag', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models.py index 9f0d6d71a6db..98f3f939b8df 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models.py @@ -517,66 +517,6 @@ def __init__( self.status = None -class Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - class ComputeOperationListResult(msrest.serialization.Model): """The List Compute Operation operation response. @@ -2993,6 +2933,36 @@ def __init__( self.localized_value = kwargs.get('localized_value', None) +class UserAssignedIdentitiesValue(msrest.serialization.Model): + """UserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class VaultCertificate(msrest.serialization.Model): """Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM. @@ -3637,7 +3607,7 @@ class VirtualMachineIdentity(msrest.serialization.Model): Machine. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :type user_assigned_identities: dict[str, - ~azure.mgmt.compute.v2018_10_01.models.Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties] + ~azure.mgmt.compute.v2018_10_01.models.UserAssignedIdentitiesValue] """ _validation = { @@ -3649,7 +3619,7 @@ class VirtualMachineIdentity(msrest.serialization.Model): 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentitiesValue}'}, } def __init__( @@ -4192,7 +4162,7 @@ class VirtualMachineScaleSetIdentity(msrest.serialization.Model): form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :type user_assigned_identities: dict[str, - ~azure.mgmt.compute.v2018_10_01.models.ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties] + ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue] """ _validation = { @@ -4204,7 +4174,7 @@ class VirtualMachineScaleSetIdentity(msrest.serialization.Model): 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue}'}, } def __init__( @@ -4218,6 +4188,36 @@ def __init__( self.user_assigned_identities = kwargs.get('user_assigned_identities', None) +class VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue(msrest.serialization.Model): + """VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class VirtualMachineScaleSetInstanceView(msrest.serialization.Model): """The instance view of a virtual machine scale set. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models_py3.py index 9462ced9ffc1..b9b5183c6dc2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models_py3.py @@ -573,66 +573,6 @@ def __init__( self.status = None -class Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - class ComputeOperationListResult(msrest.serialization.Model): """The List Compute Operation operation response. @@ -3278,6 +3218,36 @@ def __init__( self.localized_value = localized_value +class UserAssignedIdentitiesValue(msrest.serialization.Model): + """UserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class VaultCertificate(msrest.serialization.Model): """Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM. @@ -3995,7 +3965,7 @@ class VirtualMachineIdentity(msrest.serialization.Model): Machine. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :type user_assigned_identities: dict[str, - ~azure.mgmt.compute.v2018_10_01.models.Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties] + ~azure.mgmt.compute.v2018_10_01.models.UserAssignedIdentitiesValue] """ _validation = { @@ -4007,14 +3977,14 @@ class VirtualMachineIdentity(msrest.serialization.Model): 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentitiesValue}'}, } def __init__( self, *, type: Optional[Union[str, "ResourceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, "Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + user_assigned_identities: Optional[Dict[str, "UserAssignedIdentitiesValue"]] = None, **kwargs ): super(VirtualMachineIdentity, self).__init__(**kwargs) @@ -4624,7 +4594,7 @@ class VirtualMachineScaleSetIdentity(msrest.serialization.Model): form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :type user_assigned_identities: dict[str, - ~azure.mgmt.compute.v2018_10_01.models.ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties] + ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue] """ _validation = { @@ -4636,14 +4606,14 @@ class VirtualMachineScaleSetIdentity(msrest.serialization.Model): 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue}'}, } def __init__( self, *, type: Optional[Union[str, "ResourceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, "ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + user_assigned_identities: Optional[Dict[str, "VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue"]] = None, **kwargs ): super(VirtualMachineScaleSetIdentity, self).__init__(**kwargs) @@ -4653,6 +4623,36 @@ def __init__( self.user_assigned_identities = user_assigned_identities +class VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue(msrest.serialization.Model): + """VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class VirtualMachineScaleSetInstanceView(msrest.serialization.Model): """The instance view of a virtual machine scale set. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_availability_sets_operations.py index acf61367ed39..8e00cb9e78ba 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_availability_sets_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailabilitySetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str availability_set_name, # type: str - parameters, # type: "models.AvailabilitySet" + parameters, # type: "_models.AvailabilitySet" **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Create or update an availability set. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~azure.mgmt.compute.v2018_10_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,10 +116,10 @@ def update( self, resource_group_name, # type: str availability_set_name, # type: str - parameters, # type: "models.AvailabilitySetUpdate" + parameters, # type: "_models.AvailabilitySetUpdate" **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Update an availability set. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ def update( :rtype: ~azure.mgmt.compute.v2018_10_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -239,7 +239,7 @@ def get( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Retrieves information about an availability set. :param resource_group_name: The name of the resource group. @@ -251,7 +251,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_10_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -297,7 +297,7 @@ def list_by_subscription( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailabilitySetListResult"] + # type: (...) -> Iterable["_models.AvailabilitySetListResult"] """Lists all availability sets in a subscription. :param expand: The expand expression to apply to the operation. Allowed values are @@ -308,7 +308,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_10_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -370,7 +370,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailabilitySetListResult"] + # type: (...) -> Iterable["_models.AvailabilitySetListResult"] """Lists all availability sets in a resource group. :param resource_group_name: The name of the resource group. @@ -380,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_10_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -442,7 +442,7 @@ def list_available_sizes( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. @@ -455,7 +455,7 @@ def list_available_sizes( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_images_operations.py index feabf898b7f2..66361806cdd2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.Image" + parameters, # type: "_models.Image" **kwargs # type: Any ): - # type: (...) -> "models.Image" - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + # type: (...) -> "_models.Image" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.Image" + parameters, # type: "_models.Image" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Image"] + # type: (...) -> LROPoller["_models.Image"] """Create or update an image. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -175,11 +181,11 @@ def _update_initial( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.ImageUpdate" + parameters, # type: "_models.ImageUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Image" - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + # type: (...) -> "_models.Image" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -233,10 +239,10 @@ def begin_update( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.ImageUpdate" + parameters, # type: "_models.ImageUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Image"] + # type: (...) -> LROPoller["_models.Image"] """Update an image. :param resource_group_name: The name of the resource group. @@ -256,7 +262,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -281,7 +287,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -383,7 +395,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -404,7 +422,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Image" + # type: (...) -> "_models.Image" """Gets an image. :param resource_group_name: The name of the resource group. @@ -418,7 +436,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_10_01.models.Image :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +484,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ImageListResult"] + # type: (...) -> Iterable["_models.ImageListResult"] """Gets the list of images under a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +494,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_10_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -536,7 +554,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ImageListResult"] + # type: (...) -> Iterable["_models.ImageListResult"] """Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. @@ -545,7 +563,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_10_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_log_analytics_operations.py index a7d76e56302b..a3ebc6673e76 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_log_analytics_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class LogAnalyticsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,11 +49,11 @@ def __init__(self, client, config, serializer, deserializer): def _export_request_rate_by_interval_initial( self, location, # type: str - parameters, # type: "models.RequestRateByIntervalInput" + parameters, # type: "_models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> Optional["models.LogAnalyticsOperationResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + # type: (...) -> Optional["_models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -103,10 +103,10 @@ def _export_request_rate_by_interval_initial( def begin_export_request_rate_by_interval( self, location, # type: str - parameters, # type: "models.RequestRateByIntervalInput" + parameters, # type: "_models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] + # type: (...) -> LROPoller["_models.LogAnalyticsOperationResult"] """Export logs that show Api requests made by this subscription in the given time window to show throttling activities. @@ -125,7 +125,7 @@ def begin_export_request_rate_by_interval( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -149,7 +149,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -166,11 +171,11 @@ def get_long_running_output(pipeline_response): def _export_throttled_requests_initial( self, location, # type: str - parameters, # type: "models.LogAnalyticsInputBase" + parameters, # type: "_models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> Optional["models.LogAnalyticsOperationResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + # type: (...) -> Optional["_models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,10 +225,10 @@ def _export_throttled_requests_initial( def begin_export_throttled_requests( self, location, # type: str - parameters, # type: "models.LogAnalyticsInputBase" + parameters, # type: "_models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] + # type: (...) -> LROPoller["_models.LogAnalyticsOperationResult"] """Export logs that show total throttled Api requests for this subscription in the given time window. @@ -242,7 +247,7 @@ def begin_export_throttled_requests( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -266,7 +271,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_operations.py index f1080b39b1bb..e411d15b5093 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ComputeOperationListResult"] + # type: (...) -> Iterable["_models.ComputeOperationListResult"] """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_10_01.models.ComputeOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeOperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_proximity_placement_groups_operations.py index accc5d95ccbb..1f40b0cf3b8f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_proximity_placement_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ProximityPlacementGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str proximity_placement_group_name, # type: str - parameters, # type: "models.ProximityPlacementGroup" + parameters, # type: "_models.ProximityPlacementGroup" **kwargs # type: Any ): - # type: (...) -> "models.ProximityPlacementGroup" + # type: (...) -> "_models.ProximityPlacementGroup" """Create or update a proximity placement group. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~azure.mgmt.compute.v2018_10_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,10 +120,10 @@ def update( self, resource_group_name, # type: str proximity_placement_group_name, # type: str - parameters, # type: "models.UpdateResource" + parameters, # type: "_models.UpdateResource" **kwargs # type: Any ): - # type: (...) -> "models.ProximityPlacementGroup" + # type: (...) -> "_models.ProximityPlacementGroup" """Update a proximity placement group. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def update( :rtype: ~azure.mgmt.compute.v2018_10_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -243,7 +243,7 @@ def get( proximity_placement_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ProximityPlacementGroup" + # type: (...) -> "_models.ProximityPlacementGroup" """Retrieves information about a proximity placement group . :param resource_group_name: The name of the resource group. @@ -255,7 +255,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_10_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -300,7 +300,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProximityPlacementGroupListResult"] + # type: (...) -> Iterable["_models.ProximityPlacementGroupListResult"] """Lists all proximity placement groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -308,7 +308,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_10_01.models.ProximityPlacementGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -368,7 +368,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProximityPlacementGroupListResult"] + # type: (...) -> Iterable["_models.ProximityPlacementGroupListResult"] """Lists all proximity placement groups in a resource group. :param resource_group_name: The name of the resource group. @@ -378,7 +378,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_10_01.models.ProximityPlacementGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_usage_operations.py index 5d6fe5e2c872..27c7fa81f96e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsageOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListUsagesResult"] + # type: (...) -> Iterable["_models.ListUsagesResult"] """Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_10_01.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extension_images_operations.py index 40c2fad89868..ac4f20dc7d1f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extension_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VirtualMachineExtensionImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( version, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtensionImage" + # type: (...) -> "_models.VirtualMachineExtensionImage" """Gets a virtual machine extension image. :param location: The name of a supported Azure region. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineExtensionImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def list_types( publisher_name, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineExtensionImage"] + # type: (...) -> List["_models.VirtualMachineExtensionImage"] """Gets a list of virtual machine extension image types. :param location: The name of a supported Azure region. @@ -129,7 +129,7 @@ def list_types( :rtype: list[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -180,7 +180,7 @@ def list_versions( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineExtensionImage"] + # type: (...) -> List["_models.VirtualMachineExtensionImage"] """Gets a list of virtual machine extension image versions. :param location: The name of a supported Azure region. @@ -200,7 +200,7 @@ def list_versions( :rtype: list[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extensions_operations.py index 1a325df7b837..e47e72d91fe3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VirtualMachineExtensionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineExtension"] """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -183,11 +190,11 @@ def _update_initial( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -239,10 +246,10 @@ def begin_update( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineExtension"] """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -265,7 +272,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -291,7 +298,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -399,7 +413,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -421,7 +442,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" + # type: (...) -> "_models.VirtualMachineExtension" """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -437,7 +458,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,7 +509,7 @@ def list( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtensionsListResult" + # type: (...) -> "_models.VirtualMachineExtensionsListResult" """The operation to get all extensions of a Virtual Machine. :param resource_group_name: The name of the resource group. @@ -502,7 +523,7 @@ def list( :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineExtensionsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_images_operations.py index df22bb019679..12cc86e0d287 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VirtualMachineImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( version, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineImage" + # type: (...) -> "_models.VirtualMachineImage" """Gets a virtual machine image. :param location: The name of a supported Azure region. @@ -71,7 +71,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -126,7 +126,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. @@ -149,7 +149,7 @@ def list( :rtype: list[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -204,7 +204,7 @@ def list_offers( publisher_name, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image offers for the specified location and publisher. :param location: The name of a supported Azure region. @@ -216,7 +216,7 @@ def list_offers( :rtype: list[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,7 +262,7 @@ def list_publishers( location, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image publishers for the specified Azure location. :param location: The name of a supported Azure region. @@ -272,7 +272,7 @@ def list_publishers( :rtype: list[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -319,7 +319,7 @@ def list_skus( offer, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. :param location: The name of a supported Azure region. @@ -333,7 +333,7 @@ def list_skus( :rtype: list[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_run_commands_operations.py index ff4366ce73de..47d24f7f49f7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_run_commands_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VirtualMachineRunCommandsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RunCommandListResult"] + # type: (...) -> Iterable["_models.RunCommandListResult"] """Lists all available run commands for a subscription in a location. :param location: The location upon which run commands is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_10_01.models.RunCommandListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def get( command_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RunCommandDocument" + # type: (...) -> "_models.RunCommandDocument" """Gets specific run command for a subscription in a location. :param location: The location upon which run commands is queried. @@ -134,7 +134,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_10_01.models.RunCommandDocument :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandDocument"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_extensions_operations.py index 7b23ba32142d..ccb6f54d34c1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetExtensionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str vm_scale_set_name, # type: str vmss_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineScaleSetExtension" + extension_parameters, # type: "_models.VirtualMachineScaleSetExtension" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + # type: (...) -> "_models.VirtualMachineScaleSetExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def begin_create_or_update( resource_group_name, # type: str vm_scale_set_name, # type: str vmss_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineScaleSetExtension" + extension_parameters, # type: "_models.VirtualMachineScaleSetExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSetExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSetExtension"] """The operation to create or update an extension. :param resource_group_name: The name of the resource group. @@ -139,7 +139,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -165,7 +165,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -273,7 +280,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -295,7 +309,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetExtension" + # type: (...) -> "_models.VirtualMachineScaleSetExtension" """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -311,7 +325,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSetExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -361,7 +375,7 @@ def list( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetExtensionListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetExtensionListResult"] """Gets a list of all extensions in a VM scale set. :param resource_group_name: The name of the resource group. @@ -373,7 +387,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSetExtensionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtensionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 24f9747c374b..91b81569953e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VirtualMachineScaleSetRollingUpgradesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -134,7 +134,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -238,7 +244,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -342,7 +354,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -362,7 +380,7 @@ def get_latest( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RollingUpgradeStatusInfo" + # type: (...) -> "_models.RollingUpgradeStatusInfo" """Gets the status of the latest virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -374,7 +392,7 @@ def get_latest( :rtype: ~azure.mgmt.compute.v2018_10_01.models.RollingUpgradeStatusInfo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RollingUpgradeStatusInfo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_vms_operations.py index 59c9cb68b092..d65f5015b17a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetVMsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def _reimage_initial( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - vm_scale_set_vm_reimage_input=None, # type: Optional["models.VirtualMachineReimageParameters"] + vm_scale_set_vm_reimage_input=None, # type: Optional["_models.VirtualMachineReimageParameters"] **kwargs # type: Any ): # type: (...) -> None @@ -106,7 +106,7 @@ def begin_reimage( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - vm_scale_set_vm_reimage_input=None, # type: Optional["models.VirtualMachineReimageParameters"] + vm_scale_set_vm_reimage_input=None, # type: Optional["_models.VirtualMachineReimageParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -154,7 +154,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -263,7 +270,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -373,7 +387,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -392,11 +413,11 @@ def _update_initial( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.VirtualMachineScaleSetVM" + parameters, # type: "_models.VirtualMachineScaleSetVM" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVM" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + # type: (...) -> "_models.VirtualMachineScaleSetVM" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -452,10 +473,10 @@ def begin_update( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.VirtualMachineScaleSetVM" + parameters, # type: "_models.VirtualMachineScaleSetVM" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSetVM"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSetVM"] """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. @@ -478,7 +499,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -504,7 +525,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -612,7 +640,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -633,7 +668,7 @@ def get( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVM" + # type: (...) -> "_models.VirtualMachineScaleSetVM" """Gets a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -647,7 +682,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSetVM :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -696,7 +731,7 @@ def get_instance_view( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVMInstanceView" + # type: (...) -> "_models.VirtualMachineScaleSetVMInstanceView" """Gets the status of a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -710,7 +745,7 @@ def get_instance_view( :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSetVMInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -761,7 +796,7 @@ def list( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetVMListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetVMListResult"] """Gets a list of all virtual machines in a VM scale sets. :param resource_group_name: The name of the resource group. @@ -782,7 +817,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSetVMListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -941,7 +976,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1049,7 +1091,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1157,7 +1206,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1266,7 +1322,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1374,7 +1437,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1393,11 +1463,11 @@ def _run_command_initial( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> Optional["models.RunCommandResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + # type: (...) -> Optional["_models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1451,10 +1521,10 @@ def begin_run_command( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RunCommandResult"] + # type: (...) -> LROPoller["_models.RunCommandResult"] """Run command on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1476,7 +1546,7 @@ def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1502,7 +1572,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_sets_operations.py index 7f6333ce1013..2d5e7f9a074a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSet" + parameters, # type: "_models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + # type: (...) -> "_models.VirtualMachineScaleSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSet" + parameters, # type: "_models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSet"] """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -175,11 +181,11 @@ def _update_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSetUpdate" + parameters, # type: "_models.VirtualMachineScaleSetUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + # type: (...) -> "_models.VirtualMachineScaleSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -229,10 +235,10 @@ def begin_update( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSetUpdate" + parameters, # type: "_models.VirtualMachineScaleSetUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSet"] """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -379,7 +391,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -399,7 +417,7 @@ def get( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" + # type: (...) -> "_models.VirtualMachineScaleSet" """Display information about a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -411,7 +429,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -456,7 +474,7 @@ def _deallocate_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -508,7 +526,7 @@ def begin_deallocate( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -555,7 +573,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -573,7 +597,7 @@ def _delete_instances_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): # type: (...) -> None @@ -622,7 +646,7 @@ def begin_delete_instances( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -667,7 +691,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -687,7 +717,7 @@ def get_instance_view( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetInstanceView" + # type: (...) -> "_models.VirtualMachineScaleSetInstanceView" """Gets the status of a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -699,7 +729,7 @@ def get_instance_view( :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSetInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -745,7 +775,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListResult"] """Gets a list of all VM scale sets under a resource group. :param resource_group_name: The name of the resource group. @@ -755,7 +785,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -815,7 +845,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListWithLinkResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListWithLinkResult"] """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. @@ -825,7 +855,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSetListWithLinkResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListWithLinkResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -886,7 +916,7 @@ def list_skus( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListSkusResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListSkusResult"] """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. @@ -899,7 +929,7 @@ def list_skus( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSetListSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -962,7 +992,7 @@ def get_os_upgrade_history( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListOSUpgradeHistory"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListOSUpgradeHistory"] """Gets list of OS upgrades on a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -974,7 +1004,7 @@ def get_os_upgrade_history( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineScaleSetListOSUpgradeHistory] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListOSUpgradeHistory"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1035,7 +1065,7 @@ def _power_off_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1087,7 +1117,7 @@ def begin_power_off( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1134,7 +1164,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1152,7 +1188,7 @@ def _restart_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1204,7 +1240,7 @@ def begin_restart( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1249,7 +1285,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1267,7 +1309,7 @@ def _start_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1319,7 +1361,7 @@ def begin_start( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1364,7 +1406,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1382,7 +1430,7 @@ def _redeploy_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1434,7 +1482,7 @@ def begin_redeploy( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1480,7 +1528,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1498,7 +1552,7 @@ def _perform_maintenance_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1550,7 +1604,7 @@ def begin_perform_maintenance( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1598,7 +1652,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1616,7 +1676,7 @@ def _update_instances_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): # type: (...) -> None @@ -1665,7 +1725,7 @@ def begin_update_instances( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1710,7 +1770,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1728,7 +1794,7 @@ def _reimage_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_scale_set_reimage_input=None, # type: Optional["models.VirtualMachineScaleSetReimageParameters"] + vm_scale_set_reimage_input=None, # type: Optional["_models.VirtualMachineScaleSetReimageParameters"] **kwargs # type: Any ): # type: (...) -> None @@ -1780,7 +1846,7 @@ def begin_reimage( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_scale_set_reimage_input=None, # type: Optional["models.VirtualMachineScaleSetReimageParameters"] + vm_scale_set_reimage_input=None, # type: Optional["_models.VirtualMachineScaleSetReimageParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1827,7 +1893,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1845,7 +1917,7 @@ def _reimage_all_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1897,7 +1969,7 @@ def begin_reimage_all( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1943,7 +2015,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1964,7 +2042,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( platform_update_domain, # type: int **kwargs # type: Any ): - # type: (...) -> "models.RecoveryWalkResponse" + # type: (...) -> "_models.RecoveryWalkResponse" """Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. @@ -1980,7 +2058,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( :rtype: ~azure.mgmt.compute.v2018_10_01.models.RecoveryWalkResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryWalkResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_sizes_operations.py index e1240d66bcff..2b8400fdcccf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_sizes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VirtualMachineSizesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """This API is deprecated. Use `Resources Skus `_. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machines_operations.py index c658772bb82c..d7706e863e83 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machines_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachinesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list_by_location( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Gets all the virtual machines under the specified subscription for the specified location. :param location: The location for which virtual machines under the subscription are queried. @@ -62,7 +62,7 @@ def list_by_location( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,11 +122,11 @@ def _capture_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineCaptureParameters" + parameters, # type: "_models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualMachineCaptureResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + # type: (...) -> Optional["_models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualMachineCaptureResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -178,10 +178,10 @@ def begin_capture( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineCaptureParameters" + parameters, # type: "_models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineCaptureResult"] + # type: (...) -> LROPoller["_models.VirtualMachineCaptureResult"] """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -202,7 +202,7 @@ def begin_capture( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -227,7 +227,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -245,11 +251,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachine" + parameters, # type: "_models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + # type: (...) -> "_models.VirtualMachine" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,10 +309,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachine" + parameters, # type: "_models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachine"] + # type: (...) -> LROPoller["_models.VirtualMachine"] """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -326,7 +332,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +357,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -369,11 +381,11 @@ def _update_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineUpdate" + parameters, # type: "_models.VirtualMachineUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + # type: (...) -> "_models.VirtualMachine" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -427,10 +439,10 @@ def begin_update( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineUpdate" + parameters, # type: "_models.VirtualMachineUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachine"] + # type: (...) -> LROPoller["_models.VirtualMachine"] """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -450,7 +462,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -475,7 +487,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -577,7 +595,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -598,7 +622,7 @@ def get( expand="instanceView", # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" + # type: (...) -> "_models.VirtualMachine" """Retrieves information about the model view or the instance view of a virtual machine. :param resource_group_name: The name of the resource group. @@ -612,7 +636,7 @@ def get( :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachine :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -661,7 +685,7 @@ def instance_view( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineInstanceView" + # type: (...) -> "_models.VirtualMachineInstanceView" """Retrieves information about the run-time state of a virtual machine. :param resource_group_name: The name of the resource group. @@ -673,7 +697,7 @@ def instance_view( :rtype: ~azure.mgmt.compute.v2018_10_01.models.VirtualMachineInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -803,7 +827,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -906,7 +936,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -979,7 +1015,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. @@ -990,7 +1026,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1050,7 +1086,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. @@ -1059,7 +1095,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1120,7 +1156,7 @@ def list_available_sizes( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes to which the specified virtual machine can be resized. @@ -1133,7 +1169,7 @@ def list_available_sizes( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2018_10_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1279,7 +1315,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1381,7 +1423,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1483,7 +1531,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1585,7 +1639,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1603,7 +1663,7 @@ def _reimage_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters=None, # type: Optional["models.VirtualMachineReimageParameters"] + parameters=None, # type: Optional["_models.VirtualMachineReimageParameters"] **kwargs # type: Any ): # type: (...) -> None @@ -1655,7 +1715,7 @@ def begin_reimage( self, resource_group_name, # type: str vm_name, # type: str - parameters=None, # type: Optional["models.VirtualMachineReimageParameters"] + parameters=None, # type: Optional["_models.VirtualMachineReimageParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1700,7 +1760,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1802,7 +1868,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1820,11 +1892,11 @@ def _run_command_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> Optional["models.RunCommandResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + # type: (...) -> Optional["_models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1876,10 +1948,10 @@ def begin_run_command( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RunCommandResult"] + # type: (...) -> LROPoller["_models.RunCommandResult"] """Run command on the VM. :param resource_group_name: The name of the resource group. @@ -1899,7 +1971,7 @@ def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1924,7 +1996,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_compute_management_client.py index 8bedc447edfc..e2953855e407 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_compute_management_client.py @@ -122,7 +122,6 @@ def __init__( 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( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_metadata.json index 200f58a6fcb6..d0ba101bd3d3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/_compute_management_client.py index f08ee4eeb543..eb0e927e52f0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/_compute_management_client.py @@ -119,7 +119,6 @@ def __init__( 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( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_availability_sets_operations.py index 4e3cc51488c4..afb895b06008 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_availability_sets_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailabilitySetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, availability_set_name: str, - parameters: "models.AvailabilitySet", + parameters: "_models.AvailabilitySet", **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Create or update an availability set. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~azure.mgmt.compute.v2019_03_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,9 +111,9 @@ async def update( self, resource_group_name: str, availability_set_name: str, - parameters: "models.AvailabilitySetUpdate", + parameters: "_models.AvailabilitySetUpdate", **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Update an availability set. :param resource_group_name: The name of the resource group. @@ -127,7 +127,7 @@ async def update( :rtype: ~azure.mgmt.compute.v2019_03_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +231,7 @@ async def get( resource_group_name: str, availability_set_name: str, **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Retrieves information about an availability set. :param resource_group_name: The name of the resource group. @@ -243,7 +243,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,7 +288,7 @@ def list_by_subscription( self, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.AvailabilitySetListResult"]: + ) -> AsyncIterable["_models.AvailabilitySetListResult"]: """Lists all availability sets in a subscription. :param expand: The expand expression to apply to the operation. Allowed values are @@ -299,7 +299,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -360,7 +360,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailabilitySetListResult"]: + ) -> AsyncIterable["_models.AvailabilitySetListResult"]: """Lists all availability sets in a resource group. :param resource_group_name: The name of the resource group. @@ -370,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -431,7 +431,7 @@ def list_available_sizes( resource_group_name: str, availability_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. @@ -444,7 +444,7 @@ def list_available_sizes( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_host_groups_operations.py index bd4fa5965bb5..ca69778c7c9b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_host_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DedicatedHostGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, host_group_name: str, - parameters: "models.DedicatedHostGroup", + parameters: "_models.DedicatedHostGroup", **kwargs - ) -> "models.DedicatedHostGroup": + ) -> "_models.DedicatedHostGroup": """Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,9 +117,9 @@ async def update( self, resource_group_name: str, host_group_name: str, - parameters: "models.DedicatedHostGroupUpdate", + parameters: "_models.DedicatedHostGroupUpdate", **kwargs - ) -> "models.DedicatedHostGroup": + ) -> "_models.DedicatedHostGroup": """Update an dedicated host group. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ async def update( :rtype: ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -237,7 +237,7 @@ async def get( resource_group_name: str, host_group_name: str, **kwargs - ) -> "models.DedicatedHostGroup": + ) -> "_models.DedicatedHostGroup": """Retrieves information about a dedicated host group. :param resource_group_name: The name of the resource group. @@ -249,7 +249,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -294,7 +294,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DedicatedHostGroupListResult"]: + ) -> AsyncIterable["_models.DedicatedHostGroupListResult"]: """Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. @@ -305,7 +305,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.DedicatedHostGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -364,7 +364,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.DedicatedHostGroupListResult"]: + ) -> AsyncIterable["_models.DedicatedHostGroupListResult"]: """Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. @@ -373,7 +373,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.DedicatedHostGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_hosts_operations.py index b71cbdf0986f..89c39fbb06fe 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DedicatedHostsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, host_group_name: str, host_name: str, - parameters: "models.DedicatedHost", + parameters: "_models.DedicatedHost", **kwargs - ) -> "models.DedicatedHost": - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + ) -> "_models.DedicatedHost": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def begin_create_or_update( resource_group_name: str, host_group_name: str, host_name: str, - parameters: "models.DedicatedHost", + parameters: "_models.DedicatedHost", **kwargs - ) -> AsyncLROPoller["models.DedicatedHost"]: + ) -> AsyncLROPoller["_models.DedicatedHost"]: """Create or update a dedicated host . :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -176,10 +183,10 @@ async def _update_initial( resource_group_name: str, host_group_name: str, host_name: str, - parameters: "models.DedicatedHostUpdate", + parameters: "_models.DedicatedHostUpdate", **kwargs - ) -> "models.DedicatedHost": - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + ) -> "_models.DedicatedHost": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,9 +238,9 @@ async def begin_update( resource_group_name: str, host_group_name: str, host_name: str, - parameters: "models.DedicatedHostUpdate", + parameters: "_models.DedicatedHostUpdate", **kwargs - ) -> AsyncLROPoller["models.DedicatedHost"]: + ) -> AsyncLROPoller["_models.DedicatedHost"]: """Update an dedicated host . :param resource_group_name: The name of the resource group. @@ -255,7 +262,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -281,7 +288,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -387,7 +401,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -408,7 +429,7 @@ async def get( host_name: str, expand: Optional[str] = "instanceView", **kwargs - ) -> "models.DedicatedHost": + ) -> "_models.DedicatedHost": """Retrieves information about a dedicated host. :param resource_group_name: The name of the resource group. @@ -424,7 +445,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.DedicatedHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -473,7 +494,7 @@ def list_by_host_group( resource_group_name: str, host_group_name: str, **kwargs - ) -> AsyncIterable["models.DedicatedHostListResult"]: + ) -> AsyncIterable["_models.DedicatedHostListResult"]: """Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. @@ -486,7 +507,7 @@ def list_by_host_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.DedicatedHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_disks_operations.py index 60fcbdf65dc4..d3b3fd7ee633 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_disks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DisksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, disk_name: str, - disk: "models.Disk", + disk: "_models.Disk", **kwargs - ) -> "models.Disk": - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + ) -> "_models.Disk": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, disk_name: str, - disk: "models.Disk", + disk: "_models.Disk", **kwargs - ) -> AsyncLROPoller["models.Disk"]: + ) -> AsyncLROPoller["_models.Disk"]: """Creates or updates a disk. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -171,10 +177,10 @@ async def _update_initial( self, resource_group_name: str, disk_name: str, - disk: "models.DiskUpdate", + disk: "_models.DiskUpdate", **kwargs - ) -> "models.Disk": - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + ) -> "_models.Disk": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,9 +234,9 @@ async def begin_update( self, resource_group_name: str, disk_name: str, - disk: "models.DiskUpdate", + disk: "_models.DiskUpdate", **kwargs - ) -> AsyncLROPoller["models.Disk"]: + ) -> AsyncLROPoller["_models.Disk"]: """Updates (patches) a disk. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -296,7 +308,7 @@ async def get( resource_group_name: str, disk_name: str, **kwargs - ) -> "models.Disk": + ) -> "_models.Disk": """Gets information about a disk. :param resource_group_name: The name of the resource group. @@ -310,7 +322,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.Disk :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -457,7 +475,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DiskList"]: + ) -> AsyncIterable["_models.DiskList"]: """Lists all the disks under a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -526,7 +544,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.DiskList"]: + ) -> AsyncIterable["_models.DiskList"]: """Lists all the disks under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -534,7 +552,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -593,10 +611,10 @@ async def _grant_access_initial( self, resource_group_name: str, disk_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> Optional["models.AccessUri"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + ) -> Optional["_models.AccessUri"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -648,9 +666,9 @@ async def begin_grant_access( self, resource_group_name: str, disk_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> AsyncLROPoller["models.AccessUri"]: + ) -> AsyncLROPoller["_models.AccessUri"]: """Grants access to a disk. :param resource_group_name: The name of the resource group. @@ -673,7 +691,7 @@ async def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -698,7 +716,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -800,7 +824,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_galleries_operations.py index 5f874ce6bd3b..283790222e0a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_galleries_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class GalleriesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gallery_name: str, - gallery: "models.Gallery", + gallery: "_models.Gallery", **kwargs - ) -> "models.Gallery": - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + ) -> "_models.Gallery": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def begin_create_or_update( self, resource_group_name: str, gallery_name: str, - gallery: "models.Gallery", + gallery: "_models.Gallery", **kwargs - ) -> AsyncLROPoller["models.Gallery"]: + ) -> AsyncLROPoller["_models.Gallery"]: """Create or update a Shared Image Gallery. :param resource_group_name: The name of the resource group. @@ -130,7 +130,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -155,7 +155,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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: @@ -174,7 +180,7 @@ async def get( resource_group_name: str, gallery_name: str, **kwargs - ) -> "models.Gallery": + ) -> "_models.Gallery": """Retrieves information about a Shared Image Gallery. :param resource_group_name: The name of the resource group. @@ -186,7 +192,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.Gallery :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -315,7 +321,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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: @@ -333,7 +345,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.GalleryList"]: + ) -> AsyncIterable["_models.GalleryList"]: """List galleries under a resource group. :param resource_group_name: The name of the resource group. @@ -343,7 +355,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.GalleryList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -402,7 +414,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.GalleryList"]: + ) -> AsyncIterable["_models.GalleryList"]: """List galleries under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -410,7 +422,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.GalleryList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_application_versions_operations.py index 92ac5c3933a8..d9a5bd8d7dbb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_application_versions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class GalleryApplicationVersionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,10 +49,10 @@ async def _create_or_update_initial( gallery_name: str, gallery_application_name: str, gallery_application_version_name: str, - gallery_application_version: "models.GalleryApplicationVersion", + gallery_application_version: "_models.GalleryApplicationVersion", **kwargs - ) -> "models.GalleryApplicationVersion": - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] + ) -> "_models.GalleryApplicationVersion": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,9 +113,9 @@ async def begin_create_or_update( gallery_name: str, gallery_application_name: str, gallery_application_version_name: str, - gallery_application_version: "models.GalleryApplicationVersion", + gallery_application_version: "_models.GalleryApplicationVersion", **kwargs - ) -> AsyncLROPoller["models.GalleryApplicationVersion"]: + ) -> AsyncLROPoller["_models.GalleryApplicationVersion"]: """Create or update a gallery Application Version. :param resource_group_name: The name of the resource group. @@ -145,7 +145,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -172,7 +172,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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: @@ -192,9 +200,9 @@ async def get( gallery_name: str, gallery_application_name: str, gallery_application_version_name: str, - expand: Optional[Union[str, "models.ReplicationStatusTypes"]] = None, + expand: Optional[Union[str, "_models.ReplicationStatusTypes"]] = None, **kwargs - ) -> "models.GalleryApplicationVersion": + ) -> "_models.GalleryApplicationVersion": """Retrieves information about a gallery Application Version. :param resource_group_name: The name of the resource group. @@ -215,7 +223,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.GalleryApplicationVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -363,7 +371,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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: @@ -383,7 +399,7 @@ def list_by_gallery_application( gallery_name: str, gallery_application_name: str, **kwargs - ) -> AsyncIterable["models.GalleryApplicationVersionList"]: + ) -> AsyncIterable["_models.GalleryApplicationVersionList"]: """List gallery Application Versions in a gallery Application Definition. :param resource_group_name: The name of the resource group. @@ -399,7 +415,7 @@ def list_by_gallery_application( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.GalleryApplicationVersionList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_applications_operations.py index 78e5136800ca..78e428b2ba0d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_applications_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class GalleryApplicationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, gallery_name: str, gallery_application_name: str, - gallery_application: "models.GalleryApplication", + gallery_application: "_models.GalleryApplication", **kwargs - ) -> "models.GalleryApplication": - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] + ) -> "_models.GalleryApplication": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,9 +110,9 @@ async def begin_create_or_update( resource_group_name: str, gallery_name: str, gallery_application_name: str, - gallery_application: "models.GalleryApplication", + gallery_application: "_models.GalleryApplication", **kwargs - ) -> AsyncLROPoller["models.GalleryApplication"]: + ) -> AsyncLROPoller["_models.GalleryApplication"]: """Create or update a gallery Application Definition. :param resource_group_name: The name of the resource group. @@ -138,7 +138,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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: @@ -184,7 +191,7 @@ async def get( gallery_name: str, gallery_application_name: str, **kwargs - ) -> "models.GalleryApplication": + ) -> "_models.GalleryApplication": """Retrieves information about a gallery Application Definition. :param resource_group_name: The name of the resource group. @@ -200,7 +207,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.GalleryApplication :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -337,7 +344,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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: @@ -356,7 +370,7 @@ def list_by_gallery( resource_group_name: str, gallery_name: str, **kwargs - ) -> AsyncIterable["models.GalleryApplicationList"]: + ) -> AsyncIterable["_models.GalleryApplicationList"]: """List gallery Application Definitions in a gallery. :param resource_group_name: The name of the resource group. @@ -369,7 +383,7 @@ def list_by_gallery( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.GalleryApplicationList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_image_versions_operations.py index d7a4df3d570d..85c5503db7d8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_image_versions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class GalleryImageVersionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,10 +49,10 @@ async def _create_or_update_initial( gallery_name: str, gallery_image_name: str, gallery_image_version_name: str, - gallery_image_version: "models.GalleryImageVersion", + gallery_image_version: "_models.GalleryImageVersion", **kwargs - ) -> "models.GalleryImageVersion": - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + ) -> "_models.GalleryImageVersion": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,9 +113,9 @@ async def begin_create_or_update( gallery_name: str, gallery_image_name: str, gallery_image_version_name: str, - gallery_image_version: "models.GalleryImageVersion", + gallery_image_version: "_models.GalleryImageVersion", **kwargs - ) -> AsyncLROPoller["models.GalleryImageVersion"]: + ) -> AsyncLROPoller["_models.GalleryImageVersion"]: """Create or update a gallery Image Version. :param resource_group_name: The name of the resource group. @@ -145,7 +145,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -172,7 +172,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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: @@ -192,9 +200,9 @@ async def get( gallery_name: str, gallery_image_name: str, gallery_image_version_name: str, - expand: Optional[Union[str, "models.ReplicationStatusTypes"]] = None, + expand: Optional[Union[str, "_models.ReplicationStatusTypes"]] = None, **kwargs - ) -> "models.GalleryImageVersion": + ) -> "_models.GalleryImageVersion": """Retrieves information about a gallery Image Version. :param resource_group_name: The name of the resource group. @@ -214,7 +222,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.GalleryImageVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -361,7 +369,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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: @@ -381,7 +397,7 @@ def list_by_gallery_image( gallery_name: str, gallery_image_name: str, **kwargs - ) -> AsyncIterable["models.GalleryImageVersionList"]: + ) -> AsyncIterable["_models.GalleryImageVersionList"]: """List gallery Image Versions in a gallery Image Definition. :param resource_group_name: The name of the resource group. @@ -397,7 +413,7 @@ def list_by_gallery_image( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.GalleryImageVersionList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_images_operations.py index c0c124b27729..f0125610b99b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class GalleryImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, gallery_name: str, gallery_image_name: str, - gallery_image: "models.GalleryImage", + gallery_image: "_models.GalleryImage", **kwargs - ) -> "models.GalleryImage": - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + ) -> "_models.GalleryImage": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,9 +110,9 @@ async def begin_create_or_update( resource_group_name: str, gallery_name: str, gallery_image_name: str, - gallery_image: "models.GalleryImage", + gallery_image: "_models.GalleryImage", **kwargs - ) -> AsyncLROPoller["models.GalleryImage"]: + ) -> AsyncLROPoller["_models.GalleryImage"]: """Create or update a gallery Image Definition. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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: @@ -183,7 +190,7 @@ async def get( gallery_name: str, gallery_image_name: str, **kwargs - ) -> "models.GalleryImage": + ) -> "_models.GalleryImage": """Retrieves information about a gallery Image Definition. :param resource_group_name: The name of the resource group. @@ -198,7 +205,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.GalleryImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -335,7 +342,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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: @@ -354,7 +368,7 @@ def list_by_gallery( resource_group_name: str, gallery_name: str, **kwargs - ) -> AsyncIterable["models.GalleryImageList"]: + ) -> AsyncIterable["_models.GalleryImageList"]: """List gallery Image Definitions in a gallery. :param resource_group_name: The name of the resource group. @@ -367,7 +381,7 @@ def list_by_gallery( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.GalleryImageList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_images_operations.py index fb1f1a855449..f0b484574c3a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, image_name: str, - parameters: "models.Image", + parameters: "_models.Image", **kwargs - ) -> "models.Image": - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + ) -> "_models.Image": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, image_name: str, - parameters: "models.Image", + parameters: "_models.Image", **kwargs - ) -> AsyncLROPoller["models.Image"]: + ) -> AsyncLROPoller["_models.Image"]: """Create or update an image. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -169,10 +175,10 @@ async def _update_initial( self, resource_group_name: str, image_name: str, - parameters: "models.ImageUpdate", + parameters: "_models.ImageUpdate", **kwargs - ) -> "models.Image": - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + ) -> "_models.Image": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -226,9 +232,9 @@ async def begin_update( self, resource_group_name: str, image_name: str, - parameters: "models.ImageUpdate", + parameters: "_models.ImageUpdate", **kwargs - ) -> AsyncLROPoller["models.Image"]: + ) -> AsyncLROPoller["_models.Image"]: """Update an image. :param resource_group_name: The name of the resource group. @@ -248,7 +254,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -273,7 +279,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -373,7 +385,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -393,7 +411,7 @@ async def get( image_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Image": + ) -> "_models.Image": """Gets an image. :param resource_group_name: The name of the resource group. @@ -407,7 +425,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.Image :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -454,7 +472,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ImageListResult"]: + ) -> AsyncIterable["_models.ImageListResult"]: """Gets the list of images under a resource group. :param resource_group_name: The name of the resource group. @@ -464,7 +482,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ImageListResult"]: + ) -> AsyncIterable["_models.ImageListResult"]: """Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. @@ -532,7 +550,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_log_analytics_operations.py index 579ea451f06a..8de353fa24cc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_log_analytics_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class LogAnalyticsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,10 +45,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def _export_request_rate_by_interval_initial( self, location: str, - parameters: "models.RequestRateByIntervalInput", + parameters: "_models.RequestRateByIntervalInput", **kwargs - ) -> Optional["models.LogAnalyticsOperationResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + ) -> Optional["_models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -98,9 +98,9 @@ async def _export_request_rate_by_interval_initial( async def begin_export_request_rate_by_interval( self, location: str, - parameters: "models.RequestRateByIntervalInput", + parameters: "_models.RequestRateByIntervalInput", **kwargs - ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: + ) -> AsyncLROPoller["_models.LogAnalyticsOperationResult"]: """Export logs that show Api requests made by this subscription in the given time window to show throttling activities. @@ -119,7 +119,7 @@ async def begin_export_request_rate_by_interval( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -143,7 +143,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -160,10 +165,10 @@ def get_long_running_output(pipeline_response): async def _export_throttled_requests_initial( self, location: str, - parameters: "models.LogAnalyticsInputBase", + parameters: "_models.LogAnalyticsInputBase", **kwargs - ) -> Optional["models.LogAnalyticsOperationResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + ) -> Optional["_models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -213,9 +218,9 @@ async def _export_throttled_requests_initial( async def begin_export_throttled_requests( self, location: str, - parameters: "models.LogAnalyticsInputBase", + parameters: "_models.LogAnalyticsInputBase", **kwargs - ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: + ) -> AsyncLROPoller["_models.LogAnalyticsOperationResult"]: """Export logs that show total throttled Api requests for this subscription in the given time window. @@ -234,7 +239,7 @@ async def begin_export_throttled_requests( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -258,7 +263,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_operations.py index 46c9997c0a95..6b25f21555e8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ComputeOperationListResult"]: + ) -> AsyncIterable["_models.ComputeOperationListResult"]: """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.ComputeOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeOperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_proximity_placement_groups_operations.py index 4bf92c35f3cd..47420d2b3dd3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_proximity_placement_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ProximityPlacementGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, proximity_placement_group_name: str, - parameters: "models.ProximityPlacementGroup", + parameters: "_models.ProximityPlacementGroup", **kwargs - ) -> "models.ProximityPlacementGroup": + ) -> "_models.ProximityPlacementGroup": """Create or update a proximity placement group. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~azure.mgmt.compute.v2019_03_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,9 +115,9 @@ async def update( self, resource_group_name: str, proximity_placement_group_name: str, - parameters: "models.UpdateResource", + parameters: "_models.UpdateResource", **kwargs - ) -> "models.ProximityPlacementGroup": + ) -> "_models.ProximityPlacementGroup": """Update a proximity placement group. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def update( :rtype: ~azure.mgmt.compute.v2019_03_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,7 +235,7 @@ async def get( resource_group_name: str, proximity_placement_group_name: str, **kwargs - ) -> "models.ProximityPlacementGroup": + ) -> "_models.ProximityPlacementGroup": """Retrieves information about a proximity placement group . :param resource_group_name: The name of the resource group. @@ -247,7 +247,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -291,7 +291,7 @@ async def get( def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.ProximityPlacementGroupListResult"]: + ) -> AsyncIterable["_models.ProximityPlacementGroupListResult"]: """Lists all proximity placement groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -299,7 +299,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.ProximityPlacementGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -358,7 +358,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ProximityPlacementGroupListResult"]: + ) -> AsyncIterable["_models.ProximityPlacementGroupListResult"]: """Lists all proximity placement groups in a resource group. :param resource_group_name: The name of the resource group. @@ -368,7 +368,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.ProximityPlacementGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_snapshots_operations.py index 414729a2b958..1f4884ee2a42 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_snapshots_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SnapshotsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.Snapshot", + snapshot: "_models.Snapshot", **kwargs - ) -> "models.Snapshot": - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + ) -> "_models.Snapshot": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.Snapshot", + snapshot: "_models.Snapshot", **kwargs - ) -> AsyncLROPoller["models.Snapshot"]: + ) -> AsyncLROPoller["_models.Snapshot"]: """Creates or updates a snapshot. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -171,10 +177,10 @@ async def _update_initial( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.SnapshotUpdate", + snapshot: "_models.SnapshotUpdate", **kwargs - ) -> "models.Snapshot": - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + ) -> "_models.Snapshot": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,9 +234,9 @@ async def begin_update( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.SnapshotUpdate", + snapshot: "_models.SnapshotUpdate", **kwargs - ) -> AsyncLROPoller["models.Snapshot"]: + ) -> AsyncLROPoller["_models.Snapshot"]: """Updates (patches) a snapshot. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -296,7 +308,7 @@ async def get( resource_group_name: str, snapshot_name: str, **kwargs - ) -> "models.Snapshot": + ) -> "_models.Snapshot": """Gets information about a snapshot. :param resource_group_name: The name of the resource group. @@ -310,7 +322,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.Snapshot :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -457,7 +475,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.SnapshotList"]: + ) -> AsyncIterable["_models.SnapshotList"]: """Lists snapshots under a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -526,7 +544,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.SnapshotList"]: + ) -> AsyncIterable["_models.SnapshotList"]: """Lists snapshots under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -534,7 +552,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -593,10 +611,10 @@ async def _grant_access_initial( self, resource_group_name: str, snapshot_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> Optional["models.AccessUri"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + ) -> Optional["_models.AccessUri"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -648,9 +666,9 @@ async def begin_grant_access( self, resource_group_name: str, snapshot_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> AsyncLROPoller["models.AccessUri"]: + ) -> AsyncLROPoller["_models.AccessUri"]: """Grants access to a snapshot. :param resource_group_name: The name of the resource group. @@ -673,7 +691,7 @@ async def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -698,7 +716,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -800,7 +824,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_usage_operations.py index 98fc3768a969..d2c22bc28738 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsageOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.ListUsagesResult"]: + ) -> AsyncIterable["_models.ListUsagesResult"]: """Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extension_images_operations.py index 7b7f747ee111..f2ab0485f69d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VirtualMachineExtensionImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( type: str, version: str, **kwargs - ) -> "models.VirtualMachineExtensionImage": + ) -> "_models.VirtualMachineExtensionImage": """Gets a virtual machine extension image. :param location: The name of a supported Azure region. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineExtensionImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,7 +111,7 @@ async def list_types( location: str, publisher_name: str, **kwargs - ) -> List["models.VirtualMachineExtensionImage"]: + ) -> List["_models.VirtualMachineExtensionImage"]: """Gets a list of virtual machine extension image types. :param location: The name of a supported Azure region. @@ -123,7 +123,7 @@ async def list_types( :rtype: list[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -173,7 +173,7 @@ async def list_versions( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> List["models.VirtualMachineExtensionImage"]: + ) -> List["_models.VirtualMachineExtensionImage"]: """Gets a list of virtual machine extension image versions. :param location: The name of a supported Azure region. @@ -193,7 +193,7 @@ async def list_versions( :rtype: list[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extensions_operations.py index 06362359247b..912b1ff0802d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VirtualMachineExtensionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineExtension", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineExtension", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineExtension"]: """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -177,10 +184,10 @@ async def _update_initial( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineExtensionUpdate", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -232,9 +239,9 @@ async def begin_update( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineExtensionUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineExtension"]: """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -257,7 +264,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -283,7 +290,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -389,7 +403,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -410,7 +431,7 @@ async def get( vm_extension_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtension": + ) -> "_models.VirtualMachineExtension": """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -426,7 +447,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +497,7 @@ async def list( vm_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtensionsListResult": + ) -> "_models.VirtualMachineExtensionsListResult": """The operation to get all extensions of a Virtual Machine. :param resource_group_name: The name of the resource group. @@ -490,7 +511,7 @@ async def list( :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineExtensionsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_images_operations.py index 9304f8880991..578c8ce248b2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VirtualMachineImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( skus: str, version: str, **kwargs - ) -> "models.VirtualMachineImage": + ) -> "_models.VirtualMachineImage": """Gets a virtual machine image. :param location: The name of a supported Azure region. @@ -66,7 +66,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,7 +120,7 @@ async def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. @@ -143,7 +143,7 @@ async def list( :rtype: list[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -197,7 +197,7 @@ async def list_offers( location: str, publisher_name: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image offers for the specified location and publisher. :param location: The name of a supported Azure region. @@ -209,7 +209,7 @@ async def list_offers( :rtype: list[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -254,7 +254,7 @@ async def list_publishers( self, location: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image publishers for the specified Azure location. :param location: The name of a supported Azure region. @@ -264,7 +264,7 @@ async def list_publishers( :rtype: list[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -310,7 +310,7 @@ async def list_skus( publisher_name: str, offer: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. :param location: The name of a supported Azure region. @@ -324,7 +324,7 @@ async def list_skus( :rtype: list[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_run_commands_operations.py index 396e88e877dc..67b4a321240c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VirtualMachineRunCommandsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.RunCommandListResult"]: + ) -> AsyncIterable["_models.RunCommandListResult"]: """Lists all available run commands for a subscription in a location. :param location: The location upon which run commands is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.RunCommandListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ async def get( location: str, command_id: str, **kwargs - ) -> "models.RunCommandDocument": + ) -> "_models.RunCommandDocument": """Gets specific run command for a subscription in a location. :param location: The location upon which run commands is queried. @@ -128,7 +128,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.RunCommandDocument :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandDocument"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index e5a0faf8dac7..aff65b288d9b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetExtensionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, vm_scale_set_name: str, vmss_extension_name: str, - extension_parameters: "models.VirtualMachineScaleSetExtension", + extension_parameters: "_models.VirtualMachineScaleSetExtension", **kwargs - ) -> "models.VirtualMachineScaleSetExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + ) -> "_models.VirtualMachineScaleSetExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def begin_create_or_update( resource_group_name: str, vm_scale_set_name: str, vmss_extension_name: str, - extension_parameters: "models.VirtualMachineScaleSetExtension", + extension_parameters: "_models.VirtualMachineScaleSetExtension", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSetExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSetExtension"]: """The operation to create or update an extension. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -265,7 +272,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -286,7 +300,7 @@ async def get( vmss_extension_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineScaleSetExtension": + ) -> "_models.VirtualMachineScaleSetExtension": """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -302,7 +316,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -351,7 +365,7 @@ def list( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetExtensionListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetExtensionListResult"]: """Gets a list of all extensions in a VM scale set. :param resource_group_name: The name of the resource group. @@ -363,7 +377,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetExtensionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtensionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 662efe15bc4d..f416a4ec1abd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VirtualMachineScaleSetRollingUpgradesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -128,7 +128,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -230,7 +236,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -332,7 +344,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -351,7 +369,7 @@ async def get_latest( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.RollingUpgradeStatusInfo": + ) -> "_models.RollingUpgradeStatusInfo": """Gets the status of the latest virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -363,7 +381,7 @@ async def get_latest( :rtype: ~azure.mgmt.compute.v2019_03_01.models.RollingUpgradeStatusInfo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RollingUpgradeStatusInfo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index cd9092408cdb..3698c42a9e54 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetVMsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def _reimage_initial( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - vm_scale_set_vm_reimage_input: Optional["models.VirtualMachineReimageParameters"] = None, + vm_scale_set_vm_reimage_input: Optional["_models.VirtualMachineReimageParameters"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -101,7 +101,7 @@ async def begin_reimage( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - vm_scale_set_vm_reimage_input: Optional["models.VirtualMachineReimageParameters"] = None, + vm_scale_set_vm_reimage_input: Optional["_models.VirtualMachineReimageParameters"] = None, **kwargs ) -> AsyncLROPoller[None]: """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. @@ -148,7 +148,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -255,7 +262,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -363,7 +377,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -382,10 +403,10 @@ async def _update_initial( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.VirtualMachineScaleSetVM", + parameters: "_models.VirtualMachineScaleSetVM", **kwargs - ) -> "models.VirtualMachineScaleSetVM": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + ) -> "_models.VirtualMachineScaleSetVM": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -441,9 +462,9 @@ async def begin_update( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.VirtualMachineScaleSetVM", + parameters: "_models.VirtualMachineScaleSetVM", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSetVM"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSetVM"]: """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. @@ -466,7 +487,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -492,7 +513,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -598,7 +626,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -619,7 +654,7 @@ async def get( instance_id: str, expand: Optional[str] = "instanceView", **kwargs - ) -> "models.VirtualMachineScaleSetVM": + ) -> "_models.VirtualMachineScaleSetVM": """Gets a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -635,7 +670,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetVM :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -685,7 +720,7 @@ async def get_instance_view( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.VirtualMachineScaleSetVMInstanceView": + ) -> "_models.VirtualMachineScaleSetVMInstanceView": """Gets the status of a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -699,7 +734,7 @@ async def get_instance_view( :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetVMInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -749,7 +784,7 @@ def list( select: Optional[str] = None, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetVMListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetVMListResult"]: """Gets a list of all virtual machines in a VM scale sets. :param resource_group_name: The name of the resource group. @@ -770,7 +805,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetVMListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -936,7 +971,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1042,7 +1084,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1148,7 +1197,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1255,7 +1311,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1361,7 +1424,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1380,10 +1450,10 @@ async def _run_command_initial( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> Optional["models.RunCommandResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + ) -> Optional["_models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1437,9 +1507,9 @@ async def begin_run_command( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> AsyncLROPoller["models.RunCommandResult"]: + ) -> AsyncLROPoller["_models.RunCommandResult"]: """Run command on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1461,7 +1531,7 @@ async def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1487,7 +1557,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_sets_operations.py index 830fc30d80cf..8ac485824de5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSet", + parameters: "_models.VirtualMachineScaleSet", **kwargs - ) -> "models.VirtualMachineScaleSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + ) -> "_models.VirtualMachineScaleSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSet", + parameters: "_models.VirtualMachineScaleSet", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSet"]: """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -169,10 +175,10 @@ async def _update_initial( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSetUpdate", + parameters: "_models.VirtualMachineScaleSetUpdate", **kwargs - ) -> "models.VirtualMachineScaleSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + ) -> "_models.VirtualMachineScaleSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -222,9 +228,9 @@ async def begin_update( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSetUpdate", + parameters: "_models.VirtualMachineScaleSetUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSet"]: """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -244,7 +250,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -269,7 +275,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -369,7 +381,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -388,7 +406,7 @@ async def get( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> "_models.VirtualMachineScaleSet": """Display information about a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -400,7 +418,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -445,7 +463,7 @@ async def _deallocate_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -496,7 +514,7 @@ async def begin_deallocate( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and @@ -542,7 +560,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -560,7 +584,7 @@ async def _delete_instances_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -608,7 +632,7 @@ async def begin_delete_instances( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs ) -> AsyncLROPoller[None]: """Deletes virtual machines in a VM scale set. @@ -652,7 +676,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -671,7 +701,7 @@ async def get_instance_view( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.VirtualMachineScaleSetInstanceView": + ) -> "_models.VirtualMachineScaleSetInstanceView": """Gets the status of a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -683,7 +713,7 @@ async def get_instance_view( :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -728,7 +758,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListResult"]: """Gets a list of all VM scale sets under a resource group. :param resource_group_name: The name of the resource group. @@ -738,7 +768,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -797,7 +827,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListWithLinkResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListWithLinkResult"]: """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. @@ -807,7 +837,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetListWithLinkResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListWithLinkResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -867,7 +897,7 @@ def list_skus( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListSkusResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListSkusResult"]: """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. @@ -880,7 +910,7 @@ def list_skus( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetListSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -942,7 +972,7 @@ def get_os_upgrade_history( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListOSUpgradeHistory"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListOSUpgradeHistory"]: """Gets list of OS upgrades on a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -954,7 +984,7 @@ def get_os_upgrade_history( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetListOSUpgradeHistory] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListOSUpgradeHistory"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1016,7 +1046,7 @@ async def _power_off_initial( resource_group_name: str, vm_scale_set_name: str, skip_shutdown: Optional[bool] = False, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1070,7 +1100,7 @@ async def begin_power_off( resource_group_name: str, vm_scale_set_name: str, skip_shutdown: Optional[bool] = False, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still @@ -1121,7 +1151,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1139,7 +1175,7 @@ async def _restart_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1190,7 +1226,7 @@ async def begin_restart( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Restarts one or more virtual machines in a VM scale set. @@ -1234,7 +1270,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1252,7 +1294,7 @@ async def _start_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1303,7 +1345,7 @@ async def begin_start( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Starts one or more virtual machines in a VM scale set. @@ -1347,7 +1389,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1365,7 +1413,7 @@ async def _redeploy_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1416,7 +1464,7 @@ async def begin_redeploy( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, @@ -1461,7 +1509,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1479,7 +1533,7 @@ async def _perform_maintenance_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1530,7 +1584,7 @@ async def begin_perform_maintenance( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances @@ -1577,7 +1631,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1595,7 +1655,7 @@ async def _update_instances_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1643,7 +1703,7 @@ async def begin_update_instances( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs ) -> AsyncLROPoller[None]: """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. @@ -1687,7 +1747,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1705,7 +1771,7 @@ async def _reimage_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_scale_set_reimage_input: Optional["models.VirtualMachineScaleSetReimageParameters"] = None, + vm_scale_set_reimage_input: Optional["_models.VirtualMachineScaleSetReimageParameters"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1756,7 +1822,7 @@ async def begin_reimage( self, resource_group_name: str, vm_scale_set_name: str, - vm_scale_set_reimage_input: Optional["models.VirtualMachineScaleSetReimageParameters"] = None, + vm_scale_set_reimage_input: Optional["_models.VirtualMachineScaleSetReimageParameters"] = None, **kwargs ) -> AsyncLROPoller[None]: """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which @@ -1802,7 +1868,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1820,7 +1892,7 @@ async def _reimage_all_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1871,7 +1943,7 @@ async def begin_reimage_all( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This @@ -1916,7 +1988,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1936,7 +2014,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( vm_scale_set_name: str, platform_update_domain: int, **kwargs - ) -> "models.RecoveryWalkResponse": + ) -> "_models.RecoveryWalkResponse": """Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. @@ -1952,7 +2030,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( :rtype: ~azure.mgmt.compute.v2019_03_01.models.RecoveryWalkResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryWalkResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1998,10 +2076,10 @@ async def convert_to_single_placement_group( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VMScaleSetConvertToSinglePlacementGroupInput", + parameters: "_models.VMScaleSetConvertToSinglePlacementGroupInput", **kwargs ) -> None: - """Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + """Converts SinglePlacementGroup property to true for a existing virtual machine scale set. :param resource_group_name: The name of the resource group. :type resource_group_name: str diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_sizes_operations.py index e36a1f2ffbd1..cd879f930085 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_sizes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VirtualMachineSizesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """This API is deprecated. Use `Resources Skus `_. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machines_operations.py index 01c1d2d976b6..6b515963bf89 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machines_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachinesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list_by_location( self, location: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Gets all the virtual machines under the specified subscription for the specified location. :param location: The location for which virtual machines under the subscription are queried. @@ -57,7 +57,7 @@ def list_by_location( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,10 +117,10 @@ async def _capture_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineCaptureParameters", + parameters: "_models.VirtualMachineCaptureParameters", **kwargs - ) -> Optional["models.VirtualMachineCaptureResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + ) -> Optional["_models.VirtualMachineCaptureResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualMachineCaptureResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -172,9 +172,9 @@ async def begin_capture( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineCaptureParameters", + parameters: "_models.VirtualMachineCaptureParameters", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineCaptureResult"]: + ) -> AsyncLROPoller["_models.VirtualMachineCaptureResult"]: """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -195,7 +195,7 @@ async def begin_capture( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -220,7 +220,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -238,10 +244,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachine", + parameters: "_models.VirtualMachine", **kwargs - ) -> "models.VirtualMachine": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + ) -> "_models.VirtualMachine": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,9 +301,9 @@ async def begin_create_or_update( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachine", + parameters: "_models.VirtualMachine", **kwargs - ) -> AsyncLROPoller["models.VirtualMachine"]: + ) -> AsyncLROPoller["_models.VirtualMachine"]: """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -317,7 +323,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -342,7 +348,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -360,10 +372,10 @@ async def _update_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineUpdate", + parameters: "_models.VirtualMachineUpdate", **kwargs - ) -> "models.VirtualMachine": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + ) -> "_models.VirtualMachine": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -417,9 +429,9 @@ async def begin_update( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineUpdate", + parameters: "_models.VirtualMachineUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachine"]: + ) -> AsyncLROPoller["_models.VirtualMachine"]: """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -439,7 +451,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -464,7 +476,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -564,7 +582,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -584,7 +608,7 @@ async def get( vm_name: str, expand: Optional[str] = "instanceView", **kwargs - ) -> "models.VirtualMachine": + ) -> "_models.VirtualMachine": """Retrieves information about the model view or the instance view of a virtual machine. :param resource_group_name: The name of the resource group. @@ -598,7 +622,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachine :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -646,7 +670,7 @@ async def instance_view( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.VirtualMachineInstanceView": + ) -> "_models.VirtualMachineInstanceView": """Retrieves information about the run-time state of a virtual machine. :param resource_group_name: The name of the resource group. @@ -658,7 +682,7 @@ async def instance_view( :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -786,7 +810,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -887,7 +917,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -958,7 +994,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. @@ -969,7 +1005,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1028,7 +1064,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. @@ -1037,7 +1073,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1097,7 +1133,7 @@ def list_available_sizes( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes to which the specified virtual machine can be resized. @@ -1110,7 +1146,7 @@ def list_available_sizes( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1263,7 +1299,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1363,7 +1405,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1463,7 +1511,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1563,7 +1617,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1581,7 +1641,7 @@ async def _reimage_initial( self, resource_group_name: str, vm_name: str, - parameters: Optional["models.VirtualMachineReimageParameters"] = None, + parameters: Optional["_models.VirtualMachineReimageParameters"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1632,7 +1692,7 @@ async def begin_reimage( self, resource_group_name: str, vm_name: str, - parameters: Optional["models.VirtualMachineReimageParameters"] = None, + parameters: Optional["_models.VirtualMachineReimageParameters"] = None, **kwargs ) -> AsyncLROPoller[None]: """Reimages the virtual machine which has an ephemeral OS disk back to its initial state. @@ -1676,7 +1736,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1776,7 +1842,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1794,10 +1866,10 @@ async def _run_command_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> Optional["models.RunCommandResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + ) -> Optional["_models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1849,9 +1921,9 @@ async def begin_run_command( self, resource_group_name: str, vm_name: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> AsyncLROPoller["models.RunCommandResult"]: + ) -> AsyncLROPoller["_models.RunCommandResult"]: """Run command on the VM. :param resource_group_name: The name of the resource group. @@ -1871,7 +1943,7 @@ async def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1896,7 +1968,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/__init__.py index 08aac314f388..9cfc43b8bf87 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/__init__.py @@ -22,8 +22,6 @@ from ._models_py3 import BillingProfile from ._models_py3 import BootDiagnostics from ._models_py3 import BootDiagnosticsInstanceView - from ._models_py3 import Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties - from ._models_py3 import ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties from ._models_py3 import ComputeOperationListResult from ._models_py3 import ComputeOperationValue from ._models_py3 import CreationData @@ -147,6 +145,7 @@ from ._models_py3 import Usage from ._models_py3 import UsageName from ._models_py3 import UserArtifactSource + from ._models_py3 import UserAssignedIdentitiesValue from ._models_py3 import VMScaleSetConvertToSinglePlacementGroupInput from ._models_py3 import VaultCertificate from ._models_py3 import VaultSecretGroup @@ -175,6 +174,7 @@ from ._models_py3 import VirtualMachineScaleSetExtensionProfile from ._models_py3 import VirtualMachineScaleSetIPConfiguration from ._models_py3 import VirtualMachineScaleSetIdentity + from ._models_py3 import VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue from ._models_py3 import VirtualMachineScaleSetInstanceView from ._models_py3 import VirtualMachineScaleSetInstanceViewStatusesSummary from ._models_py3 import VirtualMachineScaleSetIpTag @@ -236,8 +236,6 @@ from ._models import BillingProfile # type: ignore from ._models import BootDiagnostics # type: ignore from ._models import BootDiagnosticsInstanceView # type: ignore - from ._models import Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore - from ._models import ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore from ._models import ComputeOperationListResult # type: ignore from ._models import ComputeOperationValue # type: ignore from ._models import CreationData # type: ignore @@ -361,6 +359,7 @@ from ._models import Usage # type: ignore from ._models import UsageName # type: ignore from ._models import UserArtifactSource # type: ignore + from ._models import UserAssignedIdentitiesValue # type: ignore from ._models import VMScaleSetConvertToSinglePlacementGroupInput # type: ignore from ._models import VaultCertificate # type: ignore from ._models import VaultSecretGroup # type: ignore @@ -389,6 +388,7 @@ from ._models import VirtualMachineScaleSetExtensionProfile # type: ignore from ._models import VirtualMachineScaleSetIPConfiguration # type: ignore from ._models import VirtualMachineScaleSetIdentity # type: ignore + from ._models import VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue # type: ignore from ._models import VirtualMachineScaleSetInstanceView # type: ignore from ._models import VirtualMachineScaleSetInstanceViewStatusesSummary # type: ignore from ._models import VirtualMachineScaleSetIpTag # type: ignore @@ -497,8 +497,6 @@ 'BillingProfile', 'BootDiagnostics', 'BootDiagnosticsInstanceView', - 'Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties', - 'ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties', 'ComputeOperationListResult', 'ComputeOperationValue', 'CreationData', @@ -622,6 +620,7 @@ 'Usage', 'UsageName', 'UserArtifactSource', + 'UserAssignedIdentitiesValue', 'VMScaleSetConvertToSinglePlacementGroupInput', 'VaultCertificate', 'VaultSecretGroup', @@ -650,6 +649,7 @@ 'VirtualMachineScaleSetExtensionProfile', 'VirtualMachineScaleSetIPConfiguration', 'VirtualMachineScaleSetIdentity', + 'VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue', 'VirtualMachineScaleSetInstanceView', 'VirtualMachineScaleSetInstanceViewStatusesSummary', 'VirtualMachineScaleSetIpTag', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models.py index 7d62132eebe3..84584b2e26a4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models.py @@ -572,66 +572,6 @@ def __init__( self.status = None -class Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - class ComputeOperationListResult(msrest.serialization.Model): """The List Compute Operation operation response. @@ -5369,6 +5309,36 @@ def __init__( self.media_link = kwargs['media_link'] +class UserAssignedIdentitiesValue(msrest.serialization.Model): + """UserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class VaultCertificate(msrest.serialization.Model): """Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM. @@ -6047,7 +6017,7 @@ class VirtualMachineIdentity(msrest.serialization.Model): Machine. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :type user_assigned_identities: dict[str, - ~azure.mgmt.compute.v2019_03_01.models.Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties] + ~azure.mgmt.compute.v2019_03_01.models.UserAssignedIdentitiesValue] """ _validation = { @@ -6059,7 +6029,7 @@ class VirtualMachineIdentity(msrest.serialization.Model): 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentitiesValue}'}, } def __init__( @@ -6624,7 +6594,7 @@ class VirtualMachineScaleSetIdentity(msrest.serialization.Model): form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :type user_assigned_identities: dict[str, - ~azure.mgmt.compute.v2019_03_01.models.ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties] + ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue] """ _validation = { @@ -6636,7 +6606,7 @@ class VirtualMachineScaleSetIdentity(msrest.serialization.Model): 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue}'}, } def __init__( @@ -6650,6 +6620,36 @@ def __init__( self.user_assigned_identities = kwargs.get('user_assigned_identities', None) +class VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue(msrest.serialization.Model): + """VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class VirtualMachineScaleSetInstanceView(msrest.serialization.Model): """The instance view of a virtual machine scale set. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py index 342029e3ce17..2ef70acccf80 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py @@ -630,66 +630,6 @@ def __init__( self.status = None -class Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - class ComputeOperationListResult(msrest.serialization.Model): """The List Compute Operation operation response. @@ -5876,6 +5816,36 @@ def __init__( self.media_link = media_link +class UserAssignedIdentitiesValue(msrest.serialization.Model): + """UserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class VaultCertificate(msrest.serialization.Model): """Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM. @@ -6632,7 +6602,7 @@ class VirtualMachineIdentity(msrest.serialization.Model): Machine. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :type user_assigned_identities: dict[str, - ~azure.mgmt.compute.v2019_03_01.models.Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties] + ~azure.mgmt.compute.v2019_03_01.models.UserAssignedIdentitiesValue] """ _validation = { @@ -6644,14 +6614,14 @@ class VirtualMachineIdentity(msrest.serialization.Model): 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentitiesValue}'}, } def __init__( self, *, type: Optional[Union[str, "ResourceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, "Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + user_assigned_identities: Optional[Dict[str, "UserAssignedIdentitiesValue"]] = None, **kwargs ): super(VirtualMachineIdentity, self).__init__(**kwargs) @@ -7287,7 +7257,7 @@ class VirtualMachineScaleSetIdentity(msrest.serialization.Model): form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :type user_assigned_identities: dict[str, - ~azure.mgmt.compute.v2019_03_01.models.ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties] + ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue] """ _validation = { @@ -7299,14 +7269,14 @@ class VirtualMachineScaleSetIdentity(msrest.serialization.Model): 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue}'}, } def __init__( self, *, type: Optional[Union[str, "ResourceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, "ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + user_assigned_identities: Optional[Dict[str, "VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue"]] = None, **kwargs ): super(VirtualMachineScaleSetIdentity, self).__init__(**kwargs) @@ -7316,6 +7286,36 @@ def __init__( self.user_assigned_identities = user_assigned_identities +class VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue(msrest.serialization.Model): + """VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class VirtualMachineScaleSetInstanceView(msrest.serialization.Model): """The instance view of a virtual machine scale set. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_availability_sets_operations.py index 528d1c83dacd..68a8172e0d58 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_availability_sets_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailabilitySetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str availability_set_name, # type: str - parameters, # type: "models.AvailabilitySet" + parameters, # type: "_models.AvailabilitySet" **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Create or update an availability set. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~azure.mgmt.compute.v2019_03_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,10 +116,10 @@ def update( self, resource_group_name, # type: str availability_set_name, # type: str - parameters, # type: "models.AvailabilitySetUpdate" + parameters, # type: "_models.AvailabilitySetUpdate" **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Update an availability set. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ def update( :rtype: ~azure.mgmt.compute.v2019_03_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -239,7 +239,7 @@ def get( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Retrieves information about an availability set. :param resource_group_name: The name of the resource group. @@ -251,7 +251,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -297,7 +297,7 @@ def list_by_subscription( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailabilitySetListResult"] + # type: (...) -> Iterable["_models.AvailabilitySetListResult"] """Lists all availability sets in a subscription. :param expand: The expand expression to apply to the operation. Allowed values are @@ -308,7 +308,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -370,7 +370,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailabilitySetListResult"] + # type: (...) -> Iterable["_models.AvailabilitySetListResult"] """Lists all availability sets in a resource group. :param resource_group_name: The name of the resource group. @@ -380,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -442,7 +442,7 @@ def list_available_sizes( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. @@ -455,7 +455,7 @@ def list_available_sizes( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_host_groups_operations.py index 260a08c183ce..4aa308f92ad3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_host_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DedicatedHostGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str host_group_name, # type: str - parameters, # type: "models.DedicatedHostGroup" + parameters, # type: "_models.DedicatedHostGroup" **kwargs # type: Any ): - # type: (...) -> "models.DedicatedHostGroup" + # type: (...) -> "_models.DedicatedHostGroup" """Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,10 +122,10 @@ def update( self, resource_group_name, # type: str host_group_name, # type: str - parameters, # type: "models.DedicatedHostGroupUpdate" + parameters, # type: "_models.DedicatedHostGroupUpdate" **kwargs # type: Any ): - # type: (...) -> "models.DedicatedHostGroup" + # type: (...) -> "_models.DedicatedHostGroup" """Update an dedicated host group. :param resource_group_name: The name of the resource group. @@ -139,7 +139,7 @@ def update( :rtype: ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -245,7 +245,7 @@ def get( host_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DedicatedHostGroup" + # type: (...) -> "_models.DedicatedHostGroup" """Retrieves information about a dedicated host group. :param resource_group_name: The name of the resource group. @@ -257,7 +257,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,7 +303,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DedicatedHostGroupListResult"] + # type: (...) -> Iterable["_models.DedicatedHostGroupListResult"] """Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. @@ -314,7 +314,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.DedicatedHostGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -374,7 +374,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DedicatedHostGroupListResult"] + # type: (...) -> Iterable["_models.DedicatedHostGroupListResult"] """Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. @@ -383,7 +383,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.DedicatedHostGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_hosts_operations.py index 0ecc81dd5914..664e159dc883 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DedicatedHostsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str host_group_name, # type: str host_name, # type: str - parameters, # type: "models.DedicatedHost" + parameters, # type: "_models.DedicatedHost" **kwargs # type: Any ): - # type: (...) -> "models.DedicatedHost" - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + # type: (...) -> "_models.DedicatedHost" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def begin_create_or_update( resource_group_name, # type: str host_group_name, # type: str host_name, # type: str - parameters, # type: "models.DedicatedHost" + parameters, # type: "_models.DedicatedHost" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DedicatedHost"] + # type: (...) -> LROPoller["_models.DedicatedHost"] """Create or update a dedicated host . :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -182,11 +189,11 @@ def _update_initial( resource_group_name, # type: str host_group_name, # type: str host_name, # type: str - parameters, # type: "models.DedicatedHostUpdate" + parameters, # type: "_models.DedicatedHostUpdate" **kwargs # type: Any ): - # type: (...) -> "models.DedicatedHost" - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + # type: (...) -> "_models.DedicatedHost" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -238,10 +245,10 @@ def begin_update( resource_group_name, # type: str host_group_name, # type: str host_name, # type: str - parameters, # type: "models.DedicatedHostUpdate" + parameters, # type: "_models.DedicatedHostUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DedicatedHost"] + # type: (...) -> LROPoller["_models.DedicatedHost"] """Update an dedicated host . :param resource_group_name: The name of the resource group. @@ -263,7 +270,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -289,7 +296,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -397,7 +411,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -419,7 +440,7 @@ def get( expand="instanceView", # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.DedicatedHost" + # type: (...) -> "_models.DedicatedHost" """Retrieves information about a dedicated host. :param resource_group_name: The name of the resource group. @@ -435,7 +456,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.DedicatedHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -485,7 +506,7 @@ def list_by_host_group( host_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DedicatedHostListResult"] + # type: (...) -> Iterable["_models.DedicatedHostListResult"] """Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. @@ -498,7 +519,7 @@ def list_by_host_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.DedicatedHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_disks_operations.py index f937e56388e2..8a84d7ee62f6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_disks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DisksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.Disk" + disk, # type: "_models.Disk" **kwargs # type: Any ): - # type: (...) -> "models.Disk" - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + # type: (...) -> "_models.Disk" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.Disk" + disk, # type: "_models.Disk" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Disk"] + # type: (...) -> LROPoller["_models.Disk"] """Creates or updates a disk. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -177,11 +183,11 @@ def _update_initial( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.DiskUpdate" + disk, # type: "_models.DiskUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Disk" - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + # type: (...) -> "_models.Disk" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,10 +241,10 @@ def begin_update( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.DiskUpdate" + disk, # type: "_models.DiskUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Disk"] + # type: (...) -> LROPoller["_models.Disk"] """Updates (patches) a disk. :param resource_group_name: The name of the resource group. @@ -260,7 +266,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -285,7 +291,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -305,7 +317,7 @@ def get( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Disk" + # type: (...) -> "_models.Disk" """Gets information about a disk. :param resource_group_name: The name of the resource group. @@ -319,7 +331,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.Disk :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -450,7 +462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -469,7 +487,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskList"] + # type: (...) -> Iterable["_models.DiskList"] """Lists all the disks under a resource group. :param resource_group_name: The name of the resource group. @@ -479,7 +497,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -539,7 +557,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskList"] + # type: (...) -> Iterable["_models.DiskList"] """Lists all the disks under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -547,7 +565,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -606,11 +624,11 @@ def _grant_access_initial( self, resource_group_name, # type: str disk_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> Optional["models.AccessUri"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + # type: (...) -> Optional["_models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -662,10 +680,10 @@ def begin_grant_access( self, resource_group_name, # type: str disk_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AccessUri"] + # type: (...) -> LROPoller["_models.AccessUri"] """Grants access to a disk. :param resource_group_name: The name of the resource group. @@ -688,7 +706,7 @@ def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -713,7 +731,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -817,7 +841,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_galleries_operations.py index 144a47bb737d..806d2e95b230 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_galleries_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class GalleriesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gallery_name, # type: str - gallery, # type: "models.Gallery" + gallery, # type: "_models.Gallery" **kwargs # type: Any ): - # type: (...) -> "models.Gallery" - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + # type: (...) -> "_models.Gallery" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gallery_name, # type: str - gallery, # type: "models.Gallery" + gallery, # type: "_models.Gallery" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Gallery"] + # type: (...) -> LROPoller["_models.Gallery"] """Create or update a Shared Image Gallery. :param resource_group_name: The name of the resource group. @@ -136,7 +136,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -161,7 +161,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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: @@ -181,7 +187,7 @@ def get( gallery_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Gallery" + # type: (...) -> "_models.Gallery" """Retrieves information about a Shared Image Gallery. :param resource_group_name: The name of the resource group. @@ -193,7 +199,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.Gallery :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -324,7 +330,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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: @@ -343,7 +355,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.GalleryList"] + # type: (...) -> Iterable["_models.GalleryList"] """List galleries under a resource group. :param resource_group_name: The name of the resource group. @@ -353,7 +365,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.GalleryList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -413,7 +425,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.GalleryList"] + # type: (...) -> Iterable["_models.GalleryList"] """List galleries under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -421,7 +433,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.GalleryList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_application_versions_operations.py index fc9495b0e662..5678db7c793a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_application_versions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class GalleryApplicationVersionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,11 +53,11 @@ def _create_or_update_initial( gallery_name, # type: str gallery_application_name, # type: str gallery_application_version_name, # type: str - gallery_application_version, # type: "models.GalleryApplicationVersion" + gallery_application_version, # type: "_models.GalleryApplicationVersion" **kwargs # type: Any ): - # type: (...) -> "models.GalleryApplicationVersion" - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] + # type: (...) -> "_models.GalleryApplicationVersion" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,10 +118,10 @@ def begin_create_or_update( gallery_name, # type: str gallery_application_name, # type: str gallery_application_version_name, # type: str - gallery_application_version, # type: "models.GalleryApplicationVersion" + gallery_application_version, # type: "_models.GalleryApplicationVersion" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GalleryApplicationVersion"] + # type: (...) -> LROPoller["_models.GalleryApplicationVersion"] """Create or update a gallery Application Version. :param resource_group_name: The name of the resource group. @@ -151,7 +151,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -178,7 +178,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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: @@ -198,10 +206,10 @@ def get( gallery_name, # type: str gallery_application_name, # type: str gallery_application_version_name, # type: str - expand=None, # type: Optional[Union[str, "models.ReplicationStatusTypes"]] + expand=None, # type: Optional[Union[str, "_models.ReplicationStatusTypes"]] **kwargs # type: Any ): - # type: (...) -> "models.GalleryApplicationVersion" + # type: (...) -> "_models.GalleryApplicationVersion" """Retrieves information about a gallery Application Version. :param resource_group_name: The name of the resource group. @@ -222,7 +230,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.GalleryApplicationVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -372,7 +380,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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: @@ -393,7 +409,7 @@ def list_by_gallery_application( gallery_application_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.GalleryApplicationVersionList"] + # type: (...) -> Iterable["_models.GalleryApplicationVersionList"] """List gallery Application Versions in a gallery Application Definition. :param resource_group_name: The name of the resource group. @@ -409,7 +425,7 @@ def list_by_gallery_application( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.GalleryApplicationVersionList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_applications_operations.py index 47ac3bedda5e..3b3cf0dcf8ef 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_applications_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class GalleryApplicationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str gallery_name, # type: str gallery_application_name, # type: str - gallery_application, # type: "models.GalleryApplication" + gallery_application, # type: "_models.GalleryApplication" **kwargs # type: Any ): - # type: (...) -> "models.GalleryApplication" - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] + # type: (...) -> "_models.GalleryApplication" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,10 +115,10 @@ def begin_create_or_update( resource_group_name, # type: str gallery_name, # type: str gallery_application_name, # type: str - gallery_application, # type: "models.GalleryApplication" + gallery_application, # type: "_models.GalleryApplication" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GalleryApplication"] + # type: (...) -> LROPoller["_models.GalleryApplication"] """Create or update a gallery Application Definition. :param resource_group_name: The name of the resource group. @@ -144,7 +144,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -170,7 +170,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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: @@ -191,7 +198,7 @@ def get( gallery_application_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GalleryApplication" + # type: (...) -> "_models.GalleryApplication" """Retrieves information about a gallery Application Definition. :param resource_group_name: The name of the resource group. @@ -207,7 +214,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.GalleryApplication :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -346,7 +353,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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: @@ -366,7 +380,7 @@ def list_by_gallery( gallery_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.GalleryApplicationList"] + # type: (...) -> Iterable["_models.GalleryApplicationList"] """List gallery Application Definitions in a gallery. :param resource_group_name: The name of the resource group. @@ -379,7 +393,7 @@ def list_by_gallery( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.GalleryApplicationList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_image_versions_operations.py index 4f316446431a..5439fa371884 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_image_versions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class GalleryImageVersionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,11 +53,11 @@ def _create_or_update_initial( gallery_name, # type: str gallery_image_name, # type: str gallery_image_version_name, # type: str - gallery_image_version, # type: "models.GalleryImageVersion" + gallery_image_version, # type: "_models.GalleryImageVersion" **kwargs # type: Any ): - # type: (...) -> "models.GalleryImageVersion" - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + # type: (...) -> "_models.GalleryImageVersion" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,10 +118,10 @@ def begin_create_or_update( gallery_name, # type: str gallery_image_name, # type: str gallery_image_version_name, # type: str - gallery_image_version, # type: "models.GalleryImageVersion" + gallery_image_version, # type: "_models.GalleryImageVersion" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GalleryImageVersion"] + # type: (...) -> LROPoller["_models.GalleryImageVersion"] """Create or update a gallery Image Version. :param resource_group_name: The name of the resource group. @@ -151,7 +151,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -178,7 +178,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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: @@ -198,10 +206,10 @@ def get( gallery_name, # type: str gallery_image_name, # type: str gallery_image_version_name, # type: str - expand=None, # type: Optional[Union[str, "models.ReplicationStatusTypes"]] + expand=None, # type: Optional[Union[str, "_models.ReplicationStatusTypes"]] **kwargs # type: Any ): - # type: (...) -> "models.GalleryImageVersion" + # type: (...) -> "_models.GalleryImageVersion" """Retrieves information about a gallery Image Version. :param resource_group_name: The name of the resource group. @@ -221,7 +229,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.GalleryImageVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -370,7 +378,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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: @@ -391,7 +407,7 @@ def list_by_gallery_image( gallery_image_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.GalleryImageVersionList"] + # type: (...) -> Iterable["_models.GalleryImageVersionList"] """List gallery Image Versions in a gallery Image Definition. :param resource_group_name: The name of the resource group. @@ -407,7 +423,7 @@ def list_by_gallery_image( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.GalleryImageVersionList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_images_operations.py index 19da796db09f..f0175c7dacdd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class GalleryImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str gallery_name, # type: str gallery_image_name, # type: str - gallery_image, # type: "models.GalleryImage" + gallery_image, # type: "_models.GalleryImage" **kwargs # type: Any ): - # type: (...) -> "models.GalleryImage" - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + # type: (...) -> "_models.GalleryImage" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,10 +115,10 @@ def begin_create_or_update( resource_group_name, # type: str gallery_name, # type: str gallery_image_name, # type: str - gallery_image, # type: "models.GalleryImage" + gallery_image, # type: "_models.GalleryImage" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GalleryImage"] + # type: (...) -> LROPoller["_models.GalleryImage"] """Create or update a gallery Image Definition. :param resource_group_name: The name of the resource group. @@ -143,7 +143,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -169,7 +169,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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: @@ -190,7 +197,7 @@ def get( gallery_image_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GalleryImage" + # type: (...) -> "_models.GalleryImage" """Retrieves information about a gallery Image Definition. :param resource_group_name: The name of the resource group. @@ -205,7 +212,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.GalleryImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -344,7 +351,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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: @@ -364,7 +378,7 @@ def list_by_gallery( gallery_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.GalleryImageList"] + # type: (...) -> Iterable["_models.GalleryImageList"] """List gallery Image Definitions in a gallery. :param resource_group_name: The name of the resource group. @@ -377,7 +391,7 @@ def list_by_gallery( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.GalleryImageList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_images_operations.py index 65155a2e97aa..e0c1fa1ea7c8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.Image" + parameters, # type: "_models.Image" **kwargs # type: Any ): - # type: (...) -> "models.Image" - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + # type: (...) -> "_models.Image" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.Image" + parameters, # type: "_models.Image" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Image"] + # type: (...) -> LROPoller["_models.Image"] """Create or update an image. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -175,11 +181,11 @@ def _update_initial( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.ImageUpdate" + parameters, # type: "_models.ImageUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Image" - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + # type: (...) -> "_models.Image" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -233,10 +239,10 @@ def begin_update( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.ImageUpdate" + parameters, # type: "_models.ImageUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Image"] + # type: (...) -> LROPoller["_models.Image"] """Update an image. :param resource_group_name: The name of the resource group. @@ -256,7 +262,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -281,7 +287,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -383,7 +395,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -404,7 +422,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Image" + # type: (...) -> "_models.Image" """Gets an image. :param resource_group_name: The name of the resource group. @@ -418,7 +436,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.Image :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +484,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ImageListResult"] + # type: (...) -> Iterable["_models.ImageListResult"] """Gets the list of images under a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +494,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -536,7 +554,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ImageListResult"] + # type: (...) -> Iterable["_models.ImageListResult"] """Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. @@ -545,7 +563,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_log_analytics_operations.py index 229907bb477a..c38669a74dbe 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_log_analytics_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class LogAnalyticsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,11 +49,11 @@ def __init__(self, client, config, serializer, deserializer): def _export_request_rate_by_interval_initial( self, location, # type: str - parameters, # type: "models.RequestRateByIntervalInput" + parameters, # type: "_models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> Optional["models.LogAnalyticsOperationResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + # type: (...) -> Optional["_models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -103,10 +103,10 @@ def _export_request_rate_by_interval_initial( def begin_export_request_rate_by_interval( self, location, # type: str - parameters, # type: "models.RequestRateByIntervalInput" + parameters, # type: "_models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] + # type: (...) -> LROPoller["_models.LogAnalyticsOperationResult"] """Export logs that show Api requests made by this subscription in the given time window to show throttling activities. @@ -125,7 +125,7 @@ def begin_export_request_rate_by_interval( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -149,7 +149,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -166,11 +171,11 @@ def get_long_running_output(pipeline_response): def _export_throttled_requests_initial( self, location, # type: str - parameters, # type: "models.LogAnalyticsInputBase" + parameters, # type: "_models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> Optional["models.LogAnalyticsOperationResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + # type: (...) -> Optional["_models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,10 +225,10 @@ def _export_throttled_requests_initial( def begin_export_throttled_requests( self, location, # type: str - parameters, # type: "models.LogAnalyticsInputBase" + parameters, # type: "_models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] + # type: (...) -> LROPoller["_models.LogAnalyticsOperationResult"] """Export logs that show total throttled Api requests for this subscription in the given time window. @@ -242,7 +247,7 @@ def begin_export_throttled_requests( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -266,7 +271,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_operations.py index 5f4673ddc931..ac3d6078df43 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ComputeOperationListResult"] + # type: (...) -> Iterable["_models.ComputeOperationListResult"] """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.ComputeOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeOperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_proximity_placement_groups_operations.py index 0869eeaf9f67..ed8f14a9436c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_proximity_placement_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ProximityPlacementGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str proximity_placement_group_name, # type: str - parameters, # type: "models.ProximityPlacementGroup" + parameters, # type: "_models.ProximityPlacementGroup" **kwargs # type: Any ): - # type: (...) -> "models.ProximityPlacementGroup" + # type: (...) -> "_models.ProximityPlacementGroup" """Create or update a proximity placement group. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~azure.mgmt.compute.v2019_03_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,10 +120,10 @@ def update( self, resource_group_name, # type: str proximity_placement_group_name, # type: str - parameters, # type: "models.UpdateResource" + parameters, # type: "_models.UpdateResource" **kwargs # type: Any ): - # type: (...) -> "models.ProximityPlacementGroup" + # type: (...) -> "_models.ProximityPlacementGroup" """Update a proximity placement group. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def update( :rtype: ~azure.mgmt.compute.v2019_03_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -243,7 +243,7 @@ def get( proximity_placement_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ProximityPlacementGroup" + # type: (...) -> "_models.ProximityPlacementGroup" """Retrieves information about a proximity placement group . :param resource_group_name: The name of the resource group. @@ -255,7 +255,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -300,7 +300,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProximityPlacementGroupListResult"] + # type: (...) -> Iterable["_models.ProximityPlacementGroupListResult"] """Lists all proximity placement groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -308,7 +308,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.ProximityPlacementGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -368,7 +368,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProximityPlacementGroupListResult"] + # type: (...) -> Iterable["_models.ProximityPlacementGroupListResult"] """Lists all proximity placement groups in a resource group. :param resource_group_name: The name of the resource group. @@ -378,7 +378,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.ProximityPlacementGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_snapshots_operations.py index ffb6f073eb31..fd118adb798f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_snapshots_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SnapshotsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.Snapshot" + snapshot, # type: "_models.Snapshot" **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + # type: (...) -> "_models.Snapshot" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.Snapshot" + snapshot, # type: "_models.Snapshot" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Snapshot"] + # type: (...) -> LROPoller["_models.Snapshot"] """Creates or updates a snapshot. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -177,11 +183,11 @@ def _update_initial( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.SnapshotUpdate" + snapshot, # type: "_models.SnapshotUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + # type: (...) -> "_models.Snapshot" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,10 +241,10 @@ def begin_update( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.SnapshotUpdate" + snapshot, # type: "_models.SnapshotUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Snapshot"] + # type: (...) -> LROPoller["_models.Snapshot"] """Updates (patches) a snapshot. :param resource_group_name: The name of the resource group. @@ -260,7 +266,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -285,7 +291,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -305,7 +317,7 @@ def get( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" + # type: (...) -> "_models.Snapshot" """Gets information about a snapshot. :param resource_group_name: The name of the resource group. @@ -319,7 +331,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.Snapshot :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -450,7 +462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -469,7 +487,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SnapshotList"] + # type: (...) -> Iterable["_models.SnapshotList"] """Lists snapshots under a resource group. :param resource_group_name: The name of the resource group. @@ -479,7 +497,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -539,7 +557,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.SnapshotList"] + # type: (...) -> Iterable["_models.SnapshotList"] """Lists snapshots under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -547,7 +565,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -606,11 +624,11 @@ def _grant_access_initial( self, resource_group_name, # type: str snapshot_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> Optional["models.AccessUri"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + # type: (...) -> Optional["_models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -662,10 +680,10 @@ def begin_grant_access( self, resource_group_name, # type: str snapshot_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AccessUri"] + # type: (...) -> LROPoller["_models.AccessUri"] """Grants access to a snapshot. :param resource_group_name: The name of the resource group. @@ -688,7 +706,7 @@ def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -713,7 +731,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -817,7 +841,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_usage_operations.py index 1d49856c13b4..824153370074 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsageOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListUsagesResult"] + # type: (...) -> Iterable["_models.ListUsagesResult"] """Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extension_images_operations.py index b7dbb7b2b85a..aaf27e34192b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extension_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VirtualMachineExtensionImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( version, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtensionImage" + # type: (...) -> "_models.VirtualMachineExtensionImage" """Gets a virtual machine extension image. :param location: The name of a supported Azure region. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineExtensionImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def list_types( publisher_name, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineExtensionImage"] + # type: (...) -> List["_models.VirtualMachineExtensionImage"] """Gets a list of virtual machine extension image types. :param location: The name of a supported Azure region. @@ -129,7 +129,7 @@ def list_types( :rtype: list[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -180,7 +180,7 @@ def list_versions( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineExtensionImage"] + # type: (...) -> List["_models.VirtualMachineExtensionImage"] """Gets a list of virtual machine extension image versions. :param location: The name of a supported Azure region. @@ -200,7 +200,7 @@ def list_versions( :rtype: list[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extensions_operations.py index f3e15865c4c5..4a2fbc982875 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VirtualMachineExtensionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineExtension"] """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -183,11 +190,11 @@ def _update_initial( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -239,10 +246,10 @@ def begin_update( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineExtension"] """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -265,7 +272,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -291,7 +298,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -399,7 +413,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -421,7 +442,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" + # type: (...) -> "_models.VirtualMachineExtension" """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -437,7 +458,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,7 +509,7 @@ def list( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtensionsListResult" + # type: (...) -> "_models.VirtualMachineExtensionsListResult" """The operation to get all extensions of a Virtual Machine. :param resource_group_name: The name of the resource group. @@ -502,7 +523,7 @@ def list( :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineExtensionsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_images_operations.py index 0855b6112386..893b3c7a5bac 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VirtualMachineImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( version, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineImage" + # type: (...) -> "_models.VirtualMachineImage" """Gets a virtual machine image. :param location: The name of a supported Azure region. @@ -71,7 +71,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -126,7 +126,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. @@ -149,7 +149,7 @@ def list( :rtype: list[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -204,7 +204,7 @@ def list_offers( publisher_name, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image offers for the specified location and publisher. :param location: The name of a supported Azure region. @@ -216,7 +216,7 @@ def list_offers( :rtype: list[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,7 +262,7 @@ def list_publishers( location, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image publishers for the specified Azure location. :param location: The name of a supported Azure region. @@ -272,7 +272,7 @@ def list_publishers( :rtype: list[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -319,7 +319,7 @@ def list_skus( offer, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. :param location: The name of a supported Azure region. @@ -333,7 +333,7 @@ def list_skus( :rtype: list[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_run_commands_operations.py index 4fc1d9008a9f..d98109a1ae67 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_run_commands_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VirtualMachineRunCommandsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RunCommandListResult"] + # type: (...) -> Iterable["_models.RunCommandListResult"] """Lists all available run commands for a subscription in a location. :param location: The location upon which run commands is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.RunCommandListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def get( command_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RunCommandDocument" + # type: (...) -> "_models.RunCommandDocument" """Gets specific run command for a subscription in a location. :param location: The location upon which run commands is queried. @@ -134,7 +134,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.RunCommandDocument :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandDocument"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_extensions_operations.py index b546383f0e42..70dc21760005 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetExtensionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str vm_scale_set_name, # type: str vmss_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineScaleSetExtension" + extension_parameters, # type: "_models.VirtualMachineScaleSetExtension" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + # type: (...) -> "_models.VirtualMachineScaleSetExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def begin_create_or_update( resource_group_name, # type: str vm_scale_set_name, # type: str vmss_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineScaleSetExtension" + extension_parameters, # type: "_models.VirtualMachineScaleSetExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSetExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSetExtension"] """The operation to create or update an extension. :param resource_group_name: The name of the resource group. @@ -139,7 +139,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -165,7 +165,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -273,7 +280,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -295,7 +309,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetExtension" + # type: (...) -> "_models.VirtualMachineScaleSetExtension" """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -311,7 +325,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -361,7 +375,7 @@ def list( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetExtensionListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetExtensionListResult"] """Gets a list of all extensions in a VM scale set. :param resource_group_name: The name of the resource group. @@ -373,7 +387,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetExtensionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtensionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 06c88508528f..b6231762fc4f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VirtualMachineScaleSetRollingUpgradesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -134,7 +134,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -238,7 +244,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -342,7 +354,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -362,7 +380,7 @@ def get_latest( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RollingUpgradeStatusInfo" + # type: (...) -> "_models.RollingUpgradeStatusInfo" """Gets the status of the latest virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -374,7 +392,7 @@ def get_latest( :rtype: ~azure.mgmt.compute.v2019_03_01.models.RollingUpgradeStatusInfo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RollingUpgradeStatusInfo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_vms_operations.py index 376a32c03579..e3d7f14441ab 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetVMsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def _reimage_initial( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - vm_scale_set_vm_reimage_input=None, # type: Optional["models.VirtualMachineReimageParameters"] + vm_scale_set_vm_reimage_input=None, # type: Optional["_models.VirtualMachineReimageParameters"] **kwargs # type: Any ): # type: (...) -> None @@ -106,7 +106,7 @@ def begin_reimage( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - vm_scale_set_vm_reimage_input=None, # type: Optional["models.VirtualMachineReimageParameters"] + vm_scale_set_vm_reimage_input=None, # type: Optional["_models.VirtualMachineReimageParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -154,7 +154,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -263,7 +270,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -373,7 +387,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -392,11 +413,11 @@ def _update_initial( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.VirtualMachineScaleSetVM" + parameters, # type: "_models.VirtualMachineScaleSetVM" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVM" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + # type: (...) -> "_models.VirtualMachineScaleSetVM" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -452,10 +473,10 @@ def begin_update( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.VirtualMachineScaleSetVM" + parameters, # type: "_models.VirtualMachineScaleSetVM" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSetVM"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSetVM"] """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. @@ -478,7 +499,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -504,7 +525,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -612,7 +640,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -634,7 +669,7 @@ def get( expand="instanceView", # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVM" + # type: (...) -> "_models.VirtualMachineScaleSetVM" """Gets a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -650,7 +685,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetVM :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -701,7 +736,7 @@ def get_instance_view( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVMInstanceView" + # type: (...) -> "_models.VirtualMachineScaleSetVMInstanceView" """Gets the status of a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -715,7 +750,7 @@ def get_instance_view( :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetVMInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -766,7 +801,7 @@ def list( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetVMListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetVMListResult"] """Gets a list of all virtual machines in a VM scale sets. :param resource_group_name: The name of the resource group. @@ -787,7 +822,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetVMListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -955,7 +990,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1063,7 +1105,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1171,7 +1220,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1280,7 +1336,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1388,7 +1451,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1407,11 +1477,11 @@ def _run_command_initial( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> Optional["models.RunCommandResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + # type: (...) -> Optional["_models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1465,10 +1535,10 @@ def begin_run_command( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RunCommandResult"] + # type: (...) -> LROPoller["_models.RunCommandResult"] """Run command on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1490,7 +1560,7 @@ def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1516,7 +1586,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_sets_operations.py index 3d2631794080..c4bdd936c0d2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSet" + parameters, # type: "_models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + # type: (...) -> "_models.VirtualMachineScaleSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSet" + parameters, # type: "_models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSet"] """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -175,11 +181,11 @@ def _update_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSetUpdate" + parameters, # type: "_models.VirtualMachineScaleSetUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + # type: (...) -> "_models.VirtualMachineScaleSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -229,10 +235,10 @@ def begin_update( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSetUpdate" + parameters, # type: "_models.VirtualMachineScaleSetUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSet"] """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -379,7 +391,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -399,7 +417,7 @@ def get( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" + # type: (...) -> "_models.VirtualMachineScaleSet" """Display information about a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -411,7 +429,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -456,7 +474,7 @@ def _deallocate_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -508,7 +526,7 @@ def begin_deallocate( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -555,7 +573,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -573,7 +597,7 @@ def _delete_instances_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): # type: (...) -> None @@ -622,7 +646,7 @@ def begin_delete_instances( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -667,7 +691,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -687,7 +717,7 @@ def get_instance_view( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetInstanceView" + # type: (...) -> "_models.VirtualMachineScaleSetInstanceView" """Gets the status of a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -699,7 +729,7 @@ def get_instance_view( :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -745,7 +775,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListResult"] """Gets a list of all VM scale sets under a resource group. :param resource_group_name: The name of the resource group. @@ -755,7 +785,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -815,7 +845,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListWithLinkResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListWithLinkResult"] """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. @@ -825,7 +855,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetListWithLinkResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListWithLinkResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -886,7 +916,7 @@ def list_skus( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListSkusResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListSkusResult"] """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. @@ -899,7 +929,7 @@ def list_skus( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetListSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -962,7 +992,7 @@ def get_os_upgrade_history( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListOSUpgradeHistory"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListOSUpgradeHistory"] """Gets list of OS upgrades on a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -974,7 +1004,7 @@ def get_os_upgrade_history( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSetListOSUpgradeHistory] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListOSUpgradeHistory"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1036,7 +1066,7 @@ def _power_off_initial( resource_group_name, # type: str vm_scale_set_name, # type: str skip_shutdown=False, # type: Optional[bool] - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1091,7 +1121,7 @@ def begin_power_off( resource_group_name, # type: str vm_scale_set_name, # type: str skip_shutdown=False, # type: Optional[bool] - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1143,7 +1173,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1161,7 +1197,7 @@ def _restart_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1213,7 +1249,7 @@ def begin_restart( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1258,7 +1294,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1276,7 +1318,7 @@ def _start_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1328,7 +1370,7 @@ def begin_start( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1373,7 +1415,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1391,7 +1439,7 @@ def _redeploy_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1443,7 +1491,7 @@ def begin_redeploy( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1489,7 +1537,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1507,7 +1561,7 @@ def _perform_maintenance_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1559,7 +1613,7 @@ def begin_perform_maintenance( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1607,7 +1661,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1625,7 +1685,7 @@ def _update_instances_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): # type: (...) -> None @@ -1674,7 +1734,7 @@ def begin_update_instances( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1719,7 +1779,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1737,7 +1803,7 @@ def _reimage_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_scale_set_reimage_input=None, # type: Optional["models.VirtualMachineScaleSetReimageParameters"] + vm_scale_set_reimage_input=None, # type: Optional["_models.VirtualMachineScaleSetReimageParameters"] **kwargs # type: Any ): # type: (...) -> None @@ -1789,7 +1855,7 @@ def begin_reimage( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_scale_set_reimage_input=None, # type: Optional["models.VirtualMachineScaleSetReimageParameters"] + vm_scale_set_reimage_input=None, # type: Optional["_models.VirtualMachineScaleSetReimageParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1836,7 +1902,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1854,7 +1926,7 @@ def _reimage_all_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1906,7 +1978,7 @@ def begin_reimage_all( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1952,7 +2024,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1973,7 +2051,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( platform_update_domain, # type: int **kwargs # type: Any ): - # type: (...) -> "models.RecoveryWalkResponse" + # type: (...) -> "_models.RecoveryWalkResponse" """Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. @@ -1989,7 +2067,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( :rtype: ~azure.mgmt.compute.v2019_03_01.models.RecoveryWalkResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryWalkResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2035,11 +2113,11 @@ def convert_to_single_placement_group( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VMScaleSetConvertToSinglePlacementGroupInput" + parameters, # type: "_models.VMScaleSetConvertToSinglePlacementGroupInput" **kwargs # type: Any ): # type: (...) -> None - """Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + """Converts SinglePlacementGroup property to true for a existing virtual machine scale set. :param resource_group_name: The name of the resource group. :type resource_group_name: str diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_sizes_operations.py index 524848604bc5..7f43f54c5c83 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_sizes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VirtualMachineSizesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """This API is deprecated. Use `Resources Skus `_. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machines_operations.py index 5cd0c795bfc5..a169e4c443d6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machines_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachinesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list_by_location( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Gets all the virtual machines under the specified subscription for the specified location. :param location: The location for which virtual machines under the subscription are queried. @@ -62,7 +62,7 @@ def list_by_location( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,11 +122,11 @@ def _capture_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineCaptureParameters" + parameters, # type: "_models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualMachineCaptureResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + # type: (...) -> Optional["_models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualMachineCaptureResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -178,10 +178,10 @@ def begin_capture( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineCaptureParameters" + parameters, # type: "_models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineCaptureResult"] + # type: (...) -> LROPoller["_models.VirtualMachineCaptureResult"] """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -202,7 +202,7 @@ def begin_capture( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -227,7 +227,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -245,11 +251,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachine" + parameters, # type: "_models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + # type: (...) -> "_models.VirtualMachine" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,10 +309,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachine" + parameters, # type: "_models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachine"] + # type: (...) -> LROPoller["_models.VirtualMachine"] """The operation to create or update a virtual machine. :param resource_group_name: The name of the resource group. @@ -326,7 +332,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -351,7 +357,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -369,11 +381,11 @@ def _update_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineUpdate" + parameters, # type: "_models.VirtualMachineUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + # type: (...) -> "_models.VirtualMachine" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -427,10 +439,10 @@ def begin_update( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineUpdate" + parameters, # type: "_models.VirtualMachineUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachine"] + # type: (...) -> LROPoller["_models.VirtualMachine"] """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -450,7 +462,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -475,7 +487,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -577,7 +595,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -598,7 +622,7 @@ def get( expand="instanceView", # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" + # type: (...) -> "_models.VirtualMachine" """Retrieves information about the model view or the instance view of a virtual machine. :param resource_group_name: The name of the resource group. @@ -612,7 +636,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachine :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -661,7 +685,7 @@ def instance_view( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineInstanceView" + # type: (...) -> "_models.VirtualMachineInstanceView" """Retrieves information about the run-time state of a virtual machine. :param resource_group_name: The name of the resource group. @@ -673,7 +697,7 @@ def instance_view( :rtype: ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -803,7 +827,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -906,7 +936,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -979,7 +1015,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. @@ -990,7 +1026,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1050,7 +1086,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. @@ -1059,7 +1095,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1120,7 +1156,7 @@ def list_available_sizes( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes to which the specified virtual machine can be resized. @@ -1133,7 +1169,7 @@ def list_available_sizes( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1288,7 +1324,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1390,7 +1432,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1492,7 +1540,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1594,7 +1648,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1612,7 +1672,7 @@ def _reimage_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters=None, # type: Optional["models.VirtualMachineReimageParameters"] + parameters=None, # type: Optional["_models.VirtualMachineReimageParameters"] **kwargs # type: Any ): # type: (...) -> None @@ -1664,7 +1724,7 @@ def begin_reimage( self, resource_group_name, # type: str vm_name, # type: str - parameters=None, # type: Optional["models.VirtualMachineReimageParameters"] + parameters=None, # type: Optional["_models.VirtualMachineReimageParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1709,7 +1769,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1811,7 +1877,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1829,11 +1901,11 @@ def _run_command_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> Optional["models.RunCommandResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + # type: (...) -> Optional["_models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1885,10 +1957,10 @@ def begin_run_command( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RunCommandResult"] + # type: (...) -> LROPoller["_models.RunCommandResult"] """Run command on the VM. :param resource_group_name: The name of the resource group. @@ -1908,7 +1980,7 @@ def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1933,7 +2005,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_compute_management_client.py index cbbf6786ef71..176fa891f0b9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_compute_management_client.py @@ -49,7 +49,6 @@ def __init__( 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.resource_skus = ResourceSkusOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_metadata.json index dfb7d12af0ac..c904a0aaa56e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": false + "has_lro_operations": false, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/_compute_management_client.py index 8ff46cd8a872..3e04870a583b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/_compute_management_client.py @@ -46,7 +46,6 @@ def __init__( 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.resource_skus = ResourceSkusOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/operations/_resource_skus_operations.py index 85c398c48a98..0c92815711a8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/operations/_resource_skus_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/operations/_resource_skus_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ResourceSkusOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, filter: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.ResourceSkusResult"]: + ) -> AsyncIterable["_models.ResourceSkusResult"]: """Gets the list of Microsoft.Compute SKUs available for your Subscription. :param filter: The filter to apply on the operation. Only **location** filter is supported @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_04_01.models.ResourceSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/operations/_resource_skus_operations.py index e7abe04f0ed1..3a826c3a2ff0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/operations/_resource_skus_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/operations/_resource_skus_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ResourceSkusOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( filter=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.ResourceSkusResult"] + # type: (...) -> Iterable["_models.ResourceSkusResult"] """Gets the list of Microsoft.Compute SKUs available for your Subscription. :param filter: The filter to apply on the operation. Only **location** filter is supported @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_04_01.models.ResourceSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_compute_management_client.py index 7a3a61413914..6552f8960011 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_compute_management_client.py @@ -128,7 +128,6 @@ def __init__( 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( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_metadata.json index 835440e1eadf..5c69075854fe 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/_compute_management_client.py index f161044379f0..74b0eac5cb08 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/_compute_management_client.py @@ -125,7 +125,6 @@ def __init__( 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( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_availability_sets_operations.py index bb66ddd2a798..f2b851b3a078 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_availability_sets_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailabilitySetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, availability_set_name: str, - parameters: "models.AvailabilitySet", + parameters: "_models.AvailabilitySet", **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Create or update an availability set. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~azure.mgmt.compute.v2019_07_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,9 +111,9 @@ async def update( self, resource_group_name: str, availability_set_name: str, - parameters: "models.AvailabilitySetUpdate", + parameters: "_models.AvailabilitySetUpdate", **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Update an availability set. :param resource_group_name: The name of the resource group. @@ -127,7 +127,7 @@ async def update( :rtype: ~azure.mgmt.compute.v2019_07_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +231,7 @@ async def get( resource_group_name: str, availability_set_name: str, **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Retrieves information about an availability set. :param resource_group_name: The name of the resource group. @@ -243,7 +243,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,7 +288,7 @@ def list_by_subscription( self, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.AvailabilitySetListResult"]: + ) -> AsyncIterable["_models.AvailabilitySetListResult"]: """Lists all availability sets in a subscription. :param expand: The expand expression to apply to the operation. Allowed values are @@ -299,7 +299,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -360,7 +360,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailabilitySetListResult"]: + ) -> AsyncIterable["_models.AvailabilitySetListResult"]: """Lists all availability sets in a resource group. :param resource_group_name: The name of the resource group. @@ -370,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -431,7 +431,7 @@ def list_available_sizes( resource_group_name: str, availability_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. @@ -444,7 +444,7 @@ def list_available_sizes( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_host_groups_operations.py index 6a2ce07e2e34..ef5806af8665 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_host_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DedicatedHostGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, host_group_name: str, - parameters: "models.DedicatedHostGroup", + parameters: "_models.DedicatedHostGroup", **kwargs - ) -> "models.DedicatedHostGroup": + ) -> "_models.DedicatedHostGroup": """Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.compute.v2019_07_01.models.DedicatedHostGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,9 +117,9 @@ async def update( self, resource_group_name: str, host_group_name: str, - parameters: "models.DedicatedHostGroupUpdate", + parameters: "_models.DedicatedHostGroupUpdate", **kwargs - ) -> "models.DedicatedHostGroup": + ) -> "_models.DedicatedHostGroup": """Update an dedicated host group. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ async def update( :rtype: ~azure.mgmt.compute.v2019_07_01.models.DedicatedHostGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -237,7 +237,7 @@ async def get( resource_group_name: str, host_group_name: str, **kwargs - ) -> "models.DedicatedHostGroup": + ) -> "_models.DedicatedHostGroup": """Retrieves information about a dedicated host group. :param resource_group_name: The name of the resource group. @@ -249,7 +249,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.DedicatedHostGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -294,7 +294,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DedicatedHostGroupListResult"]: + ) -> AsyncIterable["_models.DedicatedHostGroupListResult"]: """Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. @@ -305,7 +305,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.DedicatedHostGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -364,7 +364,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.DedicatedHostGroupListResult"]: + ) -> AsyncIterable["_models.DedicatedHostGroupListResult"]: """Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. @@ -373,7 +373,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.DedicatedHostGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_hosts_operations.py index d76c1bf915a5..115b1a2c8457 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DedicatedHostsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, host_group_name: str, host_name: str, - parameters: "models.DedicatedHost", + parameters: "_models.DedicatedHost", **kwargs - ) -> "models.DedicatedHost": - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + ) -> "_models.DedicatedHost": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def begin_create_or_update( resource_group_name: str, host_group_name: str, host_name: str, - parameters: "models.DedicatedHost", + parameters: "_models.DedicatedHost", **kwargs - ) -> AsyncLROPoller["models.DedicatedHost"]: + ) -> AsyncLROPoller["_models.DedicatedHost"]: """Create or update a dedicated host . :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -176,10 +183,10 @@ async def _update_initial( resource_group_name: str, host_group_name: str, host_name: str, - parameters: "models.DedicatedHostUpdate", + parameters: "_models.DedicatedHostUpdate", **kwargs - ) -> "models.DedicatedHost": - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + ) -> "_models.DedicatedHost": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,9 +238,9 @@ async def begin_update( resource_group_name: str, host_group_name: str, host_name: str, - parameters: "models.DedicatedHostUpdate", + parameters: "_models.DedicatedHostUpdate", **kwargs - ) -> AsyncLROPoller["models.DedicatedHost"]: + ) -> AsyncLROPoller["_models.DedicatedHost"]: """Update an dedicated host . :param resource_group_name: The name of the resource group. @@ -255,7 +262,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -281,7 +288,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -387,7 +401,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -408,7 +429,7 @@ async def get( host_name: str, expand: Optional[str] = "instanceView", **kwargs - ) -> "models.DedicatedHost": + ) -> "_models.DedicatedHost": """Retrieves information about a dedicated host. :param resource_group_name: The name of the resource group. @@ -424,7 +445,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.DedicatedHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -473,7 +494,7 @@ def list_by_host_group( resource_group_name: str, host_group_name: str, **kwargs - ) -> AsyncIterable["models.DedicatedHostListResult"]: + ) -> AsyncIterable["_models.DedicatedHostListResult"]: """Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. @@ -486,7 +507,7 @@ def list_by_host_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.DedicatedHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disk_encryption_sets_operations.py index e2309f5533ef..292d2916bf76 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disk_encryption_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DiskEncryptionSetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, disk_encryption_set_name: str, - disk_encryption_set: "models.DiskEncryptionSet", + disk_encryption_set: "_models.DiskEncryptionSet", **kwargs - ) -> "models.DiskEncryptionSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + ) -> "_models.DiskEncryptionSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, disk_encryption_set_name: str, - disk_encryption_set: "models.DiskEncryptionSet", + disk_encryption_set: "_models.DiskEncryptionSet", **kwargs - ) -> AsyncLROPoller["models.DiskEncryptionSet"]: + ) -> AsyncLROPoller["_models.DiskEncryptionSet"]: """Creates or updates a disk encryption set. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -154,7 +154,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_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: @@ -172,10 +178,10 @@ async def _update_initial( self, resource_group_name: str, disk_encryption_set_name: str, - disk_encryption_set: "models.DiskEncryptionSetUpdate", + disk_encryption_set: "_models.DiskEncryptionSetUpdate", **kwargs - ) -> "models.DiskEncryptionSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + ) -> "_models.DiskEncryptionSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -229,9 +235,9 @@ async def begin_update( self, resource_group_name: str, disk_encryption_set_name: str, - disk_encryption_set: "models.DiskEncryptionSetUpdate", + disk_encryption_set: "_models.DiskEncryptionSetUpdate", **kwargs - ) -> AsyncLROPoller["models.DiskEncryptionSet"]: + ) -> AsyncLROPoller["_models.DiskEncryptionSet"]: """Updates (patches) a disk encryption set. :param resource_group_name: The name of the resource group. @@ -254,7 +260,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -279,7 +285,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_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: @@ -298,7 +310,7 @@ async def get( resource_group_name: str, disk_encryption_set_name: str, **kwargs - ) -> "models.DiskEncryptionSet": + ) -> "_models.DiskEncryptionSet": """Gets information about a disk encryption set. :param resource_group_name: The name of the resource group. @@ -312,7 +324,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.DiskEncryptionSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_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: @@ -461,7 +479,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DiskEncryptionSetList"]: + ) -> AsyncIterable["_models.DiskEncryptionSetList"]: """Lists all the disk encryption sets under a resource group. :param resource_group_name: The name of the resource group. @@ -471,7 +489,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.DiskEncryptionSetList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSetList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSetList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.DiskEncryptionSetList"]: + ) -> AsyncIterable["_models.DiskEncryptionSetList"]: """Lists all the disk encryption sets under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -538,7 +556,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.DiskEncryptionSetList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSetList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSetList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disks_operations.py index b0d42c300a10..bc8e342bd21c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DisksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, disk_name: str, - disk: "models.Disk", + disk: "_models.Disk", **kwargs - ) -> "models.Disk": - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + ) -> "_models.Disk": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, disk_name: str, - disk: "models.Disk", + disk: "_models.Disk", **kwargs - ) -> AsyncLROPoller["models.Disk"]: + ) -> AsyncLROPoller["_models.Disk"]: """Creates or updates a disk. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -171,10 +177,10 @@ async def _update_initial( self, resource_group_name: str, disk_name: str, - disk: "models.DiskUpdate", + disk: "_models.DiskUpdate", **kwargs - ) -> "models.Disk": - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + ) -> "_models.Disk": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,9 +234,9 @@ async def begin_update( self, resource_group_name: str, disk_name: str, - disk: "models.DiskUpdate", + disk: "_models.DiskUpdate", **kwargs - ) -> AsyncLROPoller["models.Disk"]: + ) -> AsyncLROPoller["_models.Disk"]: """Updates (patches) a disk. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -296,7 +308,7 @@ async def get( resource_group_name: str, disk_name: str, **kwargs - ) -> "models.Disk": + ) -> "_models.Disk": """Gets information about a disk. :param resource_group_name: The name of the resource group. @@ -310,7 +322,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.Disk :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -457,7 +475,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DiskList"]: + ) -> AsyncIterable["_models.DiskList"]: """Lists all the disks under a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -526,7 +544,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.DiskList"]: + ) -> AsyncIterable["_models.DiskList"]: """Lists all the disks under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -534,7 +552,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -593,10 +611,10 @@ async def _grant_access_initial( self, resource_group_name: str, disk_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> Optional["models.AccessUri"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + ) -> Optional["_models.AccessUri"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -648,9 +666,9 @@ async def begin_grant_access( self, resource_group_name: str, disk_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> AsyncLROPoller["models.AccessUri"]: + ) -> AsyncLROPoller["_models.AccessUri"]: """Grants access to a disk. :param resource_group_name: The name of the resource group. @@ -673,7 +691,7 @@ async def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -698,7 +716,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -800,7 +824,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_galleries_operations.py index 59d3c3f204e2..7ec1f7ef9ae0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_galleries_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class GalleriesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gallery_name: str, - gallery: "models.Gallery", + gallery: "_models.Gallery", **kwargs - ) -> "models.Gallery": - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + ) -> "_models.Gallery": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def begin_create_or_update( self, resource_group_name: str, gallery_name: str, - gallery: "models.Gallery", + gallery: "_models.Gallery", **kwargs - ) -> AsyncLROPoller["models.Gallery"]: + ) -> AsyncLROPoller["_models.Gallery"]: """Create or update a Shared Image Gallery. :param resource_group_name: The name of the resource group. @@ -130,7 +130,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -155,7 +155,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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: @@ -173,10 +179,10 @@ async def _update_initial( self, resource_group_name: str, gallery_name: str, - gallery: "models.GalleryUpdate", + gallery: "_models.GalleryUpdate", **kwargs - ) -> "models.Gallery": - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + ) -> "_models.Gallery": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -226,9 +232,9 @@ async def begin_update( self, resource_group_name: str, gallery_name: str, - gallery: "models.GalleryUpdate", + gallery: "_models.GalleryUpdate", **kwargs - ) -> AsyncLROPoller["models.Gallery"]: + ) -> AsyncLROPoller["_models.Gallery"]: """Update a Shared Image Gallery. :param resource_group_name: The name of the resource group. @@ -249,7 +255,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -274,7 +280,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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: @@ -293,7 +305,7 @@ async def get( resource_group_name: str, gallery_name: str, **kwargs - ) -> "models.Gallery": + ) -> "_models.Gallery": """Retrieves information about a Shared Image Gallery. :param resource_group_name: The name of the resource group. @@ -305,7 +317,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.Gallery :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -434,7 +446,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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: @@ -452,7 +470,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.GalleryList"]: + ) -> AsyncIterable["_models.GalleryList"]: """List galleries under a resource group. :param resource_group_name: The name of the resource group. @@ -462,7 +480,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.GalleryList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -521,7 +539,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.GalleryList"]: + ) -> AsyncIterable["_models.GalleryList"]: """List galleries under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -529,7 +547,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.GalleryList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_application_versions_operations.py index 8be18caf80c5..6bf75d0d2bd1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_application_versions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class GalleryApplicationVersionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,10 +49,10 @@ async def _create_or_update_initial( gallery_name: str, gallery_application_name: str, gallery_application_version_name: str, - gallery_application_version: "models.GalleryApplicationVersion", + gallery_application_version: "_models.GalleryApplicationVersion", **kwargs - ) -> "models.GalleryApplicationVersion": - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] + ) -> "_models.GalleryApplicationVersion": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,9 +113,9 @@ async def begin_create_or_update( gallery_name: str, gallery_application_name: str, gallery_application_version_name: str, - gallery_application_version: "models.GalleryApplicationVersion", + gallery_application_version: "_models.GalleryApplicationVersion", **kwargs - ) -> AsyncLROPoller["models.GalleryApplicationVersion"]: + ) -> AsyncLROPoller["_models.GalleryApplicationVersion"]: """Create or update a gallery Application Version. :param resource_group_name: The name of the resource group. @@ -145,7 +145,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -172,7 +172,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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: @@ -192,10 +200,10 @@ async def _update_initial( gallery_name: str, gallery_application_name: str, gallery_application_version_name: str, - gallery_application_version: "models.GalleryApplicationVersionUpdate", + gallery_application_version: "_models.GalleryApplicationVersionUpdate", **kwargs - ) -> "models.GalleryApplicationVersion": - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] + ) -> "_models.GalleryApplicationVersion": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -249,9 +257,9 @@ async def begin_update( gallery_name: str, gallery_application_name: str, gallery_application_version_name: str, - gallery_application_version: "models.GalleryApplicationVersionUpdate", + gallery_application_version: "_models.GalleryApplicationVersionUpdate", **kwargs - ) -> AsyncLROPoller["models.GalleryApplicationVersion"]: + ) -> AsyncLROPoller["_models.GalleryApplicationVersion"]: """Update a gallery Application Version. :param resource_group_name: The name of the resource group. @@ -281,7 +289,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -308,7 +316,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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: @@ -328,9 +344,9 @@ async def get( gallery_name: str, gallery_application_name: str, gallery_application_version_name: str, - expand: Optional[Union[str, "models.ReplicationStatusTypes"]] = None, + expand: Optional[Union[str, "_models.ReplicationStatusTypes"]] = None, **kwargs - ) -> "models.GalleryApplicationVersion": + ) -> "_models.GalleryApplicationVersion": """Retrieves information about a gallery Application Version. :param resource_group_name: The name of the resource group. @@ -351,7 +367,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.GalleryApplicationVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -499,7 +515,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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: @@ -519,7 +543,7 @@ def list_by_gallery_application( gallery_name: str, gallery_application_name: str, **kwargs - ) -> AsyncIterable["models.GalleryApplicationVersionList"]: + ) -> AsyncIterable["_models.GalleryApplicationVersionList"]: """List gallery Application Versions in a gallery Application Definition. :param resource_group_name: The name of the resource group. @@ -535,7 +559,7 @@ def list_by_gallery_application( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.GalleryApplicationVersionList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_applications_operations.py index 3ddfe762c5d2..6a0a45aca5db 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_applications_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class GalleryApplicationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, gallery_name: str, gallery_application_name: str, - gallery_application: "models.GalleryApplication", + gallery_application: "_models.GalleryApplication", **kwargs - ) -> "models.GalleryApplication": - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] + ) -> "_models.GalleryApplication": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,9 +110,9 @@ async def begin_create_or_update( resource_group_name: str, gallery_name: str, gallery_application_name: str, - gallery_application: "models.GalleryApplication", + gallery_application: "_models.GalleryApplication", **kwargs - ) -> AsyncLROPoller["models.GalleryApplication"]: + ) -> AsyncLROPoller["_models.GalleryApplication"]: """Create or update a gallery Application Definition. :param resource_group_name: The name of the resource group. @@ -138,7 +138,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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: @@ -183,10 +190,10 @@ async def _update_initial( resource_group_name: str, gallery_name: str, gallery_application_name: str, - gallery_application: "models.GalleryApplicationUpdate", + gallery_application: "_models.GalleryApplicationUpdate", **kwargs - ) -> "models.GalleryApplication": - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] + ) -> "_models.GalleryApplication": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -238,9 +245,9 @@ async def begin_update( resource_group_name: str, gallery_name: str, gallery_application_name: str, - gallery_application: "models.GalleryApplicationUpdate", + gallery_application: "_models.GalleryApplicationUpdate", **kwargs - ) -> AsyncLROPoller["models.GalleryApplication"]: + ) -> AsyncLROPoller["_models.GalleryApplication"]: """Update a gallery Application Definition. :param resource_group_name: The name of the resource group. @@ -265,7 +272,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -291,7 +298,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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: @@ -311,7 +325,7 @@ async def get( gallery_name: str, gallery_application_name: str, **kwargs - ) -> "models.GalleryApplication": + ) -> "_models.GalleryApplication": """Retrieves information about a gallery Application Definition. :param resource_group_name: The name of the resource group. @@ -327,7 +341,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.GalleryApplication :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +478,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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: @@ -483,7 +504,7 @@ def list_by_gallery( resource_group_name: str, gallery_name: str, **kwargs - ) -> AsyncIterable["models.GalleryApplicationList"]: + ) -> AsyncIterable["_models.GalleryApplicationList"]: """List gallery Application Definitions in a gallery. :param resource_group_name: The name of the resource group. @@ -496,7 +517,7 @@ def list_by_gallery( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.GalleryApplicationList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_image_versions_operations.py index 2f2fdab26d88..4fdba1b297f0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_image_versions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class GalleryImageVersionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,10 +49,10 @@ async def _create_or_update_initial( gallery_name: str, gallery_image_name: str, gallery_image_version_name: str, - gallery_image_version: "models.GalleryImageVersion", + gallery_image_version: "_models.GalleryImageVersion", **kwargs - ) -> "models.GalleryImageVersion": - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + ) -> "_models.GalleryImageVersion": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,9 +113,9 @@ async def begin_create_or_update( gallery_name: str, gallery_image_name: str, gallery_image_version_name: str, - gallery_image_version: "models.GalleryImageVersion", + gallery_image_version: "_models.GalleryImageVersion", **kwargs - ) -> AsyncLROPoller["models.GalleryImageVersion"]: + ) -> AsyncLROPoller["_models.GalleryImageVersion"]: """Create or update a gallery Image Version. :param resource_group_name: The name of the resource group. @@ -145,7 +145,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -172,7 +172,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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: @@ -192,10 +200,10 @@ async def _update_initial( gallery_name: str, gallery_image_name: str, gallery_image_version_name: str, - gallery_image_version: "models.GalleryImageVersionUpdate", + gallery_image_version: "_models.GalleryImageVersionUpdate", **kwargs - ) -> "models.GalleryImageVersion": - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + ) -> "_models.GalleryImageVersion": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -249,9 +257,9 @@ async def begin_update( gallery_name: str, gallery_image_name: str, gallery_image_version_name: str, - gallery_image_version: "models.GalleryImageVersionUpdate", + gallery_image_version: "_models.GalleryImageVersionUpdate", **kwargs - ) -> AsyncLROPoller["models.GalleryImageVersion"]: + ) -> AsyncLROPoller["_models.GalleryImageVersion"]: """Update a gallery Image Version. :param resource_group_name: The name of the resource group. @@ -281,7 +289,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -308,7 +316,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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: @@ -328,9 +344,9 @@ async def get( gallery_name: str, gallery_image_name: str, gallery_image_version_name: str, - expand: Optional[Union[str, "models.ReplicationStatusTypes"]] = None, + expand: Optional[Union[str, "_models.ReplicationStatusTypes"]] = None, **kwargs - ) -> "models.GalleryImageVersion": + ) -> "_models.GalleryImageVersion": """Retrieves information about a gallery Image Version. :param resource_group_name: The name of the resource group. @@ -350,7 +366,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.GalleryImageVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -497,7 +513,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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: @@ -517,7 +541,7 @@ def list_by_gallery_image( gallery_name: str, gallery_image_name: str, **kwargs - ) -> AsyncIterable["models.GalleryImageVersionList"]: + ) -> AsyncIterable["_models.GalleryImageVersionList"]: """List gallery Image Versions in a gallery Image Definition. :param resource_group_name: The name of the resource group. @@ -533,7 +557,7 @@ def list_by_gallery_image( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.GalleryImageVersionList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_images_operations.py index ec915659187e..adc6d7a31186 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class GalleryImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, gallery_name: str, gallery_image_name: str, - gallery_image: "models.GalleryImage", + gallery_image: "_models.GalleryImage", **kwargs - ) -> "models.GalleryImage": - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + ) -> "_models.GalleryImage": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,9 +110,9 @@ async def begin_create_or_update( resource_group_name: str, gallery_name: str, gallery_image_name: str, - gallery_image: "models.GalleryImage", + gallery_image: "_models.GalleryImage", **kwargs - ) -> AsyncLROPoller["models.GalleryImage"]: + ) -> AsyncLROPoller["_models.GalleryImage"]: """Create or update a gallery Image Definition. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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: @@ -182,10 +189,10 @@ async def _update_initial( resource_group_name: str, gallery_name: str, gallery_image_name: str, - gallery_image: "models.GalleryImageUpdate", + gallery_image: "_models.GalleryImageUpdate", **kwargs - ) -> "models.GalleryImage": - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + ) -> "_models.GalleryImage": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -237,9 +244,9 @@ async def begin_update( resource_group_name: str, gallery_name: str, gallery_image_name: str, - gallery_image: "models.GalleryImageUpdate", + gallery_image: "_models.GalleryImageUpdate", **kwargs - ) -> AsyncLROPoller["models.GalleryImage"]: + ) -> AsyncLROPoller["_models.GalleryImage"]: """Update a gallery Image Definition. :param resource_group_name: The name of the resource group. @@ -264,7 +271,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -290,7 +297,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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: @@ -310,7 +324,7 @@ async def get( gallery_name: str, gallery_image_name: str, **kwargs - ) -> "models.GalleryImage": + ) -> "_models.GalleryImage": """Retrieves information about a gallery Image Definition. :param resource_group_name: The name of the resource group. @@ -325,7 +339,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.GalleryImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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: @@ -481,7 +502,7 @@ def list_by_gallery( resource_group_name: str, gallery_name: str, **kwargs - ) -> AsyncIterable["models.GalleryImageList"]: + ) -> AsyncIterable["_models.GalleryImageList"]: """List gallery Image Definitions in a gallery. :param resource_group_name: The name of the resource group. @@ -494,7 +515,7 @@ def list_by_gallery( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.GalleryImageList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_images_operations.py index 9e38cc38ade9..22a71d6b880f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, image_name: str, - parameters: "models.Image", + parameters: "_models.Image", **kwargs - ) -> "models.Image": - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + ) -> "_models.Image": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, image_name: str, - parameters: "models.Image", + parameters: "_models.Image", **kwargs - ) -> AsyncLROPoller["models.Image"]: + ) -> AsyncLROPoller["_models.Image"]: """Create or update an image. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -169,10 +175,10 @@ async def _update_initial( self, resource_group_name: str, image_name: str, - parameters: "models.ImageUpdate", + parameters: "_models.ImageUpdate", **kwargs - ) -> "models.Image": - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + ) -> "_models.Image": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -226,9 +232,9 @@ async def begin_update( self, resource_group_name: str, image_name: str, - parameters: "models.ImageUpdate", + parameters: "_models.ImageUpdate", **kwargs - ) -> AsyncLROPoller["models.Image"]: + ) -> AsyncLROPoller["_models.Image"]: """Update an image. :param resource_group_name: The name of the resource group. @@ -248,7 +254,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -273,7 +279,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -373,7 +385,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -393,7 +411,7 @@ async def get( image_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Image": + ) -> "_models.Image": """Gets an image. :param resource_group_name: The name of the resource group. @@ -407,7 +425,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.Image :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -454,7 +472,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ImageListResult"]: + ) -> AsyncIterable["_models.ImageListResult"]: """Gets the list of images under a resource group. :param resource_group_name: The name of the resource group. @@ -464,7 +482,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ImageListResult"]: + ) -> AsyncIterable["_models.ImageListResult"]: """Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. @@ -532,7 +550,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_log_analytics_operations.py index b7d86dfd77ef..227f2ccdeabc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_log_analytics_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class LogAnalyticsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,10 +45,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def _export_request_rate_by_interval_initial( self, location: str, - parameters: "models.RequestRateByIntervalInput", + parameters: "_models.RequestRateByIntervalInput", **kwargs - ) -> Optional["models.LogAnalyticsOperationResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + ) -> Optional["_models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -98,9 +98,9 @@ async def _export_request_rate_by_interval_initial( async def begin_export_request_rate_by_interval( self, location: str, - parameters: "models.RequestRateByIntervalInput", + parameters: "_models.RequestRateByIntervalInput", **kwargs - ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: + ) -> AsyncLROPoller["_models.LogAnalyticsOperationResult"]: """Export logs that show Api requests made by this subscription in the given time window to show throttling activities. @@ -119,7 +119,7 @@ async def begin_export_request_rate_by_interval( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -143,7 +143,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -160,10 +165,10 @@ def get_long_running_output(pipeline_response): async def _export_throttled_requests_initial( self, location: str, - parameters: "models.LogAnalyticsInputBase", + parameters: "_models.LogAnalyticsInputBase", **kwargs - ) -> Optional["models.LogAnalyticsOperationResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + ) -> Optional["_models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -213,9 +218,9 @@ async def _export_throttled_requests_initial( async def begin_export_throttled_requests( self, location: str, - parameters: "models.LogAnalyticsInputBase", + parameters: "_models.LogAnalyticsInputBase", **kwargs - ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: + ) -> AsyncLROPoller["_models.LogAnalyticsOperationResult"]: """Export logs that show total throttled Api requests for this subscription in the given time window. @@ -234,7 +239,7 @@ async def begin_export_throttled_requests( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -258,7 +263,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_operations.py index d32ad75c0fb6..ca4635f6767f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ComputeOperationListResult"]: + ) -> AsyncIterable["_models.ComputeOperationListResult"]: """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.ComputeOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeOperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_proximity_placement_groups_operations.py index 078c13fe7390..0d775af65b52 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_proximity_placement_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ProximityPlacementGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, proximity_placement_group_name: str, - parameters: "models.ProximityPlacementGroup", + parameters: "_models.ProximityPlacementGroup", **kwargs - ) -> "models.ProximityPlacementGroup": + ) -> "_models.ProximityPlacementGroup": """Create or update a proximity placement group. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~azure.mgmt.compute.v2019_07_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,9 +115,9 @@ async def update( self, resource_group_name: str, proximity_placement_group_name: str, - parameters: "models.UpdateResource", + parameters: "_models.UpdateResource", **kwargs - ) -> "models.ProximityPlacementGroup": + ) -> "_models.ProximityPlacementGroup": """Update a proximity placement group. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def update( :rtype: ~azure.mgmt.compute.v2019_07_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -236,7 +236,7 @@ async def get( proximity_placement_group_name: str, include_colocation_status: Optional[str] = None, **kwargs - ) -> "models.ProximityPlacementGroup": + ) -> "_models.ProximityPlacementGroup": """Retrieves information about a proximity placement group . :param resource_group_name: The name of the resource group. @@ -251,7 +251,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -297,7 +297,7 @@ async def get( def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.ProximityPlacementGroupListResult"]: + ) -> AsyncIterable["_models.ProximityPlacementGroupListResult"]: """Lists all proximity placement groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -305,7 +305,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.ProximityPlacementGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -364,7 +364,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ProximityPlacementGroupListResult"]: + ) -> AsyncIterable["_models.ProximityPlacementGroupListResult"]: """Lists all proximity placement groups in a resource group. :param resource_group_name: The name of the resource group. @@ -374,7 +374,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.ProximityPlacementGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_snapshots_operations.py index 4ef3aee7ecad..18c0e0a328cb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_snapshots_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SnapshotsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.Snapshot", + snapshot: "_models.Snapshot", **kwargs - ) -> "models.Snapshot": - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + ) -> "_models.Snapshot": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.Snapshot", + snapshot: "_models.Snapshot", **kwargs - ) -> AsyncLROPoller["models.Snapshot"]: + ) -> AsyncLROPoller["_models.Snapshot"]: """Creates or updates a snapshot. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -171,10 +177,10 @@ async def _update_initial( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.SnapshotUpdate", + snapshot: "_models.SnapshotUpdate", **kwargs - ) -> "models.Snapshot": - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + ) -> "_models.Snapshot": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,9 +234,9 @@ async def begin_update( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.SnapshotUpdate", + snapshot: "_models.SnapshotUpdate", **kwargs - ) -> AsyncLROPoller["models.Snapshot"]: + ) -> AsyncLROPoller["_models.Snapshot"]: """Updates (patches) a snapshot. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -296,7 +308,7 @@ async def get( resource_group_name: str, snapshot_name: str, **kwargs - ) -> "models.Snapshot": + ) -> "_models.Snapshot": """Gets information about a snapshot. :param resource_group_name: The name of the resource group. @@ -310,7 +322,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.Snapshot :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -457,7 +475,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.SnapshotList"]: + ) -> AsyncIterable["_models.SnapshotList"]: """Lists snapshots under a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -526,7 +544,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.SnapshotList"]: + ) -> AsyncIterable["_models.SnapshotList"]: """Lists snapshots under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -534,7 +552,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -593,10 +611,10 @@ async def _grant_access_initial( self, resource_group_name: str, snapshot_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> Optional["models.AccessUri"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + ) -> Optional["_models.AccessUri"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -648,9 +666,9 @@ async def begin_grant_access( self, resource_group_name: str, snapshot_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> AsyncLROPoller["models.AccessUri"]: + ) -> AsyncLROPoller["_models.AccessUri"]: """Grants access to a snapshot. :param resource_group_name: The name of the resource group. @@ -673,7 +691,7 @@ async def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -698,7 +716,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -800,7 +824,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_usage_operations.py index e7757a44290b..f87ae577a12d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsageOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.ListUsagesResult"]: + ) -> AsyncIterable["_models.ListUsagesResult"]: """Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extension_images_operations.py index 5bcb28e31a72..8c05cb7d2937 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VirtualMachineExtensionImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( type: str, version: str, **kwargs - ) -> "models.VirtualMachineExtensionImage": + ) -> "_models.VirtualMachineExtensionImage": """Gets a virtual machine extension image. :param location: The name of a supported Azure region. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtensionImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,7 +111,7 @@ async def list_types( location: str, publisher_name: str, **kwargs - ) -> List["models.VirtualMachineExtensionImage"]: + ) -> List["_models.VirtualMachineExtensionImage"]: """Gets a list of virtual machine extension image types. :param location: The name of a supported Azure region. @@ -123,7 +123,7 @@ async def list_types( :rtype: list[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -173,7 +173,7 @@ async def list_versions( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> List["models.VirtualMachineExtensionImage"]: + ) -> List["_models.VirtualMachineExtensionImage"]: """Gets a list of virtual machine extension image versions. :param location: The name of a supported Azure region. @@ -193,7 +193,7 @@ async def list_versions( :rtype: list[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extensions_operations.py index 8c0d708f65e9..dbc36d26e589 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VirtualMachineExtensionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineExtension", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineExtension", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineExtension"]: """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -177,10 +184,10 @@ async def _update_initial( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineExtensionUpdate", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -232,9 +239,9 @@ async def begin_update( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineExtensionUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineExtension"]: """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -257,7 +264,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -283,7 +290,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -389,7 +403,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -410,7 +431,7 @@ async def get( vm_extension_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtension": + ) -> "_models.VirtualMachineExtension": """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -426,7 +447,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +497,7 @@ async def list( vm_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtensionsListResult": + ) -> "_models.VirtualMachineExtensionsListResult": """The operation to get all extensions of a Virtual Machine. :param resource_group_name: The name of the resource group. @@ -490,7 +511,7 @@ async def list( :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtensionsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_images_operations.py index 518092982372..c40c3925ba8b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VirtualMachineImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( skus: str, version: str, **kwargs - ) -> "models.VirtualMachineImage": + ) -> "_models.VirtualMachineImage": """Gets a virtual machine image. :param location: The name of a supported Azure region. @@ -66,7 +66,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,7 +120,7 @@ async def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. @@ -143,7 +143,7 @@ async def list( :rtype: list[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -197,7 +197,7 @@ async def list_offers( location: str, publisher_name: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image offers for the specified location and publisher. :param location: The name of a supported Azure region. @@ -209,7 +209,7 @@ async def list_offers( :rtype: list[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -254,7 +254,7 @@ async def list_publishers( self, location: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image publishers for the specified Azure location. :param location: The name of a supported Azure region. @@ -264,7 +264,7 @@ async def list_publishers( :rtype: list[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -310,7 +310,7 @@ async def list_skus( publisher_name: str, offer: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. :param location: The name of a supported Azure region. @@ -324,7 +324,7 @@ async def list_skus( :rtype: list[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_run_commands_operations.py index d9f192b9564f..10d5e664a1c5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VirtualMachineRunCommandsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.RunCommandListResult"]: + ) -> AsyncIterable["_models.RunCommandListResult"]: """Lists all available run commands for a subscription in a location. :param location: The location upon which run commands is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.RunCommandListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ async def get( location: str, command_id: str, **kwargs - ) -> "models.RunCommandDocument": + ) -> "_models.RunCommandDocument": """Gets specific run command for a subscription in a location. :param location: The location upon which run commands is queried. @@ -128,7 +128,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.RunCommandDocument :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandDocument"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index 2bcf8b4a69df..13065dbfd76a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetExtensionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, vm_scale_set_name: str, vmss_extension_name: str, - extension_parameters: "models.VirtualMachineScaleSetExtension", + extension_parameters: "_models.VirtualMachineScaleSetExtension", **kwargs - ) -> "models.VirtualMachineScaleSetExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + ) -> "_models.VirtualMachineScaleSetExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def begin_create_or_update( resource_group_name: str, vm_scale_set_name: str, vmss_extension_name: str, - extension_parameters: "models.VirtualMachineScaleSetExtension", + extension_parameters: "_models.VirtualMachineScaleSetExtension", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSetExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSetExtension"]: """The operation to create or update an extension. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -178,10 +185,10 @@ async def _update_initial( resource_group_name: str, vm_scale_set_name: str, vmss_extension_name: str, - extension_parameters: "models.VirtualMachineScaleSetExtensionUpdate", + extension_parameters: "_models.VirtualMachineScaleSetExtensionUpdate", **kwargs - ) -> "models.VirtualMachineScaleSetExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + ) -> "_models.VirtualMachineScaleSetExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -237,9 +244,9 @@ async def begin_update( resource_group_name: str, vm_scale_set_name: str, vmss_extension_name: str, - extension_parameters: "models.VirtualMachineScaleSetExtensionUpdate", + extension_parameters: "_models.VirtualMachineScaleSetExtensionUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSetExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSetExtension"]: """The operation to update an extension. :param resource_group_name: The name of the resource group. @@ -262,7 +269,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -288,7 +295,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -394,7 +408,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -415,7 +436,7 @@ async def get( vmss_extension_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineScaleSetExtension": + ) -> "_models.VirtualMachineScaleSetExtension": """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -431,7 +452,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -480,7 +501,7 @@ def list( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetExtensionListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetExtensionListResult"]: """Gets a list of all extensions in a VM scale set. :param resource_group_name: The name of the resource group. @@ -492,7 +513,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetExtensionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtensionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index b5031277ce71..9b28efd10ead 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VirtualMachineScaleSetRollingUpgradesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -128,7 +128,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -230,7 +236,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -332,7 +344,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -351,7 +369,7 @@ async def get_latest( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.RollingUpgradeStatusInfo": + ) -> "_models.RollingUpgradeStatusInfo": """Gets the status of the latest virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -363,7 +381,7 @@ async def get_latest( :rtype: ~azure.mgmt.compute.v2019_07_01.models.RollingUpgradeStatusInfo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RollingUpgradeStatusInfo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 81e5b66da904..32faf1a8921d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VirtualMachineScaleSetVMExtensionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( vm_scale_set_name: str, instance_id: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineExtension", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,9 +109,9 @@ async def begin_create_or_update( vm_scale_set_name: str, instance_id: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineExtension", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineExtension"]: """The operation to create or update the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -136,7 +136,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -183,10 +191,10 @@ async def _update_initial( vm_scale_set_name: str, instance_id: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineExtensionUpdate", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -240,9 +248,9 @@ async def begin_update( vm_scale_set_name: str, instance_id: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineExtensionUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineExtension"]: """The operation to update the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -267,7 +275,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -294,7 +302,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -408,7 +424,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -430,7 +454,7 @@ async def get( vm_extension_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtension": + ) -> "_models.VirtualMachineExtension": """The operation to get the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -448,7 +472,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +524,7 @@ async def list( instance_id: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtensionsListResult": + ) -> "_models.VirtualMachineExtensionsListResult": """The operation to get all extensions of an instance in Virtual Machine Scaleset. :param resource_group_name: The name of the resource group. @@ -516,7 +540,7 @@ async def list( :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtensionsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 49a41921e880..bed28963074c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetVMsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def _reimage_initial( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - vm_scale_set_vm_reimage_input: Optional["models.VirtualMachineReimageParameters"] = None, + vm_scale_set_vm_reimage_input: Optional["_models.VirtualMachineReimageParameters"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -101,7 +101,7 @@ async def begin_reimage( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - vm_scale_set_vm_reimage_input: Optional["models.VirtualMachineReimageParameters"] = None, + vm_scale_set_vm_reimage_input: Optional["_models.VirtualMachineReimageParameters"] = None, **kwargs ) -> AsyncLROPoller[None]: """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. @@ -148,7 +148,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -255,7 +262,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -363,7 +377,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -382,10 +403,10 @@ async def _update_initial( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.VirtualMachineScaleSetVM", + parameters: "_models.VirtualMachineScaleSetVM", **kwargs - ) -> "models.VirtualMachineScaleSetVM": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + ) -> "_models.VirtualMachineScaleSetVM": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -441,9 +462,9 @@ async def begin_update( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.VirtualMachineScaleSetVM", + parameters: "_models.VirtualMachineScaleSetVM", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSetVM"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSetVM"]: """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. @@ -466,7 +487,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -492,7 +513,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -598,7 +626,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -619,7 +654,7 @@ async def get( instance_id: str, expand: Optional[str] = "instanceView", **kwargs - ) -> "models.VirtualMachineScaleSetVM": + ) -> "_models.VirtualMachineScaleSetVM": """Gets a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -635,7 +670,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetVM :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -685,7 +720,7 @@ async def get_instance_view( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.VirtualMachineScaleSetVMInstanceView": + ) -> "_models.VirtualMachineScaleSetVMInstanceView": """Gets the status of a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -699,7 +734,7 @@ async def get_instance_view( :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetVMInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -749,7 +784,7 @@ def list( select: Optional[str] = None, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetVMListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetVMListResult"]: """Gets a list of all virtual machines in a VM scale sets. :param resource_group_name: The name of the resource group. @@ -770,7 +805,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetVMListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -936,7 +971,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1042,7 +1084,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1148,7 +1197,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1255,7 +1311,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1320,7 +1383,8 @@ async def begin_perform_maintenance( instance_id: str, **kwargs ) -> AsyncLROPoller[None]: - """Performs maintenance on a virtual machine in a VM scale set. + """Shuts down the virtual machine in a VMScaleSet, moves it to an already updated node, and powers + it back on during the self-service phase of planned maintenance. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1361,7 +1425,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1380,10 +1451,10 @@ async def _run_command_initial( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> Optional["models.RunCommandResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + ) -> Optional["_models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1437,9 +1508,9 @@ async def begin_run_command( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> AsyncLROPoller["models.RunCommandResult"]: + ) -> AsyncLROPoller["_models.RunCommandResult"]: """Run command on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1461,7 +1532,7 @@ async def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1487,7 +1558,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_sets_operations.py index d3eab805ba8e..ff65528cf4ef 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSet", + parameters: "_models.VirtualMachineScaleSet", **kwargs - ) -> "models.VirtualMachineScaleSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + ) -> "_models.VirtualMachineScaleSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSet", + parameters: "_models.VirtualMachineScaleSet", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSet"]: """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -169,10 +175,10 @@ async def _update_initial( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSetUpdate", + parameters: "_models.VirtualMachineScaleSetUpdate", **kwargs - ) -> "models.VirtualMachineScaleSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + ) -> "_models.VirtualMachineScaleSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -222,9 +228,9 @@ async def begin_update( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSetUpdate", + parameters: "_models.VirtualMachineScaleSetUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSet"]: """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -244,7 +250,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -269,7 +275,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -369,7 +381,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -388,7 +406,7 @@ async def get( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> "_models.VirtualMachineScaleSet": """Display information about a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -400,7 +418,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -445,7 +463,7 @@ async def _deallocate_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -496,7 +514,7 @@ async def begin_deallocate( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and @@ -542,7 +560,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -560,7 +584,7 @@ async def _delete_instances_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -608,7 +632,7 @@ async def begin_delete_instances( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs ) -> AsyncLROPoller[None]: """Deletes virtual machines in a VM scale set. @@ -652,7 +676,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -671,7 +701,7 @@ async def get_instance_view( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.VirtualMachineScaleSetInstanceView": + ) -> "_models.VirtualMachineScaleSetInstanceView": """Gets the status of a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -683,7 +713,7 @@ async def get_instance_view( :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -728,7 +758,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListResult"]: """Gets a list of all VM scale sets under a resource group. :param resource_group_name: The name of the resource group. @@ -738,7 +768,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -797,7 +827,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListWithLinkResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListWithLinkResult"]: """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. @@ -807,7 +837,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetListWithLinkResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListWithLinkResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -867,7 +897,7 @@ def list_skus( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListSkusResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListSkusResult"]: """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. @@ -880,7 +910,7 @@ def list_skus( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetListSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -942,7 +972,7 @@ def get_os_upgrade_history( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListOSUpgradeHistory"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListOSUpgradeHistory"]: """Gets list of OS upgrades on a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -954,7 +984,7 @@ def get_os_upgrade_history( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetListOSUpgradeHistory] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListOSUpgradeHistory"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1016,7 +1046,7 @@ async def _power_off_initial( resource_group_name: str, vm_scale_set_name: str, skip_shutdown: Optional[bool] = False, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1070,7 +1100,7 @@ async def begin_power_off( resource_group_name: str, vm_scale_set_name: str, skip_shutdown: Optional[bool] = False, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still @@ -1121,7 +1151,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1139,7 +1175,7 @@ async def _restart_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1190,7 +1226,7 @@ async def begin_restart( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Restarts one or more virtual machines in a VM scale set. @@ -1234,7 +1270,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1252,7 +1294,7 @@ async def _start_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1303,7 +1345,7 @@ async def begin_start( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Starts one or more virtual machines in a VM scale set. @@ -1347,7 +1389,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1365,7 +1413,7 @@ async def _redeploy_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1416,7 +1464,7 @@ async def begin_redeploy( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, @@ -1461,7 +1509,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1479,7 +1533,7 @@ async def _perform_maintenance_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1530,7 +1584,7 @@ async def begin_perform_maintenance( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances @@ -1577,7 +1631,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1595,7 +1655,7 @@ async def _update_instances_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1643,7 +1703,7 @@ async def begin_update_instances( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs ) -> AsyncLROPoller[None]: """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. @@ -1687,7 +1747,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1705,7 +1771,7 @@ async def _reimage_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_scale_set_reimage_input: Optional["models.VirtualMachineScaleSetReimageParameters"] = None, + vm_scale_set_reimage_input: Optional["_models.VirtualMachineScaleSetReimageParameters"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1756,7 +1822,7 @@ async def begin_reimage( self, resource_group_name: str, vm_scale_set_name: str, - vm_scale_set_reimage_input: Optional["models.VirtualMachineScaleSetReimageParameters"] = None, + vm_scale_set_reimage_input: Optional["_models.VirtualMachineScaleSetReimageParameters"] = None, **kwargs ) -> AsyncLROPoller[None]: """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which @@ -1802,7 +1868,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1820,7 +1892,7 @@ async def _reimage_all_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1871,7 +1943,7 @@ async def begin_reimage_all( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This @@ -1916,7 +1988,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1936,7 +2014,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( vm_scale_set_name: str, platform_update_domain: int, **kwargs - ) -> "models.RecoveryWalkResponse": + ) -> "_models.RecoveryWalkResponse": """Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. @@ -1952,7 +2030,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( :rtype: ~azure.mgmt.compute.v2019_07_01.models.RecoveryWalkResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryWalkResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1998,10 +2076,10 @@ async def convert_to_single_placement_group( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VMScaleSetConvertToSinglePlacementGroupInput", + parameters: "_models.VMScaleSetConvertToSinglePlacementGroupInput", **kwargs ) -> None: - """Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + """Converts SinglePlacementGroup property to true for a existing virtual machine scale set. :param resource_group_name: The name of the resource group. :type resource_group_name: str diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_sizes_operations.py index 19abb5da295c..5bc36af4b546 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_sizes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VirtualMachineSizesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """This API is deprecated. Use `Resources Skus `_. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machines_operations.py index 1d40e12f2a26..9a372fbb750f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machines_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachinesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list_by_location( self, location: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Gets all the virtual machines under the specified subscription for the specified location. :param location: The location for which virtual machines under the subscription are queried. @@ -57,7 +57,7 @@ def list_by_location( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,10 +117,10 @@ async def _capture_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineCaptureParameters", + parameters: "_models.VirtualMachineCaptureParameters", **kwargs - ) -> Optional["models.VirtualMachineCaptureResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + ) -> Optional["_models.VirtualMachineCaptureResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualMachineCaptureResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -172,9 +172,9 @@ async def begin_capture( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineCaptureParameters", + parameters: "_models.VirtualMachineCaptureParameters", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineCaptureResult"]: + ) -> AsyncLROPoller["_models.VirtualMachineCaptureResult"]: """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -195,7 +195,7 @@ async def begin_capture( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -220,7 +220,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -238,10 +244,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachine", + parameters: "_models.VirtualMachine", **kwargs - ) -> "models.VirtualMachine": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + ) -> "_models.VirtualMachine": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,9 +301,9 @@ async def begin_create_or_update( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachine", + parameters: "_models.VirtualMachine", **kwargs - ) -> AsyncLROPoller["models.VirtualMachine"]: + ) -> AsyncLROPoller["_models.VirtualMachine"]: """The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. @@ -318,7 +324,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -361,10 +373,10 @@ async def _update_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineUpdate", + parameters: "_models.VirtualMachineUpdate", **kwargs - ) -> "models.VirtualMachine": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + ) -> "_models.VirtualMachine": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -418,9 +430,9 @@ async def begin_update( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineUpdate", + parameters: "_models.VirtualMachineUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachine"]: + ) -> AsyncLROPoller["_models.VirtualMachine"]: """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -440,7 +452,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -465,7 +477,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -565,7 +583,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -585,7 +609,7 @@ async def get( vm_name: str, expand: Optional[str] = "instanceView", **kwargs - ) -> "models.VirtualMachine": + ) -> "_models.VirtualMachine": """Retrieves information about the model view or the instance view of a virtual machine. :param resource_group_name: The name of the resource group. @@ -599,7 +623,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachine :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -647,7 +671,7 @@ async def instance_view( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.VirtualMachineInstanceView": + ) -> "_models.VirtualMachineInstanceView": """Retrieves information about the run-time state of a virtual machine. :param resource_group_name: The name of the resource group. @@ -659,7 +683,7 @@ async def instance_view( :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -749,7 +773,12 @@ async def begin_convert_to_managed_disks( **kwargs ) -> AsyncLROPoller[None]: """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- - deallocated before invoking this operation. + deallocated before invoking this operation. :code:`
`For Windows, please refer to `Convert a + virtual machine from unmanaged disks to managed disks. `_.:code:`
`For Linux, + please refer to `Convert a virtual machine from unmanaged disks to managed disks. + `_. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -787,7 +816,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -888,7 +923,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -964,7 +1005,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. @@ -975,7 +1016,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1035,7 +1076,7 @@ def list_all( self, status_only: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. @@ -1047,7 +1088,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1109,7 +1150,7 @@ def list_available_sizes( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes to which the specified virtual machine can be resized. @@ -1122,7 +1163,7 @@ def list_available_sizes( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1275,7 +1316,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1377,7 +1424,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1477,7 +1530,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1577,7 +1636,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1677,7 +1742,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1695,7 +1766,7 @@ async def _reimage_initial( self, resource_group_name: str, vm_name: str, - parameters: Optional["models.VirtualMachineReimageParameters"] = None, + parameters: Optional["_models.VirtualMachineReimageParameters"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1746,7 +1817,7 @@ async def begin_reimage( self, resource_group_name: str, vm_name: str, - parameters: Optional["models.VirtualMachineReimageParameters"] = None, + parameters: Optional["_models.VirtualMachineReimageParameters"] = None, **kwargs ) -> AsyncLROPoller[None]: """Reimages the virtual machine which has an ephemeral OS disk back to its initial state. @@ -1790,7 +1861,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1852,7 +1929,8 @@ async def begin_perform_maintenance( vm_name: str, **kwargs ) -> AsyncLROPoller[None]: - """The operation to perform maintenance on a virtual machine. + """Shuts down the virtual machine, moves it to an already updated node, and powers it back on + during the self-service phase of planned maintenance. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1890,7 +1968,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1908,10 +1992,10 @@ async def _run_command_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> Optional["models.RunCommandResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + ) -> Optional["_models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1963,9 +2047,9 @@ async def begin_run_command( self, resource_group_name: str, vm_name: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> AsyncLROPoller["models.RunCommandResult"]: + ) -> AsyncLROPoller["_models.RunCommandResult"]: """Run command on the VM. :param resource_group_name: The name of the resource group. @@ -1985,7 +2069,7 @@ async def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2010,7 +2094,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/__init__.py index 8ecfb858cf4d..705444a63a8e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/__init__.py @@ -22,8 +22,6 @@ from ._models_py3 import BillingProfile from ._models_py3 import BootDiagnostics from ._models_py3 import BootDiagnosticsInstanceView - from ._models_py3 import Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties - from ._models_py3 import ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties from ._models_py3 import ComputeOperationListResult from ._models_py3 import ComputeOperationValue from ._models_py3 import CreationData @@ -161,6 +159,7 @@ from ._models_py3 import Usage from ._models_py3 import UsageName from ._models_py3 import UserArtifactSource + from ._models_py3 import UserAssignedIdentitiesValue from ._models_py3 import VMScaleSetConvertToSinglePlacementGroupInput from ._models_py3 import VaultCertificate from ._models_py3 import VaultSecretGroup @@ -190,6 +189,7 @@ from ._models_py3 import VirtualMachineScaleSetExtensionUpdate from ._models_py3 import VirtualMachineScaleSetIPConfiguration from ._models_py3 import VirtualMachineScaleSetIdentity + from ._models_py3 import VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue from ._models_py3 import VirtualMachineScaleSetInstanceView from ._models_py3 import VirtualMachineScaleSetInstanceViewStatusesSummary from ._models_py3 import VirtualMachineScaleSetIpTag @@ -251,8 +251,6 @@ from ._models import BillingProfile # type: ignore from ._models import BootDiagnostics # type: ignore from ._models import BootDiagnosticsInstanceView # type: ignore - from ._models import Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore - from ._models import ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore from ._models import ComputeOperationListResult # type: ignore from ._models import ComputeOperationValue # type: ignore from ._models import CreationData # type: ignore @@ -390,6 +388,7 @@ from ._models import Usage # type: ignore from ._models import UsageName # type: ignore from ._models import UserArtifactSource # type: ignore + from ._models import UserAssignedIdentitiesValue # type: ignore from ._models import VMScaleSetConvertToSinglePlacementGroupInput # type: ignore from ._models import VaultCertificate # type: ignore from ._models import VaultSecretGroup # type: ignore @@ -419,6 +418,7 @@ from ._models import VirtualMachineScaleSetExtensionUpdate # type: ignore from ._models import VirtualMachineScaleSetIPConfiguration # type: ignore from ._models import VirtualMachineScaleSetIdentity # type: ignore + from ._models import VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue # type: ignore from ._models import VirtualMachineScaleSetInstanceView # type: ignore from ._models import VirtualMachineScaleSetInstanceViewStatusesSummary # type: ignore from ._models import VirtualMachineScaleSetIpTag # type: ignore @@ -529,8 +529,6 @@ 'BillingProfile', 'BootDiagnostics', 'BootDiagnosticsInstanceView', - 'Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties', - 'ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties', 'ComputeOperationListResult', 'ComputeOperationValue', 'CreationData', @@ -668,6 +666,7 @@ 'Usage', 'UsageName', 'UserArtifactSource', + 'UserAssignedIdentitiesValue', 'VMScaleSetConvertToSinglePlacementGroupInput', 'VaultCertificate', 'VaultSecretGroup', @@ -697,6 +696,7 @@ 'VirtualMachineScaleSetExtensionUpdate', 'VirtualMachineScaleSetIPConfiguration', 'VirtualMachineScaleSetIdentity', + 'VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue', 'VirtualMachineScaleSetInstanceView', 'VirtualMachineScaleSetInstanceViewStatusesSummary', 'VirtualMachineScaleSetIpTag', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models.py index 584b6625cf2c..7ea5aff57707 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models.py @@ -572,66 +572,6 @@ def __init__( self.status = None -class Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - class ComputeOperationListResult(msrest.serialization.Model): """The List Compute Operation operation response. @@ -5988,6 +5928,36 @@ def __init__( self.media_link = kwargs['media_link'] +class UserAssignedIdentitiesValue(msrest.serialization.Model): + """UserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class VaultCertificate(msrest.serialization.Model): """Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM. @@ -6672,7 +6642,7 @@ class VirtualMachineIdentity(msrest.serialization.Model): Machine. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :type user_assigned_identities: dict[str, - ~azure.mgmt.compute.v2019_07_01.models.Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties] + ~azure.mgmt.compute.v2019_07_01.models.UserAssignedIdentitiesValue] """ _validation = { @@ -6684,7 +6654,7 @@ class VirtualMachineIdentity(msrest.serialization.Model): 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentitiesValue}'}, } def __init__( @@ -7344,7 +7314,7 @@ class VirtualMachineScaleSetIdentity(msrest.serialization.Model): form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :type user_assigned_identities: dict[str, - ~azure.mgmt.compute.v2019_07_01.models.ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties] + ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue] """ _validation = { @@ -7356,7 +7326,7 @@ class VirtualMachineScaleSetIdentity(msrest.serialization.Model): 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue}'}, } def __init__( @@ -7370,6 +7340,36 @@ def __init__( self.user_assigned_identities = kwargs.get('user_assigned_identities', None) +class VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue(msrest.serialization.Model): + """VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class VirtualMachineScaleSetInstanceView(msrest.serialization.Model): """The instance view of a virtual machine scale set. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models_py3.py index d0dee155848a..fdb9722539de 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models_py3.py @@ -630,66 +630,6 @@ def __init__( self.status = None -class Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - class ComputeOperationListResult(msrest.serialization.Model): """The List Compute Operation operation response. @@ -6582,6 +6522,36 @@ def __init__( self.media_link = media_link +class UserAssignedIdentitiesValue(msrest.serialization.Model): + """UserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class VaultCertificate(msrest.serialization.Model): """Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM. @@ -7344,7 +7314,7 @@ class VirtualMachineIdentity(msrest.serialization.Model): Machine. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :type user_assigned_identities: dict[str, - ~azure.mgmt.compute.v2019_07_01.models.Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties] + ~azure.mgmt.compute.v2019_07_01.models.UserAssignedIdentitiesValue] """ _validation = { @@ -7356,14 +7326,14 @@ class VirtualMachineIdentity(msrest.serialization.Model): 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentitiesValue}'}, } def __init__( self, *, type: Optional[Union[str, "ResourceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, "Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + user_assigned_identities: Optional[Dict[str, "UserAssignedIdentitiesValue"]] = None, **kwargs ): super(VirtualMachineIdentity, self).__init__(**kwargs) @@ -8105,7 +8075,7 @@ class VirtualMachineScaleSetIdentity(msrest.serialization.Model): form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :type user_assigned_identities: dict[str, - ~azure.mgmt.compute.v2019_07_01.models.ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties] + ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue] """ _validation = { @@ -8117,14 +8087,14 @@ class VirtualMachineScaleSetIdentity(msrest.serialization.Model): 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue}'}, } def __init__( self, *, type: Optional[Union[str, "ResourceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, "ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + user_assigned_identities: Optional[Dict[str, "VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue"]] = None, **kwargs ): super(VirtualMachineScaleSetIdentity, self).__init__(**kwargs) @@ -8134,6 +8104,36 @@ def __init__( self.user_assigned_identities = user_assigned_identities +class VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue(msrest.serialization.Model): + """VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class VirtualMachineScaleSetInstanceView(msrest.serialization.Model): """The instance view of a virtual machine scale set. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_availability_sets_operations.py index a0ed9710019e..dc5c5e4e98be 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_availability_sets_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailabilitySetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str availability_set_name, # type: str - parameters, # type: "models.AvailabilitySet" + parameters, # type: "_models.AvailabilitySet" **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Create or update an availability set. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~azure.mgmt.compute.v2019_07_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,10 +116,10 @@ def update( self, resource_group_name, # type: str availability_set_name, # type: str - parameters, # type: "models.AvailabilitySetUpdate" + parameters, # type: "_models.AvailabilitySetUpdate" **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Update an availability set. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ def update( :rtype: ~azure.mgmt.compute.v2019_07_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -239,7 +239,7 @@ def get( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Retrieves information about an availability set. :param resource_group_name: The name of the resource group. @@ -251,7 +251,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -297,7 +297,7 @@ def list_by_subscription( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailabilitySetListResult"] + # type: (...) -> Iterable["_models.AvailabilitySetListResult"] """Lists all availability sets in a subscription. :param expand: The expand expression to apply to the operation. Allowed values are @@ -308,7 +308,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -370,7 +370,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailabilitySetListResult"] + # type: (...) -> Iterable["_models.AvailabilitySetListResult"] """Lists all availability sets in a resource group. :param resource_group_name: The name of the resource group. @@ -380,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -442,7 +442,7 @@ def list_available_sizes( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. @@ -455,7 +455,7 @@ def list_available_sizes( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_host_groups_operations.py index 56e76a23bb3c..be177b16e776 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_host_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DedicatedHostGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str host_group_name, # type: str - parameters, # type: "models.DedicatedHostGroup" + parameters, # type: "_models.DedicatedHostGroup" **kwargs # type: Any ): - # type: (...) -> "models.DedicatedHostGroup" + # type: (...) -> "_models.DedicatedHostGroup" """Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.compute.v2019_07_01.models.DedicatedHostGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,10 +122,10 @@ def update( self, resource_group_name, # type: str host_group_name, # type: str - parameters, # type: "models.DedicatedHostGroupUpdate" + parameters, # type: "_models.DedicatedHostGroupUpdate" **kwargs # type: Any ): - # type: (...) -> "models.DedicatedHostGroup" + # type: (...) -> "_models.DedicatedHostGroup" """Update an dedicated host group. :param resource_group_name: The name of the resource group. @@ -139,7 +139,7 @@ def update( :rtype: ~azure.mgmt.compute.v2019_07_01.models.DedicatedHostGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -245,7 +245,7 @@ def get( host_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DedicatedHostGroup" + # type: (...) -> "_models.DedicatedHostGroup" """Retrieves information about a dedicated host group. :param resource_group_name: The name of the resource group. @@ -257,7 +257,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.DedicatedHostGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,7 +303,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DedicatedHostGroupListResult"] + # type: (...) -> Iterable["_models.DedicatedHostGroupListResult"] """Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. @@ -314,7 +314,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.DedicatedHostGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -374,7 +374,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DedicatedHostGroupListResult"] + # type: (...) -> Iterable["_models.DedicatedHostGroupListResult"] """Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. @@ -383,7 +383,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.DedicatedHostGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_hosts_operations.py index 104ef2bd87dd..31c44a8c6494 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DedicatedHostsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str host_group_name, # type: str host_name, # type: str - parameters, # type: "models.DedicatedHost" + parameters, # type: "_models.DedicatedHost" **kwargs # type: Any ): - # type: (...) -> "models.DedicatedHost" - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + # type: (...) -> "_models.DedicatedHost" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def begin_create_or_update( resource_group_name, # type: str host_group_name, # type: str host_name, # type: str - parameters, # type: "models.DedicatedHost" + parameters, # type: "_models.DedicatedHost" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DedicatedHost"] + # type: (...) -> LROPoller["_models.DedicatedHost"] """Create or update a dedicated host . :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -182,11 +189,11 @@ def _update_initial( resource_group_name, # type: str host_group_name, # type: str host_name, # type: str - parameters, # type: "models.DedicatedHostUpdate" + parameters, # type: "_models.DedicatedHostUpdate" **kwargs # type: Any ): - # type: (...) -> "models.DedicatedHost" - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + # type: (...) -> "_models.DedicatedHost" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -238,10 +245,10 @@ def begin_update( resource_group_name, # type: str host_group_name, # type: str host_name, # type: str - parameters, # type: "models.DedicatedHostUpdate" + parameters, # type: "_models.DedicatedHostUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DedicatedHost"] + # type: (...) -> LROPoller["_models.DedicatedHost"] """Update an dedicated host . :param resource_group_name: The name of the resource group. @@ -263,7 +270,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -289,7 +296,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -397,7 +411,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -419,7 +440,7 @@ def get( expand="instanceView", # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.DedicatedHost" + # type: (...) -> "_models.DedicatedHost" """Retrieves information about a dedicated host. :param resource_group_name: The name of the resource group. @@ -435,7 +456,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.DedicatedHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -485,7 +506,7 @@ def list_by_host_group( host_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DedicatedHostListResult"] + # type: (...) -> Iterable["_models.DedicatedHostListResult"] """Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. @@ -498,7 +519,7 @@ def list_by_host_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.DedicatedHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disk_encryption_sets_operations.py index 6522127dd2b8..7c5029c98c6d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disk_encryption_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DiskEncryptionSetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str disk_encryption_set_name, # type: str - disk_encryption_set, # type: "models.DiskEncryptionSet" + disk_encryption_set, # type: "_models.DiskEncryptionSet" **kwargs # type: Any ): - # type: (...) -> "models.DiskEncryptionSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + # type: (...) -> "_models.DiskEncryptionSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str disk_encryption_set_name, # type: str - disk_encryption_set, # type: "models.DiskEncryptionSet" + disk_encryption_set, # type: "_models.DiskEncryptionSet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DiskEncryptionSet"] + # type: (...) -> LROPoller["_models.DiskEncryptionSet"] """Creates or updates a disk encryption set. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -160,7 +160,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_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: @@ -178,11 +184,11 @@ def _update_initial( self, resource_group_name, # type: str disk_encryption_set_name, # type: str - disk_encryption_set, # type: "models.DiskEncryptionSetUpdate" + disk_encryption_set, # type: "_models.DiskEncryptionSetUpdate" **kwargs # type: Any ): - # type: (...) -> "models.DiskEncryptionSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + # type: (...) -> "_models.DiskEncryptionSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -236,10 +242,10 @@ def begin_update( self, resource_group_name, # type: str disk_encryption_set_name, # type: str - disk_encryption_set, # type: "models.DiskEncryptionSetUpdate" + disk_encryption_set, # type: "_models.DiskEncryptionSetUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DiskEncryptionSet"] + # type: (...) -> LROPoller["_models.DiskEncryptionSet"] """Updates (patches) a disk encryption set. :param resource_group_name: The name of the resource group. @@ -262,7 +268,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -287,7 +293,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_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: @@ -307,7 +319,7 @@ def get( disk_encryption_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DiskEncryptionSet" + # type: (...) -> "_models.DiskEncryptionSet" """Gets information about a disk encryption set. :param resource_group_name: The name of the resource group. @@ -321,7 +333,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.DiskEncryptionSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -454,7 +466,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_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: @@ -473,7 +491,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskEncryptionSetList"] + # type: (...) -> Iterable["_models.DiskEncryptionSetList"] """Lists all the disk encryption sets under a resource group. :param resource_group_name: The name of the resource group. @@ -483,7 +501,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.DiskEncryptionSetList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSetList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSetList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -543,7 +561,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskEncryptionSetList"] + # type: (...) -> Iterable["_models.DiskEncryptionSetList"] """Lists all the disk encryption sets under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -551,7 +569,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.DiskEncryptionSetList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSetList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSetList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disks_operations.py index d115b157018c..c680f40f1c30 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DisksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.Disk" + disk, # type: "_models.Disk" **kwargs # type: Any ): - # type: (...) -> "models.Disk" - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + # type: (...) -> "_models.Disk" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.Disk" + disk, # type: "_models.Disk" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Disk"] + # type: (...) -> LROPoller["_models.Disk"] """Creates or updates a disk. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -177,11 +183,11 @@ def _update_initial( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.DiskUpdate" + disk, # type: "_models.DiskUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Disk" - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + # type: (...) -> "_models.Disk" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,10 +241,10 @@ def begin_update( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.DiskUpdate" + disk, # type: "_models.DiskUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Disk"] + # type: (...) -> LROPoller["_models.Disk"] """Updates (patches) a disk. :param resource_group_name: The name of the resource group. @@ -260,7 +266,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -285,7 +291,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -305,7 +317,7 @@ def get( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Disk" + # type: (...) -> "_models.Disk" """Gets information about a disk. :param resource_group_name: The name of the resource group. @@ -319,7 +331,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.Disk :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -450,7 +462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -469,7 +487,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskList"] + # type: (...) -> Iterable["_models.DiskList"] """Lists all the disks under a resource group. :param resource_group_name: The name of the resource group. @@ -479,7 +497,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -539,7 +557,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskList"] + # type: (...) -> Iterable["_models.DiskList"] """Lists all the disks under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -547,7 +565,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -606,11 +624,11 @@ def _grant_access_initial( self, resource_group_name, # type: str disk_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> Optional["models.AccessUri"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + # type: (...) -> Optional["_models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -662,10 +680,10 @@ def begin_grant_access( self, resource_group_name, # type: str disk_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AccessUri"] + # type: (...) -> LROPoller["_models.AccessUri"] """Grants access to a disk. :param resource_group_name: The name of the resource group. @@ -688,7 +706,7 @@ def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -713,7 +731,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -817,7 +841,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_galleries_operations.py index 9cd47db0ba97..2340ea13deb3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_galleries_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class GalleriesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gallery_name, # type: str - gallery, # type: "models.Gallery" + gallery, # type: "_models.Gallery" **kwargs # type: Any ): - # type: (...) -> "models.Gallery" - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + # type: (...) -> "_models.Gallery" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gallery_name, # type: str - gallery, # type: "models.Gallery" + gallery, # type: "_models.Gallery" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Gallery"] + # type: (...) -> LROPoller["_models.Gallery"] """Create or update a Shared Image Gallery. :param resource_group_name: The name of the resource group. @@ -136,7 +136,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -161,7 +161,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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: @@ -179,11 +185,11 @@ def _update_initial( self, resource_group_name, # type: str gallery_name, # type: str - gallery, # type: "models.GalleryUpdate" + gallery, # type: "_models.GalleryUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Gallery" - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + # type: (...) -> "_models.Gallery" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -233,10 +239,10 @@ def begin_update( self, resource_group_name, # type: str gallery_name, # type: str - gallery, # type: "models.GalleryUpdate" + gallery, # type: "_models.GalleryUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Gallery"] + # type: (...) -> LROPoller["_models.Gallery"] """Update a Shared Image Gallery. :param resource_group_name: The name of the resource group. @@ -257,7 +263,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -282,7 +288,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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: @@ -302,7 +314,7 @@ def get( gallery_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Gallery" + # type: (...) -> "_models.Gallery" """Retrieves information about a Shared Image Gallery. :param resource_group_name: The name of the resource group. @@ -314,7 +326,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.Gallery :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -445,7 +457,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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: @@ -464,7 +482,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.GalleryList"] + # type: (...) -> Iterable["_models.GalleryList"] """List galleries under a resource group. :param resource_group_name: The name of the resource group. @@ -474,7 +492,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.GalleryList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -534,7 +552,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.GalleryList"] + # type: (...) -> Iterable["_models.GalleryList"] """List galleries under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -542,7 +560,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.GalleryList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_application_versions_operations.py index ce1681a1cdaa..f6279478517f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_application_versions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class GalleryApplicationVersionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,11 +53,11 @@ def _create_or_update_initial( gallery_name, # type: str gallery_application_name, # type: str gallery_application_version_name, # type: str - gallery_application_version, # type: "models.GalleryApplicationVersion" + gallery_application_version, # type: "_models.GalleryApplicationVersion" **kwargs # type: Any ): - # type: (...) -> "models.GalleryApplicationVersion" - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] + # type: (...) -> "_models.GalleryApplicationVersion" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,10 +118,10 @@ def begin_create_or_update( gallery_name, # type: str gallery_application_name, # type: str gallery_application_version_name, # type: str - gallery_application_version, # type: "models.GalleryApplicationVersion" + gallery_application_version, # type: "_models.GalleryApplicationVersion" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GalleryApplicationVersion"] + # type: (...) -> LROPoller["_models.GalleryApplicationVersion"] """Create or update a gallery Application Version. :param resource_group_name: The name of the resource group. @@ -151,7 +151,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -178,7 +178,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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: @@ -198,11 +206,11 @@ def _update_initial( gallery_name, # type: str gallery_application_name, # type: str gallery_application_version_name, # type: str - gallery_application_version, # type: "models.GalleryApplicationVersionUpdate" + gallery_application_version, # type: "_models.GalleryApplicationVersionUpdate" **kwargs # type: Any ): - # type: (...) -> "models.GalleryApplicationVersion" - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] + # type: (...) -> "_models.GalleryApplicationVersion" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -256,10 +264,10 @@ def begin_update( gallery_name, # type: str gallery_application_name, # type: str gallery_application_version_name, # type: str - gallery_application_version, # type: "models.GalleryApplicationVersionUpdate" + gallery_application_version, # type: "_models.GalleryApplicationVersionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GalleryApplicationVersion"] + # type: (...) -> LROPoller["_models.GalleryApplicationVersion"] """Update a gallery Application Version. :param resource_group_name: The name of the resource group. @@ -289,7 +297,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +324,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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: @@ -336,10 +352,10 @@ def get( gallery_name, # type: str gallery_application_name, # type: str gallery_application_version_name, # type: str - expand=None, # type: Optional[Union[str, "models.ReplicationStatusTypes"]] + expand=None, # type: Optional[Union[str, "_models.ReplicationStatusTypes"]] **kwargs # type: Any ): - # type: (...) -> "models.GalleryApplicationVersion" + # type: (...) -> "_models.GalleryApplicationVersion" """Retrieves information about a gallery Application Version. :param resource_group_name: The name of the resource group. @@ -360,7 +376,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.GalleryApplicationVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -510,7 +526,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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: @@ -531,7 +555,7 @@ def list_by_gallery_application( gallery_application_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.GalleryApplicationVersionList"] + # type: (...) -> Iterable["_models.GalleryApplicationVersionList"] """List gallery Application Versions in a gallery Application Definition. :param resource_group_name: The name of the resource group. @@ -547,7 +571,7 @@ def list_by_gallery_application( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.GalleryApplicationVersionList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_applications_operations.py index 53b4a51e9805..2865e9aeb0d8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_applications_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class GalleryApplicationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str gallery_name, # type: str gallery_application_name, # type: str - gallery_application, # type: "models.GalleryApplication" + gallery_application, # type: "_models.GalleryApplication" **kwargs # type: Any ): - # type: (...) -> "models.GalleryApplication" - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] + # type: (...) -> "_models.GalleryApplication" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,10 +115,10 @@ def begin_create_or_update( resource_group_name, # type: str gallery_name, # type: str gallery_application_name, # type: str - gallery_application, # type: "models.GalleryApplication" + gallery_application, # type: "_models.GalleryApplication" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GalleryApplication"] + # type: (...) -> LROPoller["_models.GalleryApplication"] """Create or update a gallery Application Definition. :param resource_group_name: The name of the resource group. @@ -144,7 +144,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -170,7 +170,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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: @@ -189,11 +196,11 @@ def _update_initial( resource_group_name, # type: str gallery_name, # type: str gallery_application_name, # type: str - gallery_application, # type: "models.GalleryApplicationUpdate" + gallery_application, # type: "_models.GalleryApplicationUpdate" **kwargs # type: Any ): - # type: (...) -> "models.GalleryApplication" - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] + # type: (...) -> "_models.GalleryApplication" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -245,10 +252,10 @@ def begin_update( resource_group_name, # type: str gallery_name, # type: str gallery_application_name, # type: str - gallery_application, # type: "models.GalleryApplicationUpdate" + gallery_application, # type: "_models.GalleryApplicationUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GalleryApplication"] + # type: (...) -> LROPoller["_models.GalleryApplication"] """Update a gallery Application Definition. :param resource_group_name: The name of the resource group. @@ -273,7 +280,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -299,7 +306,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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: @@ -320,7 +334,7 @@ def get( gallery_application_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GalleryApplication" + # type: (...) -> "_models.GalleryApplication" """Retrieves information about a gallery Application Definition. :param resource_group_name: The name of the resource group. @@ -336,7 +350,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.GalleryApplication :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -475,7 +489,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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: @@ -495,7 +516,7 @@ def list_by_gallery( gallery_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.GalleryApplicationList"] + # type: (...) -> Iterable["_models.GalleryApplicationList"] """List gallery Application Definitions in a gallery. :param resource_group_name: The name of the resource group. @@ -508,7 +529,7 @@ def list_by_gallery( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.GalleryApplicationList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_image_versions_operations.py index 75b4345620f7..45b283b5a481 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_image_versions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class GalleryImageVersionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,11 +53,11 @@ def _create_or_update_initial( gallery_name, # type: str gallery_image_name, # type: str gallery_image_version_name, # type: str - gallery_image_version, # type: "models.GalleryImageVersion" + gallery_image_version, # type: "_models.GalleryImageVersion" **kwargs # type: Any ): - # type: (...) -> "models.GalleryImageVersion" - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + # type: (...) -> "_models.GalleryImageVersion" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,10 +118,10 @@ def begin_create_or_update( gallery_name, # type: str gallery_image_name, # type: str gallery_image_version_name, # type: str - gallery_image_version, # type: "models.GalleryImageVersion" + gallery_image_version, # type: "_models.GalleryImageVersion" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GalleryImageVersion"] + # type: (...) -> LROPoller["_models.GalleryImageVersion"] """Create or update a gallery Image Version. :param resource_group_name: The name of the resource group. @@ -151,7 +151,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -178,7 +178,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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: @@ -198,11 +206,11 @@ def _update_initial( gallery_name, # type: str gallery_image_name, # type: str gallery_image_version_name, # type: str - gallery_image_version, # type: "models.GalleryImageVersionUpdate" + gallery_image_version, # type: "_models.GalleryImageVersionUpdate" **kwargs # type: Any ): - # type: (...) -> "models.GalleryImageVersion" - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + # type: (...) -> "_models.GalleryImageVersion" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -256,10 +264,10 @@ def begin_update( gallery_name, # type: str gallery_image_name, # type: str gallery_image_version_name, # type: str - gallery_image_version, # type: "models.GalleryImageVersionUpdate" + gallery_image_version, # type: "_models.GalleryImageVersionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GalleryImageVersion"] + # type: (...) -> LROPoller["_models.GalleryImageVersion"] """Update a gallery Image Version. :param resource_group_name: The name of the resource group. @@ -289,7 +297,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +324,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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: @@ -336,10 +352,10 @@ def get( gallery_name, # type: str gallery_image_name, # type: str gallery_image_version_name, # type: str - expand=None, # type: Optional[Union[str, "models.ReplicationStatusTypes"]] + expand=None, # type: Optional[Union[str, "_models.ReplicationStatusTypes"]] **kwargs # type: Any ): - # type: (...) -> "models.GalleryImageVersion" + # type: (...) -> "_models.GalleryImageVersion" """Retrieves information about a gallery Image Version. :param resource_group_name: The name of the resource group. @@ -359,7 +375,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.GalleryImageVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -508,7 +524,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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: @@ -529,7 +553,7 @@ def list_by_gallery_image( gallery_image_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.GalleryImageVersionList"] + # type: (...) -> Iterable["_models.GalleryImageVersionList"] """List gallery Image Versions in a gallery Image Definition. :param resource_group_name: The name of the resource group. @@ -545,7 +569,7 @@ def list_by_gallery_image( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.GalleryImageVersionList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_images_operations.py index 827af134a195..2a4e3c1f59a8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class GalleryImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str gallery_name, # type: str gallery_image_name, # type: str - gallery_image, # type: "models.GalleryImage" + gallery_image, # type: "_models.GalleryImage" **kwargs # type: Any ): - # type: (...) -> "models.GalleryImage" - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + # type: (...) -> "_models.GalleryImage" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,10 +115,10 @@ def begin_create_or_update( resource_group_name, # type: str gallery_name, # type: str gallery_image_name, # type: str - gallery_image, # type: "models.GalleryImage" + gallery_image, # type: "_models.GalleryImage" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GalleryImage"] + # type: (...) -> LROPoller["_models.GalleryImage"] """Create or update a gallery Image Definition. :param resource_group_name: The name of the resource group. @@ -143,7 +143,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -169,7 +169,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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: @@ -188,11 +195,11 @@ def _update_initial( resource_group_name, # type: str gallery_name, # type: str gallery_image_name, # type: str - gallery_image, # type: "models.GalleryImageUpdate" + gallery_image, # type: "_models.GalleryImageUpdate" **kwargs # type: Any ): - # type: (...) -> "models.GalleryImage" - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + # type: (...) -> "_models.GalleryImage" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -244,10 +251,10 @@ def begin_update( resource_group_name, # type: str gallery_name, # type: str gallery_image_name, # type: str - gallery_image, # type: "models.GalleryImageUpdate" + gallery_image, # type: "_models.GalleryImageUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GalleryImage"] + # type: (...) -> LROPoller["_models.GalleryImage"] """Update a gallery Image Definition. :param resource_group_name: The name of the resource group. @@ -272,7 +279,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -298,7 +305,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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: @@ -319,7 +333,7 @@ def get( gallery_image_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GalleryImage" + # type: (...) -> "_models.GalleryImage" """Retrieves information about a gallery Image Definition. :param resource_group_name: The name of the resource group. @@ -334,7 +348,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.GalleryImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -473,7 +487,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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: @@ -493,7 +514,7 @@ def list_by_gallery( gallery_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.GalleryImageList"] + # type: (...) -> Iterable["_models.GalleryImageList"] """List gallery Image Definitions in a gallery. :param resource_group_name: The name of the resource group. @@ -506,7 +527,7 @@ def list_by_gallery( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.GalleryImageList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_images_operations.py index 0c0bc21107e2..d4a789cd7229 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.Image" + parameters, # type: "_models.Image" **kwargs # type: Any ): - # type: (...) -> "models.Image" - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + # type: (...) -> "_models.Image" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.Image" + parameters, # type: "_models.Image" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Image"] + # type: (...) -> LROPoller["_models.Image"] """Create or update an image. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -175,11 +181,11 @@ def _update_initial( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.ImageUpdate" + parameters, # type: "_models.ImageUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Image" - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + # type: (...) -> "_models.Image" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -233,10 +239,10 @@ def begin_update( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.ImageUpdate" + parameters, # type: "_models.ImageUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Image"] + # type: (...) -> LROPoller["_models.Image"] """Update an image. :param resource_group_name: The name of the resource group. @@ -256,7 +262,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -281,7 +287,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -383,7 +395,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -404,7 +422,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Image" + # type: (...) -> "_models.Image" """Gets an image. :param resource_group_name: The name of the resource group. @@ -418,7 +436,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.Image :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +484,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ImageListResult"] + # type: (...) -> Iterable["_models.ImageListResult"] """Gets the list of images under a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +494,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -536,7 +554,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ImageListResult"] + # type: (...) -> Iterable["_models.ImageListResult"] """Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. @@ -545,7 +563,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_log_analytics_operations.py index 86a21c66ca59..4f6e078bd4a0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_log_analytics_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class LogAnalyticsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,11 +49,11 @@ def __init__(self, client, config, serializer, deserializer): def _export_request_rate_by_interval_initial( self, location, # type: str - parameters, # type: "models.RequestRateByIntervalInput" + parameters, # type: "_models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> Optional["models.LogAnalyticsOperationResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + # type: (...) -> Optional["_models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -103,10 +103,10 @@ def _export_request_rate_by_interval_initial( def begin_export_request_rate_by_interval( self, location, # type: str - parameters, # type: "models.RequestRateByIntervalInput" + parameters, # type: "_models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] + # type: (...) -> LROPoller["_models.LogAnalyticsOperationResult"] """Export logs that show Api requests made by this subscription in the given time window to show throttling activities. @@ -125,7 +125,7 @@ def begin_export_request_rate_by_interval( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -149,7 +149,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -166,11 +171,11 @@ def get_long_running_output(pipeline_response): def _export_throttled_requests_initial( self, location, # type: str - parameters, # type: "models.LogAnalyticsInputBase" + parameters, # type: "_models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> Optional["models.LogAnalyticsOperationResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + # type: (...) -> Optional["_models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,10 +225,10 @@ def _export_throttled_requests_initial( def begin_export_throttled_requests( self, location, # type: str - parameters, # type: "models.LogAnalyticsInputBase" + parameters, # type: "_models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] + # type: (...) -> LROPoller["_models.LogAnalyticsOperationResult"] """Export logs that show total throttled Api requests for this subscription in the given time window. @@ -242,7 +247,7 @@ def begin_export_throttled_requests( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -266,7 +271,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_operations.py index 884abc403246..6de71ca64e83 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ComputeOperationListResult"] + # type: (...) -> Iterable["_models.ComputeOperationListResult"] """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.ComputeOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeOperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_proximity_placement_groups_operations.py index 6f7d1528591d..8ce69a7298c5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_proximity_placement_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ProximityPlacementGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str proximity_placement_group_name, # type: str - parameters, # type: "models.ProximityPlacementGroup" + parameters, # type: "_models.ProximityPlacementGroup" **kwargs # type: Any ): - # type: (...) -> "models.ProximityPlacementGroup" + # type: (...) -> "_models.ProximityPlacementGroup" """Create or update a proximity placement group. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~azure.mgmt.compute.v2019_07_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,10 +120,10 @@ def update( self, resource_group_name, # type: str proximity_placement_group_name, # type: str - parameters, # type: "models.UpdateResource" + parameters, # type: "_models.UpdateResource" **kwargs # type: Any ): - # type: (...) -> "models.ProximityPlacementGroup" + # type: (...) -> "_models.ProximityPlacementGroup" """Update a proximity placement group. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def update( :rtype: ~azure.mgmt.compute.v2019_07_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -244,7 +244,7 @@ def get( include_colocation_status=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ProximityPlacementGroup" + # type: (...) -> "_models.ProximityPlacementGroup" """Retrieves information about a proximity placement group . :param resource_group_name: The name of the resource group. @@ -259,7 +259,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -306,7 +306,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProximityPlacementGroupListResult"] + # type: (...) -> Iterable["_models.ProximityPlacementGroupListResult"] """Lists all proximity placement groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -314,7 +314,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.ProximityPlacementGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -374,7 +374,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProximityPlacementGroupListResult"] + # type: (...) -> Iterable["_models.ProximityPlacementGroupListResult"] """Lists all proximity placement groups in a resource group. :param resource_group_name: The name of the resource group. @@ -384,7 +384,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.ProximityPlacementGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_snapshots_operations.py index e7a4e7191dc7..061dcbc74ae2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_snapshots_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SnapshotsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.Snapshot" + snapshot, # type: "_models.Snapshot" **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + # type: (...) -> "_models.Snapshot" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.Snapshot" + snapshot, # type: "_models.Snapshot" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Snapshot"] + # type: (...) -> LROPoller["_models.Snapshot"] """Creates or updates a snapshot. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -177,11 +183,11 @@ def _update_initial( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.SnapshotUpdate" + snapshot, # type: "_models.SnapshotUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + # type: (...) -> "_models.Snapshot" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,10 +241,10 @@ def begin_update( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.SnapshotUpdate" + snapshot, # type: "_models.SnapshotUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Snapshot"] + # type: (...) -> LROPoller["_models.Snapshot"] """Updates (patches) a snapshot. :param resource_group_name: The name of the resource group. @@ -260,7 +266,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -285,7 +291,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -305,7 +317,7 @@ def get( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" + # type: (...) -> "_models.Snapshot" """Gets information about a snapshot. :param resource_group_name: The name of the resource group. @@ -319,7 +331,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.Snapshot :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -450,7 +462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -469,7 +487,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SnapshotList"] + # type: (...) -> Iterable["_models.SnapshotList"] """Lists snapshots under a resource group. :param resource_group_name: The name of the resource group. @@ -479,7 +497,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -539,7 +557,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.SnapshotList"] + # type: (...) -> Iterable["_models.SnapshotList"] """Lists snapshots under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -547,7 +565,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -606,11 +624,11 @@ def _grant_access_initial( self, resource_group_name, # type: str snapshot_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> Optional["models.AccessUri"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + # type: (...) -> Optional["_models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -662,10 +680,10 @@ def begin_grant_access( self, resource_group_name, # type: str snapshot_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AccessUri"] + # type: (...) -> LROPoller["_models.AccessUri"] """Grants access to a snapshot. :param resource_group_name: The name of the resource group. @@ -688,7 +706,7 @@ def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -713,7 +731,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -817,7 +841,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_usage_operations.py index 15cffc568a8b..ce8b45dc92c3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsageOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListUsagesResult"] + # type: (...) -> Iterable["_models.ListUsagesResult"] """Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extension_images_operations.py index ac990a73e702..fc9094f0a093 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extension_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VirtualMachineExtensionImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( version, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtensionImage" + # type: (...) -> "_models.VirtualMachineExtensionImage" """Gets a virtual machine extension image. :param location: The name of a supported Azure region. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtensionImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def list_types( publisher_name, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineExtensionImage"] + # type: (...) -> List["_models.VirtualMachineExtensionImage"] """Gets a list of virtual machine extension image types. :param location: The name of a supported Azure region. @@ -129,7 +129,7 @@ def list_types( :rtype: list[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -180,7 +180,7 @@ def list_versions( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineExtensionImage"] + # type: (...) -> List["_models.VirtualMachineExtensionImage"] """Gets a list of virtual machine extension image versions. :param location: The name of a supported Azure region. @@ -200,7 +200,7 @@ def list_versions( :rtype: list[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extensions_operations.py index da482d663576..3cf5ba1f08cd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VirtualMachineExtensionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineExtension"] """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -183,11 +190,11 @@ def _update_initial( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -239,10 +246,10 @@ def begin_update( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineExtension"] """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -265,7 +272,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -291,7 +298,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -399,7 +413,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -421,7 +442,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" + # type: (...) -> "_models.VirtualMachineExtension" """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -437,7 +458,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,7 +509,7 @@ def list( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtensionsListResult" + # type: (...) -> "_models.VirtualMachineExtensionsListResult" """The operation to get all extensions of a Virtual Machine. :param resource_group_name: The name of the resource group. @@ -502,7 +523,7 @@ def list( :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtensionsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_images_operations.py index 2762eaaf7d7f..624a4787d2de 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VirtualMachineImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( version, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineImage" + # type: (...) -> "_models.VirtualMachineImage" """Gets a virtual machine image. :param location: The name of a supported Azure region. @@ -71,7 +71,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -126,7 +126,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. @@ -149,7 +149,7 @@ def list( :rtype: list[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -204,7 +204,7 @@ def list_offers( publisher_name, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image offers for the specified location and publisher. :param location: The name of a supported Azure region. @@ -216,7 +216,7 @@ def list_offers( :rtype: list[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,7 +262,7 @@ def list_publishers( location, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image publishers for the specified Azure location. :param location: The name of a supported Azure region. @@ -272,7 +272,7 @@ def list_publishers( :rtype: list[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -319,7 +319,7 @@ def list_skus( offer, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. :param location: The name of a supported Azure region. @@ -333,7 +333,7 @@ def list_skus( :rtype: list[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_run_commands_operations.py index 2a25ef59366f..118665e79827 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_run_commands_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VirtualMachineRunCommandsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RunCommandListResult"] + # type: (...) -> Iterable["_models.RunCommandListResult"] """Lists all available run commands for a subscription in a location. :param location: The location upon which run commands is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.RunCommandListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def get( command_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RunCommandDocument" + # type: (...) -> "_models.RunCommandDocument" """Gets specific run command for a subscription in a location. :param location: The location upon which run commands is queried. @@ -134,7 +134,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.RunCommandDocument :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandDocument"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_extensions_operations.py index ef05948334b1..040f248dbc7b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetExtensionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str vm_scale_set_name, # type: str vmss_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineScaleSetExtension" + extension_parameters, # type: "_models.VirtualMachineScaleSetExtension" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + # type: (...) -> "_models.VirtualMachineScaleSetExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def begin_create_or_update( resource_group_name, # type: str vm_scale_set_name, # type: str vmss_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineScaleSetExtension" + extension_parameters, # type: "_models.VirtualMachineScaleSetExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSetExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSetExtension"] """The operation to create or update an extension. :param resource_group_name: The name of the resource group. @@ -139,7 +139,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -165,7 +165,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -184,11 +191,11 @@ def _update_initial( resource_group_name, # type: str vm_scale_set_name, # type: str vmss_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineScaleSetExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineScaleSetExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + # type: (...) -> "_models.VirtualMachineScaleSetExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -244,10 +251,10 @@ def begin_update( resource_group_name, # type: str vm_scale_set_name, # type: str vmss_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineScaleSetExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineScaleSetExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSetExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSetExtension"] """The operation to update an extension. :param resource_group_name: The name of the resource group. @@ -270,7 +277,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -296,7 +303,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -404,7 +418,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -426,7 +447,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetExtension" + # type: (...) -> "_models.VirtualMachineScaleSetExtension" """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -442,7 +463,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -492,7 +513,7 @@ def list( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetExtensionListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetExtensionListResult"] """Gets a list of all extensions in a VM scale set. :param resource_group_name: The name of the resource group. @@ -504,7 +525,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetExtensionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtensionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index ed39bc738334..24d302385ce0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VirtualMachineScaleSetRollingUpgradesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -134,7 +134,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -238,7 +244,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -342,7 +354,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -362,7 +380,7 @@ def get_latest( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RollingUpgradeStatusInfo" + # type: (...) -> "_models.RollingUpgradeStatusInfo" """Gets the status of the latest virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -374,7 +392,7 @@ def get_latest( :rtype: ~azure.mgmt.compute.v2019_07_01.models.RollingUpgradeStatusInfo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RollingUpgradeStatusInfo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 14fe76631acb..069088522bbd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VirtualMachineScaleSetVMExtensionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( vm_scale_set_name, # type: str instance_id, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,10 +114,10 @@ def begin_create_or_update( vm_scale_set_name, # type: str instance_id, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineExtension"] """The operation to create or update the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -142,7 +142,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -169,7 +169,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -189,11 +197,11 @@ def _update_initial( vm_scale_set_name, # type: str instance_id, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -247,10 +255,10 @@ def begin_update( vm_scale_set_name, # type: str instance_id, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineExtension"] """The operation to update the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -275,7 +283,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -302,7 +310,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -418,7 +434,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -441,7 +465,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" + # type: (...) -> "_models.VirtualMachineExtension" """The operation to get the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -459,7 +483,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -512,7 +536,7 @@ def list( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtensionsListResult" + # type: (...) -> "_models.VirtualMachineExtensionsListResult" """The operation to get all extensions of an instance in Virtual Machine Scaleset. :param resource_group_name: The name of the resource group. @@ -528,7 +552,7 @@ def list( :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineExtensionsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vms_operations.py index 079154708917..ee353f4c8e3e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetVMsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def _reimage_initial( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - vm_scale_set_vm_reimage_input=None, # type: Optional["models.VirtualMachineReimageParameters"] + vm_scale_set_vm_reimage_input=None, # type: Optional["_models.VirtualMachineReimageParameters"] **kwargs # type: Any ): # type: (...) -> None @@ -106,7 +106,7 @@ def begin_reimage( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - vm_scale_set_vm_reimage_input=None, # type: Optional["models.VirtualMachineReimageParameters"] + vm_scale_set_vm_reimage_input=None, # type: Optional["_models.VirtualMachineReimageParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -154,7 +154,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -263,7 +270,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -373,7 +387,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -392,11 +413,11 @@ def _update_initial( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.VirtualMachineScaleSetVM" + parameters, # type: "_models.VirtualMachineScaleSetVM" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVM" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + # type: (...) -> "_models.VirtualMachineScaleSetVM" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -452,10 +473,10 @@ def begin_update( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.VirtualMachineScaleSetVM" + parameters, # type: "_models.VirtualMachineScaleSetVM" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSetVM"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSetVM"] """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. @@ -478,7 +499,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -504,7 +525,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -612,7 +640,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -634,7 +669,7 @@ def get( expand="instanceView", # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVM" + # type: (...) -> "_models.VirtualMachineScaleSetVM" """Gets a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -650,7 +685,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetVM :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -701,7 +736,7 @@ def get_instance_view( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVMInstanceView" + # type: (...) -> "_models.VirtualMachineScaleSetVMInstanceView" """Gets the status of a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -715,7 +750,7 @@ def get_instance_view( :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetVMInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -766,7 +801,7 @@ def list( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetVMListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetVMListResult"] """Gets a list of all virtual machines in a VM scale sets. :param resource_group_name: The name of the resource group. @@ -787,7 +822,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetVMListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -955,7 +990,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1063,7 +1105,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1171,7 +1220,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1280,7 +1336,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1347,7 +1410,8 @@ def begin_perform_maintenance( **kwargs # type: Any ): # type: (...) -> LROPoller[None] - """Performs maintenance on a virtual machine in a VM scale set. + """Shuts down the virtual machine in a VMScaleSet, moves it to an already updated node, and powers + it back on during the self-service phase of planned maintenance. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1388,7 +1452,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1407,11 +1478,11 @@ def _run_command_initial( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> Optional["models.RunCommandResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + # type: (...) -> Optional["_models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1465,10 +1536,10 @@ def begin_run_command( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RunCommandResult"] + # type: (...) -> LROPoller["_models.RunCommandResult"] """Run command on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1490,7 +1561,7 @@ def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1516,7 +1587,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_sets_operations.py index 6e897de6140b..bde68ac0e13c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSet" + parameters, # type: "_models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + # type: (...) -> "_models.VirtualMachineScaleSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSet" + parameters, # type: "_models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSet"] """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -175,11 +181,11 @@ def _update_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSetUpdate" + parameters, # type: "_models.VirtualMachineScaleSetUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + # type: (...) -> "_models.VirtualMachineScaleSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -229,10 +235,10 @@ def begin_update( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSetUpdate" + parameters, # type: "_models.VirtualMachineScaleSetUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSet"] """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -379,7 +391,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -399,7 +417,7 @@ def get( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" + # type: (...) -> "_models.VirtualMachineScaleSet" """Display information about a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -411,7 +429,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -456,7 +474,7 @@ def _deallocate_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -508,7 +526,7 @@ def begin_deallocate( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -555,7 +573,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -573,7 +597,7 @@ def _delete_instances_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): # type: (...) -> None @@ -622,7 +646,7 @@ def begin_delete_instances( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -667,7 +691,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -687,7 +717,7 @@ def get_instance_view( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetInstanceView" + # type: (...) -> "_models.VirtualMachineScaleSetInstanceView" """Gets the status of a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -699,7 +729,7 @@ def get_instance_view( :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -745,7 +775,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListResult"] """Gets a list of all VM scale sets under a resource group. :param resource_group_name: The name of the resource group. @@ -755,7 +785,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -815,7 +845,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListWithLinkResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListWithLinkResult"] """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. @@ -825,7 +855,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetListWithLinkResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListWithLinkResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -886,7 +916,7 @@ def list_skus( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListSkusResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListSkusResult"] """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. @@ -899,7 +929,7 @@ def list_skus( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetListSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -962,7 +992,7 @@ def get_os_upgrade_history( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListOSUpgradeHistory"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListOSUpgradeHistory"] """Gets list of OS upgrades on a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -974,7 +1004,7 @@ def get_os_upgrade_history( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineScaleSetListOSUpgradeHistory] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListOSUpgradeHistory"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1036,7 +1066,7 @@ def _power_off_initial( resource_group_name, # type: str vm_scale_set_name, # type: str skip_shutdown=False, # type: Optional[bool] - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1091,7 +1121,7 @@ def begin_power_off( resource_group_name, # type: str vm_scale_set_name, # type: str skip_shutdown=False, # type: Optional[bool] - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1143,7 +1173,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1161,7 +1197,7 @@ def _restart_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1213,7 +1249,7 @@ def begin_restart( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1258,7 +1294,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1276,7 +1318,7 @@ def _start_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1328,7 +1370,7 @@ def begin_start( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1373,7 +1415,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1391,7 +1439,7 @@ def _redeploy_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1443,7 +1491,7 @@ def begin_redeploy( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1489,7 +1537,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1507,7 +1561,7 @@ def _perform_maintenance_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1559,7 +1613,7 @@ def begin_perform_maintenance( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1607,7 +1661,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1625,7 +1685,7 @@ def _update_instances_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): # type: (...) -> None @@ -1674,7 +1734,7 @@ def begin_update_instances( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1719,7 +1779,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1737,7 +1803,7 @@ def _reimage_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_scale_set_reimage_input=None, # type: Optional["models.VirtualMachineScaleSetReimageParameters"] + vm_scale_set_reimage_input=None, # type: Optional["_models.VirtualMachineScaleSetReimageParameters"] **kwargs # type: Any ): # type: (...) -> None @@ -1789,7 +1855,7 @@ def begin_reimage( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_scale_set_reimage_input=None, # type: Optional["models.VirtualMachineScaleSetReimageParameters"] + vm_scale_set_reimage_input=None, # type: Optional["_models.VirtualMachineScaleSetReimageParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1836,7 +1902,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1854,7 +1926,7 @@ def _reimage_all_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1906,7 +1978,7 @@ def begin_reimage_all( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1952,7 +2024,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1973,7 +2051,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( platform_update_domain, # type: int **kwargs # type: Any ): - # type: (...) -> "models.RecoveryWalkResponse" + # type: (...) -> "_models.RecoveryWalkResponse" """Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. @@ -1989,7 +2067,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( :rtype: ~azure.mgmt.compute.v2019_07_01.models.RecoveryWalkResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryWalkResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2035,11 +2113,11 @@ def convert_to_single_placement_group( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VMScaleSetConvertToSinglePlacementGroupInput" + parameters, # type: "_models.VMScaleSetConvertToSinglePlacementGroupInput" **kwargs # type: Any ): # type: (...) -> None - """Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + """Converts SinglePlacementGroup property to true for a existing virtual machine scale set. :param resource_group_name: The name of the resource group. :type resource_group_name: str diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_sizes_operations.py index 8f2c37fcaa22..b023a8931170 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_sizes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VirtualMachineSizesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """This API is deprecated. Use `Resources Skus `_. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machines_operations.py index 8566cf409ccc..16a0a02d2dbf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machines_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachinesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list_by_location( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Gets all the virtual machines under the specified subscription for the specified location. :param location: The location for which virtual machines under the subscription are queried. @@ -62,7 +62,7 @@ def list_by_location( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,11 +122,11 @@ def _capture_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineCaptureParameters" + parameters, # type: "_models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualMachineCaptureResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + # type: (...) -> Optional["_models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualMachineCaptureResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -178,10 +178,10 @@ def begin_capture( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineCaptureParameters" + parameters, # type: "_models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineCaptureResult"] + # type: (...) -> LROPoller["_models.VirtualMachineCaptureResult"] """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -202,7 +202,7 @@ def begin_capture( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -227,7 +227,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -245,11 +251,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachine" + parameters, # type: "_models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + # type: (...) -> "_models.VirtualMachine" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,10 +309,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachine" + parameters, # type: "_models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachine"] + # type: (...) -> LROPoller["_models.VirtualMachine"] """The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. @@ -327,7 +333,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -352,7 +358,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -370,11 +382,11 @@ def _update_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineUpdate" + parameters, # type: "_models.VirtualMachineUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + # type: (...) -> "_models.VirtualMachine" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -428,10 +440,10 @@ def begin_update( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineUpdate" + parameters, # type: "_models.VirtualMachineUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachine"] + # type: (...) -> LROPoller["_models.VirtualMachine"] """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -451,7 +463,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -476,7 +488,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -578,7 +596,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -599,7 +623,7 @@ def get( expand="instanceView", # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" + # type: (...) -> "_models.VirtualMachine" """Retrieves information about the model view or the instance view of a virtual machine. :param resource_group_name: The name of the resource group. @@ -613,7 +637,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachine :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -662,7 +686,7 @@ def instance_view( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineInstanceView" + # type: (...) -> "_models.VirtualMachineInstanceView" """Retrieves information about the run-time state of a virtual machine. :param resource_group_name: The name of the resource group. @@ -674,7 +698,7 @@ def instance_view( :rtype: ~azure.mgmt.compute.v2019_07_01.models.VirtualMachineInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -766,7 +790,12 @@ def begin_convert_to_managed_disks( ): # type: (...) -> LROPoller[None] """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- - deallocated before invoking this operation. + deallocated before invoking this operation. :code:`
`For Windows, please refer to `Convert a + virtual machine from unmanaged disks to managed disks. `_.:code:`
`For Linux, + please refer to `Convert a virtual machine from unmanaged disks to managed disks. + `_. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -804,7 +833,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -907,7 +942,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -985,7 +1026,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. @@ -996,7 +1037,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1057,7 +1098,7 @@ def list_all( status_only=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. @@ -1069,7 +1110,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1132,7 +1173,7 @@ def list_available_sizes( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes to which the specified virtual machine can be resized. @@ -1145,7 +1186,7 @@ def list_available_sizes( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_07_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1300,7 +1341,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1404,7 +1451,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1506,7 +1559,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1608,7 +1667,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1710,7 +1775,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1728,7 +1799,7 @@ def _reimage_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters=None, # type: Optional["models.VirtualMachineReimageParameters"] + parameters=None, # type: Optional["_models.VirtualMachineReimageParameters"] **kwargs # type: Any ): # type: (...) -> None @@ -1780,7 +1851,7 @@ def begin_reimage( self, resource_group_name, # type: str vm_name, # type: str - parameters=None, # type: Optional["models.VirtualMachineReimageParameters"] + parameters=None, # type: Optional["_models.VirtualMachineReimageParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1825,7 +1896,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1889,7 +1966,8 @@ def begin_perform_maintenance( **kwargs # type: Any ): # type: (...) -> LROPoller[None] - """The operation to perform maintenance on a virtual machine. + """Shuts down the virtual machine, moves it to an already updated node, and powers it back on + during the self-service phase of planned maintenance. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1927,7 +2005,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1945,11 +2029,11 @@ def _run_command_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> Optional["models.RunCommandResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + # type: (...) -> Optional["_models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2001,10 +2085,10 @@ def begin_run_command( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RunCommandResult"] + # type: (...) -> LROPoller["_models.RunCommandResult"] """Run command on the VM. :param resource_group_name: The name of the resource group. @@ -2024,7 +2108,7 @@ def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2049,7 +2133,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_compute_management_client.py index 637da39beaca..b926870da9fd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_compute_management_client.py @@ -56,7 +56,6 @@ def __init__( 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.disks = DisksOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_metadata.json index 1ed1808966d9..e5a3c233cbb0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/_compute_management_client.py index 896aa8817f96..6538d998cbe6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/_compute_management_client.py @@ -53,7 +53,6 @@ def __init__( 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.disks = DisksOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disk_encryption_sets_operations.py index 318e3ee38178..89082b754187 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disk_encryption_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DiskEncryptionSetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, disk_encryption_set_name: str, - disk_encryption_set: "models.DiskEncryptionSet", + disk_encryption_set: "_models.DiskEncryptionSet", **kwargs - ) -> "models.DiskEncryptionSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + ) -> "_models.DiskEncryptionSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, disk_encryption_set_name: str, - disk_encryption_set: "models.DiskEncryptionSet", + disk_encryption_set: "_models.DiskEncryptionSet", **kwargs - ) -> AsyncLROPoller["models.DiskEncryptionSet"]: + ) -> AsyncLROPoller["_models.DiskEncryptionSet"]: """Creates or updates a disk encryption set. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -154,7 +154,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_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: @@ -172,10 +178,10 @@ async def _update_initial( self, resource_group_name: str, disk_encryption_set_name: str, - disk_encryption_set: "models.DiskEncryptionSetUpdate", + disk_encryption_set: "_models.DiskEncryptionSetUpdate", **kwargs - ) -> "models.DiskEncryptionSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + ) -> "_models.DiskEncryptionSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -229,9 +235,9 @@ async def begin_update( self, resource_group_name: str, disk_encryption_set_name: str, - disk_encryption_set: "models.DiskEncryptionSetUpdate", + disk_encryption_set: "_models.DiskEncryptionSetUpdate", **kwargs - ) -> AsyncLROPoller["models.DiskEncryptionSet"]: + ) -> AsyncLROPoller["_models.DiskEncryptionSet"]: """Updates (patches) a disk encryption set. :param resource_group_name: The name of the resource group. @@ -254,7 +260,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -279,7 +285,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_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: @@ -298,7 +310,7 @@ async def get( resource_group_name: str, disk_encryption_set_name: str, **kwargs - ) -> "models.DiskEncryptionSet": + ) -> "_models.DiskEncryptionSet": """Gets information about a disk encryption set. :param resource_group_name: The name of the resource group. @@ -312,7 +324,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_11_01.models.DiskEncryptionSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_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: @@ -461,7 +479,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DiskEncryptionSetList"]: + ) -> AsyncIterable["_models.DiskEncryptionSetList"]: """Lists all the disk encryption sets under a resource group. :param resource_group_name: The name of the resource group. @@ -471,7 +489,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_11_01.models.DiskEncryptionSetList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSetList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSetList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.DiskEncryptionSetList"]: + ) -> AsyncIterable["_models.DiskEncryptionSetList"]: """Lists all the disk encryption sets under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -538,7 +556,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_11_01.models.DiskEncryptionSetList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSetList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSetList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disks_operations.py index a5c558ce2e9e..d7a27a26e4e8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DisksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, disk_name: str, - disk: "models.Disk", + disk: "_models.Disk", **kwargs - ) -> "models.Disk": - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + ) -> "_models.Disk": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, disk_name: str, - disk: "models.Disk", + disk: "_models.Disk", **kwargs - ) -> AsyncLROPoller["models.Disk"]: + ) -> AsyncLROPoller["_models.Disk"]: """Creates or updates a disk. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -171,10 +177,10 @@ async def _update_initial( self, resource_group_name: str, disk_name: str, - disk: "models.DiskUpdate", + disk: "_models.DiskUpdate", **kwargs - ) -> "models.Disk": - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + ) -> "_models.Disk": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,9 +234,9 @@ async def begin_update( self, resource_group_name: str, disk_name: str, - disk: "models.DiskUpdate", + disk: "_models.DiskUpdate", **kwargs - ) -> AsyncLROPoller["models.Disk"]: + ) -> AsyncLROPoller["_models.Disk"]: """Updates (patches) a disk. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -296,7 +308,7 @@ async def get( resource_group_name: str, disk_name: str, **kwargs - ) -> "models.Disk": + ) -> "_models.Disk": """Gets information about a disk. :param resource_group_name: The name of the resource group. @@ -310,7 +322,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_11_01.models.Disk :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -457,7 +475,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DiskList"]: + ) -> AsyncIterable["_models.DiskList"]: """Lists all the disks under a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_11_01.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -526,7 +544,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.DiskList"]: + ) -> AsyncIterable["_models.DiskList"]: """Lists all the disks under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -534,7 +552,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_11_01.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -593,10 +611,10 @@ async def _grant_access_initial( self, resource_group_name: str, disk_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> Optional["models.AccessUri"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + ) -> Optional["_models.AccessUri"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -648,9 +666,9 @@ async def begin_grant_access( self, resource_group_name: str, disk_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> AsyncLROPoller["models.AccessUri"]: + ) -> AsyncLROPoller["_models.AccessUri"]: """Grants access to a disk. :param resource_group_name: The name of the resource group. @@ -673,7 +691,7 @@ async def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -698,7 +716,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -800,7 +824,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_snapshots_operations.py index f512035abb34..5bed4da44439 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_snapshots_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SnapshotsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.Snapshot", + snapshot: "_models.Snapshot", **kwargs - ) -> "models.Snapshot": - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + ) -> "_models.Snapshot": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.Snapshot", + snapshot: "_models.Snapshot", **kwargs - ) -> AsyncLROPoller["models.Snapshot"]: + ) -> AsyncLROPoller["_models.Snapshot"]: """Creates or updates a snapshot. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -171,10 +177,10 @@ async def _update_initial( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.SnapshotUpdate", + snapshot: "_models.SnapshotUpdate", **kwargs - ) -> "models.Snapshot": - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + ) -> "_models.Snapshot": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,9 +234,9 @@ async def begin_update( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.SnapshotUpdate", + snapshot: "_models.SnapshotUpdate", **kwargs - ) -> AsyncLROPoller["models.Snapshot"]: + ) -> AsyncLROPoller["_models.Snapshot"]: """Updates (patches) a snapshot. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -296,7 +308,7 @@ async def get( resource_group_name: str, snapshot_name: str, **kwargs - ) -> "models.Snapshot": + ) -> "_models.Snapshot": """Gets information about a snapshot. :param resource_group_name: The name of the resource group. @@ -310,7 +322,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_11_01.models.Snapshot :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -457,7 +475,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.SnapshotList"]: + ) -> AsyncIterable["_models.SnapshotList"]: """Lists snapshots under a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_11_01.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -526,7 +544,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.SnapshotList"]: + ) -> AsyncIterable["_models.SnapshotList"]: """Lists snapshots under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -534,7 +552,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_11_01.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -593,10 +611,10 @@ async def _grant_access_initial( self, resource_group_name: str, snapshot_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> Optional["models.AccessUri"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + ) -> Optional["_models.AccessUri"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -648,9 +666,9 @@ async def begin_grant_access( self, resource_group_name: str, snapshot_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> AsyncLROPoller["models.AccessUri"]: + ) -> AsyncLROPoller["_models.AccessUri"]: """Grants access to a snapshot. :param resource_group_name: The name of the resource group. @@ -673,7 +691,7 @@ async def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -698,7 +716,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -800,7 +824,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disk_encryption_sets_operations.py index 78bc7cc404c5..4b39a3f7ef60 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disk_encryption_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DiskEncryptionSetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str disk_encryption_set_name, # type: str - disk_encryption_set, # type: "models.DiskEncryptionSet" + disk_encryption_set, # type: "_models.DiskEncryptionSet" **kwargs # type: Any ): - # type: (...) -> "models.DiskEncryptionSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + # type: (...) -> "_models.DiskEncryptionSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str disk_encryption_set_name, # type: str - disk_encryption_set, # type: "models.DiskEncryptionSet" + disk_encryption_set, # type: "_models.DiskEncryptionSet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DiskEncryptionSet"] + # type: (...) -> LROPoller["_models.DiskEncryptionSet"] """Creates or updates a disk encryption set. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -160,7 +160,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_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: @@ -178,11 +184,11 @@ def _update_initial( self, resource_group_name, # type: str disk_encryption_set_name, # type: str - disk_encryption_set, # type: "models.DiskEncryptionSetUpdate" + disk_encryption_set, # type: "_models.DiskEncryptionSetUpdate" **kwargs # type: Any ): - # type: (...) -> "models.DiskEncryptionSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + # type: (...) -> "_models.DiskEncryptionSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -236,10 +242,10 @@ def begin_update( self, resource_group_name, # type: str disk_encryption_set_name, # type: str - disk_encryption_set, # type: "models.DiskEncryptionSetUpdate" + disk_encryption_set, # type: "_models.DiskEncryptionSetUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DiskEncryptionSet"] + # type: (...) -> LROPoller["_models.DiskEncryptionSet"] """Updates (patches) a disk encryption set. :param resource_group_name: The name of the resource group. @@ -262,7 +268,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -287,7 +293,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_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: @@ -307,7 +319,7 @@ def get( disk_encryption_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DiskEncryptionSet" + # type: (...) -> "_models.DiskEncryptionSet" """Gets information about a disk encryption set. :param resource_group_name: The name of the resource group. @@ -321,7 +333,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_11_01.models.DiskEncryptionSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -454,7 +466,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_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: @@ -473,7 +491,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskEncryptionSetList"] + # type: (...) -> Iterable["_models.DiskEncryptionSetList"] """Lists all the disk encryption sets under a resource group. :param resource_group_name: The name of the resource group. @@ -483,7 +501,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_11_01.models.DiskEncryptionSetList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSetList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSetList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -543,7 +561,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskEncryptionSetList"] + # type: (...) -> Iterable["_models.DiskEncryptionSetList"] """Lists all the disk encryption sets under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -551,7 +569,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_11_01.models.DiskEncryptionSetList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSetList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSetList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disks_operations.py index a3e2faf627a3..115dafbe4e92 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DisksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.Disk" + disk, # type: "_models.Disk" **kwargs # type: Any ): - # type: (...) -> "models.Disk" - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + # type: (...) -> "_models.Disk" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.Disk" + disk, # type: "_models.Disk" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Disk"] + # type: (...) -> LROPoller["_models.Disk"] """Creates or updates a disk. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -177,11 +183,11 @@ def _update_initial( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.DiskUpdate" + disk, # type: "_models.DiskUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Disk" - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + # type: (...) -> "_models.Disk" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,10 +241,10 @@ def begin_update( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.DiskUpdate" + disk, # type: "_models.DiskUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Disk"] + # type: (...) -> LROPoller["_models.Disk"] """Updates (patches) a disk. :param resource_group_name: The name of the resource group. @@ -260,7 +266,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -285,7 +291,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -305,7 +317,7 @@ def get( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Disk" + # type: (...) -> "_models.Disk" """Gets information about a disk. :param resource_group_name: The name of the resource group. @@ -319,7 +331,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_11_01.models.Disk :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -450,7 +462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -469,7 +487,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskList"] + # type: (...) -> Iterable["_models.DiskList"] """Lists all the disks under a resource group. :param resource_group_name: The name of the resource group. @@ -479,7 +497,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_11_01.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -539,7 +557,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskList"] + # type: (...) -> Iterable["_models.DiskList"] """Lists all the disks under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -547,7 +565,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_11_01.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -606,11 +624,11 @@ def _grant_access_initial( self, resource_group_name, # type: str disk_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> Optional["models.AccessUri"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + # type: (...) -> Optional["_models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -662,10 +680,10 @@ def begin_grant_access( self, resource_group_name, # type: str disk_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AccessUri"] + # type: (...) -> LROPoller["_models.AccessUri"] """Grants access to a disk. :param resource_group_name: The name of the resource group. @@ -688,7 +706,7 @@ def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -713,7 +731,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -817,7 +841,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_snapshots_operations.py index 765675d7210d..27cade92d1e5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_snapshots_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SnapshotsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.Snapshot" + snapshot, # type: "_models.Snapshot" **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + # type: (...) -> "_models.Snapshot" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.Snapshot" + snapshot, # type: "_models.Snapshot" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Snapshot"] + # type: (...) -> LROPoller["_models.Snapshot"] """Creates or updates a snapshot. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -177,11 +183,11 @@ def _update_initial( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.SnapshotUpdate" + snapshot, # type: "_models.SnapshotUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + # type: (...) -> "_models.Snapshot" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,10 +241,10 @@ def begin_update( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.SnapshotUpdate" + snapshot, # type: "_models.SnapshotUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Snapshot"] + # type: (...) -> LROPoller["_models.Snapshot"] """Updates (patches) a snapshot. :param resource_group_name: The name of the resource group. @@ -260,7 +266,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -285,7 +291,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -305,7 +317,7 @@ def get( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" + # type: (...) -> "_models.Snapshot" """Gets information about a snapshot. :param resource_group_name: The name of the resource group. @@ -319,7 +331,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_11_01.models.Snapshot :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -450,7 +462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -469,7 +487,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SnapshotList"] + # type: (...) -> Iterable["_models.SnapshotList"] """Lists snapshots under a resource group. :param resource_group_name: The name of the resource group. @@ -479,7 +497,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_11_01.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -539,7 +557,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.SnapshotList"] + # type: (...) -> Iterable["_models.SnapshotList"] """Lists snapshots under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -547,7 +565,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_11_01.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -606,11 +624,11 @@ def _grant_access_initial( self, resource_group_name, # type: str snapshot_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> Optional["models.AccessUri"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + # type: (...) -> Optional["_models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -662,10 +680,10 @@ def begin_grant_access( self, resource_group_name, # type: str snapshot_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AccessUri"] + # type: (...) -> LROPoller["_models.AccessUri"] """Grants access to a snapshot. :param resource_group_name: The name of the resource group. @@ -688,7 +706,7 @@ def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -713,7 +731,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -817,7 +841,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_compute_management_client.py index 249869d97f82..0865646e071e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_compute_management_client.py @@ -122,7 +122,6 @@ def __init__( 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( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_metadata.json index 6c2c2101a7f8..1b651386cea8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/_compute_management_client.py index 8fca3e525bf8..a074d78092a4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/_compute_management_client.py @@ -119,7 +119,6 @@ def __init__( 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( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_availability_sets_operations.py index 82b7a225caa2..a28fb3eb7b8f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_availability_sets_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailabilitySetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, availability_set_name: str, - parameters: "models.AvailabilitySet", + parameters: "_models.AvailabilitySet", **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Create or update an availability set. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~azure.mgmt.compute.v2019_12_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,9 +111,9 @@ async def update( self, resource_group_name: str, availability_set_name: str, - parameters: "models.AvailabilitySetUpdate", + parameters: "_models.AvailabilitySetUpdate", **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Update an availability set. :param resource_group_name: The name of the resource group. @@ -127,7 +127,7 @@ async def update( :rtype: ~azure.mgmt.compute.v2019_12_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +231,7 @@ async def get( resource_group_name: str, availability_set_name: str, **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Retrieves information about an availability set. :param resource_group_name: The name of the resource group. @@ -243,7 +243,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,7 +288,7 @@ def list_by_subscription( self, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.AvailabilitySetListResult"]: + ) -> AsyncIterable["_models.AvailabilitySetListResult"]: """Lists all availability sets in a subscription. :param expand: The expand expression to apply to the operation. Allowed values are @@ -299,7 +299,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -360,7 +360,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailabilitySetListResult"]: + ) -> AsyncIterable["_models.AvailabilitySetListResult"]: """Lists all availability sets in a resource group. :param resource_group_name: The name of the resource group. @@ -370,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -431,7 +431,7 @@ def list_available_sizes( resource_group_name: str, availability_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. @@ -444,7 +444,7 @@ def list_available_sizes( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_host_groups_operations.py index 6082a287af0d..14a78f106566 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_host_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DedicatedHostGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, host_group_name: str, - parameters: "models.DedicatedHostGroup", + parameters: "_models.DedicatedHostGroup", **kwargs - ) -> "models.DedicatedHostGroup": + ) -> "_models.DedicatedHostGroup": """Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.compute.v2019_12_01.models.DedicatedHostGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,9 +117,9 @@ async def update( self, resource_group_name: str, host_group_name: str, - parameters: "models.DedicatedHostGroupUpdate", + parameters: "_models.DedicatedHostGroupUpdate", **kwargs - ) -> "models.DedicatedHostGroup": + ) -> "_models.DedicatedHostGroup": """Update an dedicated host group. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ async def update( :rtype: ~azure.mgmt.compute.v2019_12_01.models.DedicatedHostGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -237,7 +237,7 @@ async def get( resource_group_name: str, host_group_name: str, **kwargs - ) -> "models.DedicatedHostGroup": + ) -> "_models.DedicatedHostGroup": """Retrieves information about a dedicated host group. :param resource_group_name: The name of the resource group. @@ -249,7 +249,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.DedicatedHostGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -294,7 +294,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DedicatedHostGroupListResult"]: + ) -> AsyncIterable["_models.DedicatedHostGroupListResult"]: """Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. @@ -305,7 +305,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.DedicatedHostGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -364,7 +364,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.DedicatedHostGroupListResult"]: + ) -> AsyncIterable["_models.DedicatedHostGroupListResult"]: """Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. @@ -373,7 +373,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.DedicatedHostGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_hosts_operations.py index c4dff56e9609..a7366e2c0de0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DedicatedHostsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, host_group_name: str, host_name: str, - parameters: "models.DedicatedHost", + parameters: "_models.DedicatedHost", **kwargs - ) -> "models.DedicatedHost": - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + ) -> "_models.DedicatedHost": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def begin_create_or_update( resource_group_name: str, host_group_name: str, host_name: str, - parameters: "models.DedicatedHost", + parameters: "_models.DedicatedHost", **kwargs - ) -> AsyncLROPoller["models.DedicatedHost"]: + ) -> AsyncLROPoller["_models.DedicatedHost"]: """Create or update a dedicated host . :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -176,10 +183,10 @@ async def _update_initial( resource_group_name: str, host_group_name: str, host_name: str, - parameters: "models.DedicatedHostUpdate", + parameters: "_models.DedicatedHostUpdate", **kwargs - ) -> "models.DedicatedHost": - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + ) -> "_models.DedicatedHost": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,9 +238,9 @@ async def begin_update( resource_group_name: str, host_group_name: str, host_name: str, - parameters: "models.DedicatedHostUpdate", + parameters: "_models.DedicatedHostUpdate", **kwargs - ) -> AsyncLROPoller["models.DedicatedHost"]: + ) -> AsyncLROPoller["_models.DedicatedHost"]: """Update an dedicated host . :param resource_group_name: The name of the resource group. @@ -255,7 +262,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -281,7 +288,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -387,7 +401,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -408,7 +429,7 @@ async def get( host_name: str, expand: Optional[str] = "instanceView", **kwargs - ) -> "models.DedicatedHost": + ) -> "_models.DedicatedHost": """Retrieves information about a dedicated host. :param resource_group_name: The name of the resource group. @@ -424,7 +445,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.DedicatedHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -473,7 +494,7 @@ def list_by_host_group( resource_group_name: str, host_group_name: str, **kwargs - ) -> AsyncIterable["models.DedicatedHostListResult"]: + ) -> AsyncIterable["_models.DedicatedHostListResult"]: """Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. @@ -486,7 +507,7 @@ def list_by_host_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.DedicatedHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_galleries_operations.py index 66fc4d936d28..de722017cd85 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_galleries_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class GalleriesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, gallery_name: str, - gallery: "models.Gallery", + gallery: "_models.Gallery", **kwargs - ) -> "models.Gallery": - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + ) -> "_models.Gallery": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def begin_create_or_update( self, resource_group_name: str, gallery_name: str, - gallery: "models.Gallery", + gallery: "_models.Gallery", **kwargs - ) -> AsyncLROPoller["models.Gallery"]: + ) -> AsyncLROPoller["_models.Gallery"]: """Create or update a Shared Image Gallery. :param resource_group_name: The name of the resource group. @@ -130,7 +130,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -155,7 +155,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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: @@ -173,10 +179,10 @@ async def _update_initial( self, resource_group_name: str, gallery_name: str, - gallery: "models.GalleryUpdate", + gallery: "_models.GalleryUpdate", **kwargs - ) -> "models.Gallery": - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + ) -> "_models.Gallery": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -226,9 +232,9 @@ async def begin_update( self, resource_group_name: str, gallery_name: str, - gallery: "models.GalleryUpdate", + gallery: "_models.GalleryUpdate", **kwargs - ) -> AsyncLROPoller["models.Gallery"]: + ) -> AsyncLROPoller["_models.Gallery"]: """Update a Shared Image Gallery. :param resource_group_name: The name of the resource group. @@ -249,7 +255,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -274,7 +280,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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: @@ -293,7 +305,7 @@ async def get( resource_group_name: str, gallery_name: str, **kwargs - ) -> "models.Gallery": + ) -> "_models.Gallery": """Retrieves information about a Shared Image Gallery. :param resource_group_name: The name of the resource group. @@ -305,7 +317,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.Gallery :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -434,7 +446,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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: @@ -452,7 +470,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.GalleryList"]: + ) -> AsyncIterable["_models.GalleryList"]: """List galleries under a resource group. :param resource_group_name: The name of the resource group. @@ -462,7 +480,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.GalleryList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -521,7 +539,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.GalleryList"]: + ) -> AsyncIterable["_models.GalleryList"]: """List galleries under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -529,7 +547,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.GalleryList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_application_versions_operations.py index ca72440b852d..b118a6877a7f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_application_versions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class GalleryApplicationVersionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,10 +49,10 @@ async def _create_or_update_initial( gallery_name: str, gallery_application_name: str, gallery_application_version_name: str, - gallery_application_version: "models.GalleryApplicationVersion", + gallery_application_version: "_models.GalleryApplicationVersion", **kwargs - ) -> "models.GalleryApplicationVersion": - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] + ) -> "_models.GalleryApplicationVersion": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,9 +113,9 @@ async def begin_create_or_update( gallery_name: str, gallery_application_name: str, gallery_application_version_name: str, - gallery_application_version: "models.GalleryApplicationVersion", + gallery_application_version: "_models.GalleryApplicationVersion", **kwargs - ) -> AsyncLROPoller["models.GalleryApplicationVersion"]: + ) -> AsyncLROPoller["_models.GalleryApplicationVersion"]: """Create or update a gallery Application Version. :param resource_group_name: The name of the resource group. @@ -145,7 +145,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -172,7 +172,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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: @@ -192,10 +200,10 @@ async def _update_initial( gallery_name: str, gallery_application_name: str, gallery_application_version_name: str, - gallery_application_version: "models.GalleryApplicationVersionUpdate", + gallery_application_version: "_models.GalleryApplicationVersionUpdate", **kwargs - ) -> "models.GalleryApplicationVersion": - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] + ) -> "_models.GalleryApplicationVersion": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -249,9 +257,9 @@ async def begin_update( gallery_name: str, gallery_application_name: str, gallery_application_version_name: str, - gallery_application_version: "models.GalleryApplicationVersionUpdate", + gallery_application_version: "_models.GalleryApplicationVersionUpdate", **kwargs - ) -> AsyncLROPoller["models.GalleryApplicationVersion"]: + ) -> AsyncLROPoller["_models.GalleryApplicationVersion"]: """Update a gallery Application Version. :param resource_group_name: The name of the resource group. @@ -281,7 +289,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -308,7 +316,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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: @@ -328,9 +344,9 @@ async def get( gallery_name: str, gallery_application_name: str, gallery_application_version_name: str, - expand: Optional[Union[str, "models.ReplicationStatusTypes"]] = None, + expand: Optional[Union[str, "_models.ReplicationStatusTypes"]] = None, **kwargs - ) -> "models.GalleryApplicationVersion": + ) -> "_models.GalleryApplicationVersion": """Retrieves information about a gallery Application Version. :param resource_group_name: The name of the resource group. @@ -351,7 +367,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.GalleryApplicationVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -499,7 +515,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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: @@ -519,7 +543,7 @@ def list_by_gallery_application( gallery_name: str, gallery_application_name: str, **kwargs - ) -> AsyncIterable["models.GalleryApplicationVersionList"]: + ) -> AsyncIterable["_models.GalleryApplicationVersionList"]: """List gallery Application Versions in a gallery Application Definition. :param resource_group_name: The name of the resource group. @@ -535,7 +559,7 @@ def list_by_gallery_application( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.GalleryApplicationVersionList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_applications_operations.py index 59e2d991e8ae..2101685bac2f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_applications_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class GalleryApplicationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, gallery_name: str, gallery_application_name: str, - gallery_application: "models.GalleryApplication", + gallery_application: "_models.GalleryApplication", **kwargs - ) -> "models.GalleryApplication": - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] + ) -> "_models.GalleryApplication": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,9 +110,9 @@ async def begin_create_or_update( resource_group_name: str, gallery_name: str, gallery_application_name: str, - gallery_application: "models.GalleryApplication", + gallery_application: "_models.GalleryApplication", **kwargs - ) -> AsyncLROPoller["models.GalleryApplication"]: + ) -> AsyncLROPoller["_models.GalleryApplication"]: """Create or update a gallery Application Definition. :param resource_group_name: The name of the resource group. @@ -138,7 +138,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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: @@ -183,10 +190,10 @@ async def _update_initial( resource_group_name: str, gallery_name: str, gallery_application_name: str, - gallery_application: "models.GalleryApplicationUpdate", + gallery_application: "_models.GalleryApplicationUpdate", **kwargs - ) -> "models.GalleryApplication": - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] + ) -> "_models.GalleryApplication": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -238,9 +245,9 @@ async def begin_update( resource_group_name: str, gallery_name: str, gallery_application_name: str, - gallery_application: "models.GalleryApplicationUpdate", + gallery_application: "_models.GalleryApplicationUpdate", **kwargs - ) -> AsyncLROPoller["models.GalleryApplication"]: + ) -> AsyncLROPoller["_models.GalleryApplication"]: """Update a gallery Application Definition. :param resource_group_name: The name of the resource group. @@ -265,7 +272,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -291,7 +298,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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: @@ -311,7 +325,7 @@ async def get( gallery_name: str, gallery_application_name: str, **kwargs - ) -> "models.GalleryApplication": + ) -> "_models.GalleryApplication": """Retrieves information about a gallery Application Definition. :param resource_group_name: The name of the resource group. @@ -327,7 +341,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.GalleryApplication :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -464,7 +478,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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: @@ -483,7 +504,7 @@ def list_by_gallery( resource_group_name: str, gallery_name: str, **kwargs - ) -> AsyncIterable["models.GalleryApplicationList"]: + ) -> AsyncIterable["_models.GalleryApplicationList"]: """List gallery Application Definitions in a gallery. :param resource_group_name: The name of the resource group. @@ -496,7 +517,7 @@ def list_by_gallery( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.GalleryApplicationList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_image_versions_operations.py index 33be1bea99c8..23d8871d82bd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_image_versions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class GalleryImageVersionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -49,10 +49,10 @@ async def _create_or_update_initial( gallery_name: str, gallery_image_name: str, gallery_image_version_name: str, - gallery_image_version: "models.GalleryImageVersion", + gallery_image_version: "_models.GalleryImageVersion", **kwargs - ) -> "models.GalleryImageVersion": - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + ) -> "_models.GalleryImageVersion": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -113,9 +113,9 @@ async def begin_create_or_update( gallery_name: str, gallery_image_name: str, gallery_image_version_name: str, - gallery_image_version: "models.GalleryImageVersion", + gallery_image_version: "_models.GalleryImageVersion", **kwargs - ) -> AsyncLROPoller["models.GalleryImageVersion"]: + ) -> AsyncLROPoller["_models.GalleryImageVersion"]: """Create or update a gallery Image Version. :param resource_group_name: The name of the resource group. @@ -145,7 +145,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -172,7 +172,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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: @@ -192,10 +200,10 @@ async def _update_initial( gallery_name: str, gallery_image_name: str, gallery_image_version_name: str, - gallery_image_version: "models.GalleryImageVersionUpdate", + gallery_image_version: "_models.GalleryImageVersionUpdate", **kwargs - ) -> "models.GalleryImageVersion": - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + ) -> "_models.GalleryImageVersion": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -249,9 +257,9 @@ async def begin_update( gallery_name: str, gallery_image_name: str, gallery_image_version_name: str, - gallery_image_version: "models.GalleryImageVersionUpdate", + gallery_image_version: "_models.GalleryImageVersionUpdate", **kwargs - ) -> AsyncLROPoller["models.GalleryImageVersion"]: + ) -> AsyncLROPoller["_models.GalleryImageVersion"]: """Update a gallery Image Version. :param resource_group_name: The name of the resource group. @@ -281,7 +289,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -308,7 +316,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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: @@ -328,9 +344,9 @@ async def get( gallery_name: str, gallery_image_name: str, gallery_image_version_name: str, - expand: Optional[Union[str, "models.ReplicationStatusTypes"]] = None, + expand: Optional[Union[str, "_models.ReplicationStatusTypes"]] = None, **kwargs - ) -> "models.GalleryImageVersion": + ) -> "_models.GalleryImageVersion": """Retrieves information about a gallery Image Version. :param resource_group_name: The name of the resource group. @@ -350,7 +366,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.GalleryImageVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -497,7 +513,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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: @@ -517,7 +541,7 @@ def list_by_gallery_image( gallery_name: str, gallery_image_name: str, **kwargs - ) -> AsyncIterable["models.GalleryImageVersionList"]: + ) -> AsyncIterable["_models.GalleryImageVersionList"]: """List gallery Image Versions in a gallery Image Definition. :param resource_group_name: The name of the resource group. @@ -533,7 +557,7 @@ def list_by_gallery_image( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.GalleryImageVersionList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_images_operations.py index 3e74e11216f9..ab3ca7cbb7e2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class GalleryImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, gallery_name: str, gallery_image_name: str, - gallery_image: "models.GalleryImage", + gallery_image: "_models.GalleryImage", **kwargs - ) -> "models.GalleryImage": - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + ) -> "_models.GalleryImage": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -110,9 +110,9 @@ async def begin_create_or_update( resource_group_name: str, gallery_name: str, gallery_image_name: str, - gallery_image: "models.GalleryImage", + gallery_image: "_models.GalleryImage", **kwargs - ) -> AsyncLROPoller["models.GalleryImage"]: + ) -> AsyncLROPoller["_models.GalleryImage"]: """Create or update a gallery Image Definition. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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: @@ -182,10 +189,10 @@ async def _update_initial( resource_group_name: str, gallery_name: str, gallery_image_name: str, - gallery_image: "models.GalleryImageUpdate", + gallery_image: "_models.GalleryImageUpdate", **kwargs - ) -> "models.GalleryImage": - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + ) -> "_models.GalleryImage": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -237,9 +244,9 @@ async def begin_update( resource_group_name: str, gallery_name: str, gallery_image_name: str, - gallery_image: "models.GalleryImageUpdate", + gallery_image: "_models.GalleryImageUpdate", **kwargs - ) -> AsyncLROPoller["models.GalleryImage"]: + ) -> AsyncLROPoller["_models.GalleryImage"]: """Update a gallery Image Definition. :param resource_group_name: The name of the resource group. @@ -264,7 +271,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -290,7 +297,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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: @@ -310,7 +324,7 @@ async def get( gallery_name: str, gallery_image_name: str, **kwargs - ) -> "models.GalleryImage": + ) -> "_models.GalleryImage": """Retrieves information about a gallery Image Definition. :param resource_group_name: The name of the resource group. @@ -325,7 +339,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.GalleryImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -462,7 +476,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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: @@ -481,7 +502,7 @@ def list_by_gallery( resource_group_name: str, gallery_name: str, **kwargs - ) -> AsyncIterable["models.GalleryImageList"]: + ) -> AsyncIterable["_models.GalleryImageList"]: """List gallery Image Definitions in a gallery. :param resource_group_name: The name of the resource group. @@ -494,7 +515,7 @@ def list_by_gallery( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.GalleryImageList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_images_operations.py index b1f7bd5153f7..956aaa8b34ea 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, image_name: str, - parameters: "models.Image", + parameters: "_models.Image", **kwargs - ) -> "models.Image": - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + ) -> "_models.Image": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, image_name: str, - parameters: "models.Image", + parameters: "_models.Image", **kwargs - ) -> AsyncLROPoller["models.Image"]: + ) -> AsyncLROPoller["_models.Image"]: """Create or update an image. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -169,10 +175,10 @@ async def _update_initial( self, resource_group_name: str, image_name: str, - parameters: "models.ImageUpdate", + parameters: "_models.ImageUpdate", **kwargs - ) -> "models.Image": - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + ) -> "_models.Image": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -226,9 +232,9 @@ async def begin_update( self, resource_group_name: str, image_name: str, - parameters: "models.ImageUpdate", + parameters: "_models.ImageUpdate", **kwargs - ) -> AsyncLROPoller["models.Image"]: + ) -> AsyncLROPoller["_models.Image"]: """Update an image. :param resource_group_name: The name of the resource group. @@ -248,7 +254,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -273,7 +279,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -373,7 +385,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -393,7 +411,7 @@ async def get( image_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Image": + ) -> "_models.Image": """Gets an image. :param resource_group_name: The name of the resource group. @@ -407,7 +425,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.Image :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -454,7 +472,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ImageListResult"]: + ) -> AsyncIterable["_models.ImageListResult"]: """Gets the list of images under a resource group. :param resource_group_name: The name of the resource group. @@ -464,7 +482,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ImageListResult"]: + ) -> AsyncIterable["_models.ImageListResult"]: """Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. @@ -532,7 +550,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_log_analytics_operations.py index 1ad22349de45..3f4564cae01a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_log_analytics_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class LogAnalyticsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,10 +45,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def _export_request_rate_by_interval_initial( self, location: str, - parameters: "models.RequestRateByIntervalInput", + parameters: "_models.RequestRateByIntervalInput", **kwargs - ) -> Optional["models.LogAnalyticsOperationResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + ) -> Optional["_models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -98,9 +98,9 @@ async def _export_request_rate_by_interval_initial( async def begin_export_request_rate_by_interval( self, location: str, - parameters: "models.RequestRateByIntervalInput", + parameters: "_models.RequestRateByIntervalInput", **kwargs - ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: + ) -> AsyncLROPoller["_models.LogAnalyticsOperationResult"]: """Export logs that show Api requests made by this subscription in the given time window to show throttling activities. @@ -119,7 +119,7 @@ async def begin_export_request_rate_by_interval( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -143,7 +143,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -160,10 +165,10 @@ def get_long_running_output(pipeline_response): async def _export_throttled_requests_initial( self, location: str, - parameters: "models.LogAnalyticsInputBase", + parameters: "_models.LogAnalyticsInputBase", **kwargs - ) -> Optional["models.LogAnalyticsOperationResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + ) -> Optional["_models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -213,9 +218,9 @@ async def _export_throttled_requests_initial( async def begin_export_throttled_requests( self, location: str, - parameters: "models.LogAnalyticsInputBase", + parameters: "_models.LogAnalyticsInputBase", **kwargs - ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: + ) -> AsyncLROPoller["_models.LogAnalyticsOperationResult"]: """Export logs that show total throttled Api requests for this subscription in the given time window. @@ -234,7 +239,7 @@ async def begin_export_throttled_requests( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -258,7 +263,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_operations.py index 19cf5cf16e8e..f144e2e612ca 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ComputeOperationListResult"]: + ) -> AsyncIterable["_models.ComputeOperationListResult"]: """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.ComputeOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeOperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_proximity_placement_groups_operations.py index 0564c043bdb1..c085e4ff6ab6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_proximity_placement_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ProximityPlacementGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, proximity_placement_group_name: str, - parameters: "models.ProximityPlacementGroup", + parameters: "_models.ProximityPlacementGroup", **kwargs - ) -> "models.ProximityPlacementGroup": + ) -> "_models.ProximityPlacementGroup": """Create or update a proximity placement group. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~azure.mgmt.compute.v2019_12_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,9 +115,9 @@ async def update( self, resource_group_name: str, proximity_placement_group_name: str, - parameters: "models.UpdateResource", + parameters: "_models.UpdateResource", **kwargs - ) -> "models.ProximityPlacementGroup": + ) -> "_models.ProximityPlacementGroup": """Update a proximity placement group. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def update( :rtype: ~azure.mgmt.compute.v2019_12_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -236,7 +236,7 @@ async def get( proximity_placement_group_name: str, include_colocation_status: Optional[str] = None, **kwargs - ) -> "models.ProximityPlacementGroup": + ) -> "_models.ProximityPlacementGroup": """Retrieves information about a proximity placement group . :param resource_group_name: The name of the resource group. @@ -251,7 +251,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -297,7 +297,7 @@ async def get( def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.ProximityPlacementGroupListResult"]: + ) -> AsyncIterable["_models.ProximityPlacementGroupListResult"]: """Lists all proximity placement groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -305,7 +305,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.ProximityPlacementGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -364,7 +364,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ProximityPlacementGroupListResult"]: + ) -> AsyncIterable["_models.ProximityPlacementGroupListResult"]: """Lists all proximity placement groups in a resource group. :param resource_group_name: The name of the resource group. @@ -374,7 +374,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.ProximityPlacementGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_ssh_public_keys_operations.py index 8acc603f7153..15d3f0a83ce6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_ssh_public_keys_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class SshPublicKeysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.SshPublicKeysGroupListResult"]: + ) -> AsyncIterable["_models.SshPublicKeysGroupListResult"]: """Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. @@ -53,7 +53,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.SshPublicKeysGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeysGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SshPublicKeysGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,7 +112,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.SshPublicKeysGroupListResult"]: + ) -> AsyncIterable["_models.SshPublicKeysGroupListResult"]: """Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. @@ -123,7 +123,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.SshPublicKeysGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeysGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SshPublicKeysGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -183,9 +183,9 @@ async def create( self, resource_group_name: str, ssh_public_key_name: str, - parameters: "models.SshPublicKeyResource", + parameters: "_models.SshPublicKeyResource", **kwargs - ) -> "models.SshPublicKeyResource": + ) -> "_models.SshPublicKeyResource": """Creates a new SSH public key resource. :param resource_group_name: The name of the resource group. @@ -199,7 +199,7 @@ async def create( :rtype: ~azure.mgmt.compute.v2019_12_01.models.SshPublicKeyResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SshPublicKeyResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,9 +253,9 @@ async def update( self, resource_group_name: str, ssh_public_key_name: str, - parameters: "models.SshPublicKeyUpdateResource", + parameters: "_models.SshPublicKeyUpdateResource", **kwargs - ) -> "models.SshPublicKeyResource": + ) -> "_models.SshPublicKeyResource": """Updates a new SSH public key resource. :param resource_group_name: The name of the resource group. @@ -269,7 +269,7 @@ async def update( :rtype: ~azure.mgmt.compute.v2019_12_01.models.SshPublicKeyResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SshPublicKeyResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -373,7 +373,7 @@ async def get( resource_group_name: str, ssh_public_key_name: str, **kwargs - ) -> "models.SshPublicKeyResource": + ) -> "_models.SshPublicKeyResource": """Retrieves information about an SSH public key. :param resource_group_name: The name of the resource group. @@ -385,7 +385,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.SshPublicKeyResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SshPublicKeyResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -431,7 +431,7 @@ async def generate_key_pair( resource_group_name: str, ssh_public_key_name: str, **kwargs - ) -> "models.SshPublicKeyGenerateKeyPairResult": + ) -> "_models.SshPublicKeyGenerateKeyPairResult": """Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. @@ -445,7 +445,7 @@ async def generate_key_pair( :rtype: ~azure.mgmt.compute.v2019_12_01.models.SshPublicKeyGenerateKeyPairResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyGenerateKeyPairResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SshPublicKeyGenerateKeyPairResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_usage_operations.py index f20aacda364b..ba19529ffdaa 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsageOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.ListUsagesResult"]: + ) -> AsyncIterable["_models.ListUsagesResult"]: """Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extension_images_operations.py index ead885cce009..bef8b05ce219 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VirtualMachineExtensionImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( type: str, version: str, **kwargs - ) -> "models.VirtualMachineExtensionImage": + ) -> "_models.VirtualMachineExtensionImage": """Gets a virtual machine extension image. :param location: The name of a supported Azure region. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtensionImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,7 +111,7 @@ async def list_types( location: str, publisher_name: str, **kwargs - ) -> List["models.VirtualMachineExtensionImage"]: + ) -> List["_models.VirtualMachineExtensionImage"]: """Gets a list of virtual machine extension image types. :param location: The name of a supported Azure region. @@ -123,7 +123,7 @@ async def list_types( :rtype: list[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -173,7 +173,7 @@ async def list_versions( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> List["models.VirtualMachineExtensionImage"]: + ) -> List["_models.VirtualMachineExtensionImage"]: """Gets a list of virtual machine extension image versions. :param location: The name of a supported Azure region. @@ -193,7 +193,7 @@ async def list_versions( :rtype: list[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extensions_operations.py index dc3386d101d2..41f81f6012d2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VirtualMachineExtensionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineExtension", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineExtension", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineExtension"]: """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -177,10 +184,10 @@ async def _update_initial( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineExtensionUpdate", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -232,9 +239,9 @@ async def begin_update( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineExtensionUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineExtension"]: """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -257,7 +264,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -283,7 +290,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -389,7 +403,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -410,7 +431,7 @@ async def get( vm_extension_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtension": + ) -> "_models.VirtualMachineExtension": """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -426,7 +447,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +497,7 @@ async def list( vm_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtensionsListResult": + ) -> "_models.VirtualMachineExtensionsListResult": """The operation to get all extensions of a Virtual Machine. :param resource_group_name: The name of the resource group. @@ -490,7 +511,7 @@ async def list( :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtensionsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_images_operations.py index e01f28774c0f..f249d81af460 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VirtualMachineImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( skus: str, version: str, **kwargs - ) -> "models.VirtualMachineImage": + ) -> "_models.VirtualMachineImage": """Gets a virtual machine image. :param location: The name of a supported Azure region. @@ -66,7 +66,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,7 +120,7 @@ async def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. @@ -143,7 +143,7 @@ async def list( :rtype: list[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -197,7 +197,7 @@ async def list_offers( location: str, publisher_name: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image offers for the specified location and publisher. :param location: The name of a supported Azure region. @@ -209,7 +209,7 @@ async def list_offers( :rtype: list[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -254,7 +254,7 @@ async def list_publishers( self, location: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image publishers for the specified Azure location. :param location: The name of a supported Azure region. @@ -264,7 +264,7 @@ async def list_publishers( :rtype: list[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -310,7 +310,7 @@ async def list_skus( publisher_name: str, offer: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. :param location: The name of a supported Azure region. @@ -324,7 +324,7 @@ async def list_skus( :rtype: list[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_run_commands_operations.py index 0abb8cec5a34..d7d96a9b26ae 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VirtualMachineRunCommandsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.RunCommandListResult"]: + ) -> AsyncIterable["_models.RunCommandListResult"]: """Lists all available run commands for a subscription in a location. :param location: The location upon which run commands is queried. @@ -55,7 +55,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.RunCommandListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +116,7 @@ async def get( location: str, command_id: str, **kwargs - ) -> "models.RunCommandDocument": + ) -> "_models.RunCommandDocument": """Gets specific run command for a subscription in a location. :param location: The location upon which run commands is queried. @@ -128,7 +128,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.RunCommandDocument :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandDocument"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index cbc3856050ac..1ab6a750abb8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetExtensionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, vm_scale_set_name: str, vmss_extension_name: str, - extension_parameters: "models.VirtualMachineScaleSetExtension", + extension_parameters: "_models.VirtualMachineScaleSetExtension", **kwargs - ) -> "models.VirtualMachineScaleSetExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + ) -> "_models.VirtualMachineScaleSetExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def begin_create_or_update( resource_group_name: str, vm_scale_set_name: str, vmss_extension_name: str, - extension_parameters: "models.VirtualMachineScaleSetExtension", + extension_parameters: "_models.VirtualMachineScaleSetExtension", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSetExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSetExtension"]: """The operation to create or update an extension. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -178,10 +185,10 @@ async def _update_initial( resource_group_name: str, vm_scale_set_name: str, vmss_extension_name: str, - extension_parameters: "models.VirtualMachineScaleSetExtensionUpdate", + extension_parameters: "_models.VirtualMachineScaleSetExtensionUpdate", **kwargs - ) -> "models.VirtualMachineScaleSetExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + ) -> "_models.VirtualMachineScaleSetExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -237,9 +244,9 @@ async def begin_update( resource_group_name: str, vm_scale_set_name: str, vmss_extension_name: str, - extension_parameters: "models.VirtualMachineScaleSetExtensionUpdate", + extension_parameters: "_models.VirtualMachineScaleSetExtensionUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSetExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSetExtension"]: """The operation to update an extension. :param resource_group_name: The name of the resource group. @@ -262,7 +269,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -288,7 +295,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -394,7 +408,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -415,7 +436,7 @@ async def get( vmss_extension_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineScaleSetExtension": + ) -> "_models.VirtualMachineScaleSetExtension": """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -431,7 +452,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -480,7 +501,7 @@ def list( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetExtensionListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetExtensionListResult"]: """Gets a list of all extensions in a VM scale set. :param resource_group_name: The name of the resource group. @@ -492,7 +513,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetExtensionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtensionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 2bf43493dd59..a060bab3fa2a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VirtualMachineScaleSetRollingUpgradesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -128,7 +128,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -230,7 +236,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -332,7 +344,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -351,7 +369,7 @@ async def get_latest( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.RollingUpgradeStatusInfo": + ) -> "_models.RollingUpgradeStatusInfo": """Gets the status of the latest virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -363,7 +381,7 @@ async def get_latest( :rtype: ~azure.mgmt.compute.v2019_12_01.models.RollingUpgradeStatusInfo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RollingUpgradeStatusInfo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 7f6d39f84e81..a6d5754aa762 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VirtualMachineScaleSetVMExtensionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( vm_scale_set_name: str, instance_id: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineExtension", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,9 +109,9 @@ async def begin_create_or_update( vm_scale_set_name: str, instance_id: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineExtension", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineExtension"]: """The operation to create or update the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -136,7 +136,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -183,10 +191,10 @@ async def _update_initial( vm_scale_set_name: str, instance_id: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineExtensionUpdate", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -240,9 +248,9 @@ async def begin_update( vm_scale_set_name: str, instance_id: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineExtensionUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineExtension"]: """The operation to update the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -267,7 +275,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -294,7 +302,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -408,7 +424,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -430,7 +454,7 @@ async def get( vm_extension_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtension": + ) -> "_models.VirtualMachineExtension": """The operation to get the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -448,7 +472,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -500,7 +524,7 @@ async def list( instance_id: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtensionsListResult": + ) -> "_models.VirtualMachineExtensionsListResult": """The operation to get all extensions of an instance in Virtual Machine Scaleset. :param resource_group_name: The name of the resource group. @@ -516,7 +540,7 @@ async def list( :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtensionsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 34b35c0af436..c0f75c32542f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetVMsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def _reimage_initial( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - vm_scale_set_vm_reimage_input: Optional["models.VirtualMachineReimageParameters"] = None, + vm_scale_set_vm_reimage_input: Optional["_models.VirtualMachineReimageParameters"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -101,7 +101,7 @@ async def begin_reimage( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - vm_scale_set_vm_reimage_input: Optional["models.VirtualMachineReimageParameters"] = None, + vm_scale_set_vm_reimage_input: Optional["_models.VirtualMachineReimageParameters"] = None, **kwargs ) -> AsyncLROPoller[None]: """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. @@ -148,7 +148,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -255,7 +262,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -363,7 +377,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -382,10 +403,10 @@ async def _update_initial( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.VirtualMachineScaleSetVM", + parameters: "_models.VirtualMachineScaleSetVM", **kwargs - ) -> "models.VirtualMachineScaleSetVM": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + ) -> "_models.VirtualMachineScaleSetVM": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -441,9 +462,9 @@ async def begin_update( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.VirtualMachineScaleSetVM", + parameters: "_models.VirtualMachineScaleSetVM", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSetVM"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSetVM"]: """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. @@ -466,7 +487,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -492,7 +513,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -598,7 +626,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -619,7 +654,7 @@ async def get( instance_id: str, expand: Optional[str] = "instanceView", **kwargs - ) -> "models.VirtualMachineScaleSetVM": + ) -> "_models.VirtualMachineScaleSetVM": """Gets a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -635,7 +670,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetVM :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -685,7 +720,7 @@ async def get_instance_view( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.VirtualMachineScaleSetVMInstanceView": + ) -> "_models.VirtualMachineScaleSetVMInstanceView": """Gets the status of a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -699,7 +734,7 @@ async def get_instance_view( :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetVMInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -749,7 +784,7 @@ def list( select: Optional[str] = None, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetVMListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetVMListResult"]: """Gets a list of all virtual machines in a VM scale sets. :param resource_group_name: The name of the resource group. @@ -770,7 +805,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetVMListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -936,7 +971,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1042,7 +1084,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1148,7 +1197,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1255,7 +1311,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1320,7 +1383,8 @@ async def begin_perform_maintenance( instance_id: str, **kwargs ) -> AsyncLROPoller[None]: - """Performs maintenance on a virtual machine in a VM scale set. + """Shuts down the virtual machine in a VMScaleSet, moves it to an already updated node, and powers + it back on during the self-service phase of planned maintenance. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1361,7 +1425,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1438,10 +1509,10 @@ async def _run_command_initial( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> Optional["models.RunCommandResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + ) -> Optional["_models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1495,9 +1566,9 @@ async def begin_run_command( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> AsyncLROPoller["models.RunCommandResult"]: + ) -> AsyncLROPoller["_models.RunCommandResult"]: """Run command on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1519,7 +1590,7 @@ async def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1545,7 +1616,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_sets_operations.py index 9baf4a2a0f61..a6f880699606 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSet", + parameters: "_models.VirtualMachineScaleSet", **kwargs - ) -> "models.VirtualMachineScaleSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + ) -> "_models.VirtualMachineScaleSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSet", + parameters: "_models.VirtualMachineScaleSet", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSet"]: """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -169,10 +175,10 @@ async def _update_initial( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSetUpdate", + parameters: "_models.VirtualMachineScaleSetUpdate", **kwargs - ) -> "models.VirtualMachineScaleSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + ) -> "_models.VirtualMachineScaleSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -222,9 +228,9 @@ async def begin_update( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSetUpdate", + parameters: "_models.VirtualMachineScaleSetUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSet"]: """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -244,7 +250,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -269,7 +275,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -369,7 +381,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -388,7 +406,7 @@ async def get( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> "_models.VirtualMachineScaleSet": """Display information about a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -400,7 +418,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -445,7 +463,7 @@ async def _deallocate_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -496,7 +514,7 @@ async def begin_deallocate( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and @@ -542,7 +560,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -560,7 +584,7 @@ async def _delete_instances_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -608,7 +632,7 @@ async def begin_delete_instances( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs ) -> AsyncLROPoller[None]: """Deletes virtual machines in a VM scale set. @@ -652,7 +676,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -671,7 +701,7 @@ async def get_instance_view( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.VirtualMachineScaleSetInstanceView": + ) -> "_models.VirtualMachineScaleSetInstanceView": """Gets the status of a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -683,7 +713,7 @@ async def get_instance_view( :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -728,7 +758,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListResult"]: """Gets a list of all VM scale sets under a resource group. :param resource_group_name: The name of the resource group. @@ -738,7 +768,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -797,7 +827,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListWithLinkResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListWithLinkResult"]: """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. @@ -807,7 +837,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetListWithLinkResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListWithLinkResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -867,7 +897,7 @@ def list_skus( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListSkusResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListSkusResult"]: """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. @@ -880,7 +910,7 @@ def list_skus( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetListSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -942,7 +972,7 @@ def get_os_upgrade_history( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListOSUpgradeHistory"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListOSUpgradeHistory"]: """Gets list of OS upgrades on a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -954,7 +984,7 @@ def get_os_upgrade_history( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetListOSUpgradeHistory] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListOSUpgradeHistory"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1016,7 +1046,7 @@ async def _power_off_initial( resource_group_name: str, vm_scale_set_name: str, skip_shutdown: Optional[bool] = False, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1070,7 +1100,7 @@ async def begin_power_off( resource_group_name: str, vm_scale_set_name: str, skip_shutdown: Optional[bool] = False, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still @@ -1121,7 +1151,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1139,7 +1175,7 @@ async def _restart_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1190,7 +1226,7 @@ async def begin_restart( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Restarts one or more virtual machines in a VM scale set. @@ -1234,7 +1270,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1252,7 +1294,7 @@ async def _start_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1303,7 +1345,7 @@ async def begin_start( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Starts one or more virtual machines in a VM scale set. @@ -1347,7 +1389,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1365,7 +1413,7 @@ async def _redeploy_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1416,7 +1464,7 @@ async def begin_redeploy( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, @@ -1461,7 +1509,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1479,7 +1533,7 @@ async def _perform_maintenance_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1530,7 +1584,7 @@ async def begin_perform_maintenance( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances @@ -1577,7 +1631,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1595,7 +1655,7 @@ async def _update_instances_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1643,7 +1703,7 @@ async def begin_update_instances( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs ) -> AsyncLROPoller[None]: """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. @@ -1687,7 +1747,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1705,7 +1771,7 @@ async def _reimage_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_scale_set_reimage_input: Optional["models.VirtualMachineScaleSetReimageParameters"] = None, + vm_scale_set_reimage_input: Optional["_models.VirtualMachineScaleSetReimageParameters"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1756,7 +1822,7 @@ async def begin_reimage( self, resource_group_name: str, vm_scale_set_name: str, - vm_scale_set_reimage_input: Optional["models.VirtualMachineScaleSetReimageParameters"] = None, + vm_scale_set_reimage_input: Optional["_models.VirtualMachineScaleSetReimageParameters"] = None, **kwargs ) -> AsyncLROPoller[None]: """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which @@ -1802,7 +1868,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1820,7 +1892,7 @@ async def _reimage_all_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1871,7 +1943,7 @@ async def begin_reimage_all( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This @@ -1916,7 +1988,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1936,7 +2014,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( vm_scale_set_name: str, platform_update_domain: int, **kwargs - ) -> "models.RecoveryWalkResponse": + ) -> "_models.RecoveryWalkResponse": """Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. @@ -1952,7 +2030,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( :rtype: ~azure.mgmt.compute.v2019_12_01.models.RecoveryWalkResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryWalkResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1998,10 +2076,10 @@ async def convert_to_single_placement_group( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VMScaleSetConvertToSinglePlacementGroupInput", + parameters: "_models.VMScaleSetConvertToSinglePlacementGroupInput", **kwargs ) -> None: - """Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + """Converts SinglePlacementGroup property to true for a existing virtual machine scale set. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -2059,7 +2137,7 @@ async def _set_orchestration_service_state_initial( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.OrchestrationServiceStateInput", + parameters: "_models.OrchestrationServiceStateInput", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -2107,7 +2185,7 @@ async def begin_set_orchestration_service_state( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.OrchestrationServiceStateInput", + parameters: "_models.OrchestrationServiceStateInput", **kwargs ) -> AsyncLROPoller[None]: """Changes ServiceState property for a given service. @@ -2151,7 +2229,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_sizes_operations.py index 4738a94dcbd7..89977ca36386 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_sizes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VirtualMachineSizesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """This API is deprecated. Use `Resources Skus `_. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machines_operations.py index fbde41c0ced7..6c627e163f95 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machines_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachinesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list_by_location( self, location: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Gets all the virtual machines under the specified subscription for the specified location. :param location: The location for which virtual machines under the subscription are queried. @@ -57,7 +57,7 @@ def list_by_location( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,10 +117,10 @@ async def _capture_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineCaptureParameters", + parameters: "_models.VirtualMachineCaptureParameters", **kwargs - ) -> Optional["models.VirtualMachineCaptureResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + ) -> Optional["_models.VirtualMachineCaptureResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualMachineCaptureResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -172,9 +172,9 @@ async def begin_capture( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineCaptureParameters", + parameters: "_models.VirtualMachineCaptureParameters", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineCaptureResult"]: + ) -> AsyncLROPoller["_models.VirtualMachineCaptureResult"]: """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -195,7 +195,7 @@ async def begin_capture( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -220,7 +220,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -238,10 +244,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachine", + parameters: "_models.VirtualMachine", **kwargs - ) -> "models.VirtualMachine": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + ) -> "_models.VirtualMachine": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,9 +301,9 @@ async def begin_create_or_update( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachine", + parameters: "_models.VirtualMachine", **kwargs - ) -> AsyncLROPoller["models.VirtualMachine"]: + ) -> AsyncLROPoller["_models.VirtualMachine"]: """The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. @@ -318,7 +324,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -361,10 +373,10 @@ async def _update_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineUpdate", + parameters: "_models.VirtualMachineUpdate", **kwargs - ) -> "models.VirtualMachine": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + ) -> "_models.VirtualMachine": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -418,9 +430,9 @@ async def begin_update( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineUpdate", + parameters: "_models.VirtualMachineUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachine"]: + ) -> AsyncLROPoller["_models.VirtualMachine"]: """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -440,7 +452,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -465,7 +477,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -565,7 +583,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -585,7 +609,7 @@ async def get( vm_name: str, expand: Optional[str] = "instanceView", **kwargs - ) -> "models.VirtualMachine": + ) -> "_models.VirtualMachine": """Retrieves information about the model view or the instance view of a virtual machine. :param resource_group_name: The name of the resource group. @@ -599,7 +623,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachine :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -647,7 +671,7 @@ async def instance_view( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.VirtualMachineInstanceView": + ) -> "_models.VirtualMachineInstanceView": """Retrieves information about the run-time state of a virtual machine. :param resource_group_name: The name of the resource group. @@ -659,7 +683,7 @@ async def instance_view( :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -749,7 +773,12 @@ async def begin_convert_to_managed_disks( **kwargs ) -> AsyncLROPoller[None]: """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- - deallocated before invoking this operation. + deallocated before invoking this operation. :code:`
`For Windows, please refer to `Convert a + virtual machine from unmanaged disks to managed disks. `_.:code:`
`For Linux, + please refer to `Convert a virtual machine from unmanaged disks to managed disks. + `_. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -787,7 +816,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -888,7 +923,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -964,7 +1005,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. @@ -975,7 +1016,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1035,7 +1076,7 @@ def list_all( self, status_only: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. @@ -1047,7 +1088,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1109,7 +1150,7 @@ def list_available_sizes( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes to which the specified virtual machine can be resized. @@ -1122,7 +1163,7 @@ def list_available_sizes( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1275,7 +1316,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1377,7 +1424,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1477,7 +1530,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1577,7 +1636,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1677,7 +1742,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1695,7 +1766,7 @@ async def _reimage_initial( self, resource_group_name: str, vm_name: str, - parameters: Optional["models.VirtualMachineReimageParameters"] = None, + parameters: Optional["_models.VirtualMachineReimageParameters"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1746,7 +1817,7 @@ async def begin_reimage( self, resource_group_name: str, vm_name: str, - parameters: Optional["models.VirtualMachineReimageParameters"] = None, + parameters: Optional["_models.VirtualMachineReimageParameters"] = None, **kwargs ) -> AsyncLROPoller[None]: """Reimages the virtual machine which has an ephemeral OS disk back to its initial state. @@ -1790,7 +1861,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1852,7 +1929,8 @@ async def begin_perform_maintenance( vm_name: str, **kwargs ) -> AsyncLROPoller[None]: - """The operation to perform maintenance on a virtual machine. + """Shuts down the virtual machine, moves it to an already updated node, and powers it back on + during the self-service phase of planned maintenance. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1890,7 +1968,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1962,10 +2046,10 @@ async def _run_command_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> Optional["models.RunCommandResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + ) -> Optional["_models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2017,9 +2101,9 @@ async def begin_run_command( self, resource_group_name: str, vm_name: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> AsyncLROPoller["models.RunCommandResult"]: + ) -> AsyncLROPoller["_models.RunCommandResult"]: """Run command on the VM. :param resource_group_name: The name of the resource group. @@ -2039,7 +2123,7 @@ async def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2064,7 +2148,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/__init__.py index c2bbf318e8a7..c270d3b51252 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/__init__.py @@ -21,8 +21,6 @@ from ._models_py3 import BillingProfile from ._models_py3 import BootDiagnostics from ._models_py3 import BootDiagnosticsInstanceView - from ._models_py3 import Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties - from ._models_py3 import ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties from ._models_py3 import ComputeOperationListResult from ._models_py3 import ComputeOperationValue from ._models_py3 import DataDisk @@ -150,6 +148,7 @@ from ._models_py3 import Usage from ._models_py3 import UsageName from ._models_py3 import UserArtifactSource + from ._models_py3 import UserAssignedIdentitiesValue from ._models_py3 import VMScaleSetConvertToSinglePlacementGroupInput from ._models_py3 import VaultCertificate from ._models_py3 import VaultSecretGroup @@ -179,6 +178,7 @@ from ._models_py3 import VirtualMachineScaleSetExtensionUpdate from ._models_py3 import VirtualMachineScaleSetIPConfiguration from ._models_py3 import VirtualMachineScaleSetIdentity + from ._models_py3 import VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue from ._models_py3 import VirtualMachineScaleSetInstanceView from ._models_py3 import VirtualMachineScaleSetInstanceViewStatusesSummary from ._models_py3 import VirtualMachineScaleSetIpTag @@ -239,8 +239,6 @@ from ._models import BillingProfile # type: ignore from ._models import BootDiagnostics # type: ignore from ._models import BootDiagnosticsInstanceView # type: ignore - from ._models import Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore - from ._models import ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore from ._models import ComputeOperationListResult # type: ignore from ._models import ComputeOperationValue # type: ignore from ._models import DataDisk # type: ignore @@ -368,6 +366,7 @@ from ._models import Usage # type: ignore from ._models import UsageName # type: ignore from ._models import UserArtifactSource # type: ignore + from ._models import UserAssignedIdentitiesValue # type: ignore from ._models import VMScaleSetConvertToSinglePlacementGroupInput # type: ignore from ._models import VaultCertificate # type: ignore from ._models import VaultSecretGroup # type: ignore @@ -397,6 +396,7 @@ from ._models import VirtualMachineScaleSetExtensionUpdate # type: ignore from ._models import VirtualMachineScaleSetIPConfiguration # type: ignore from ._models import VirtualMachineScaleSetIdentity # type: ignore + from ._models import VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue # type: ignore from ._models import VirtualMachineScaleSetInstanceView # type: ignore from ._models import VirtualMachineScaleSetInstanceViewStatusesSummary # type: ignore from ._models import VirtualMachineScaleSetIpTag # type: ignore @@ -503,8 +503,6 @@ 'BillingProfile', 'BootDiagnostics', 'BootDiagnosticsInstanceView', - 'Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties', - 'ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties', 'ComputeOperationListResult', 'ComputeOperationValue', 'DataDisk', @@ -632,6 +630,7 @@ 'Usage', 'UsageName', 'UserArtifactSource', + 'UserAssignedIdentitiesValue', 'VMScaleSetConvertToSinglePlacementGroupInput', 'VaultCertificate', 'VaultSecretGroup', @@ -661,6 +660,7 @@ 'VirtualMachineScaleSetExtensionUpdate', 'VirtualMachineScaleSetIPConfiguration', 'VirtualMachineScaleSetIdentity', + 'VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue', 'VirtualMachineScaleSetInstanceView', 'VirtualMachineScaleSetInstanceViewStatusesSummary', 'VirtualMachineScaleSetIpTag', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models.py index 42c40844b160..9a66882ad198 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models.py @@ -547,66 +547,6 @@ def __init__( self.status = None -class Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - class ComputeOperationListResult(msrest.serialization.Model): """The List Compute Operation operation response. @@ -5486,6 +5426,36 @@ def __init__( self.media_link = kwargs['media_link'] +class UserAssignedIdentitiesValue(msrest.serialization.Model): + """UserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class VaultCertificate(msrest.serialization.Model): """Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM. @@ -6170,7 +6140,7 @@ class VirtualMachineIdentity(msrest.serialization.Model): Machine. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :type user_assigned_identities: dict[str, - ~azure.mgmt.compute.v2019_12_01.models.Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties] + ~azure.mgmt.compute.v2019_12_01.models.UserAssignedIdentitiesValue] """ _validation = { @@ -6182,7 +6152,7 @@ class VirtualMachineIdentity(msrest.serialization.Model): 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentitiesValue}'}, } def __init__( @@ -6843,7 +6813,7 @@ class VirtualMachineScaleSetIdentity(msrest.serialization.Model): form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :type user_assigned_identities: dict[str, - ~azure.mgmt.compute.v2019_12_01.models.ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties] + ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue] """ _validation = { @@ -6855,7 +6825,7 @@ class VirtualMachineScaleSetIdentity(msrest.serialization.Model): 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue}'}, } def __init__( @@ -6869,6 +6839,36 @@ def __init__( self.user_assigned_identities = kwargs.get('user_assigned_identities', None) +class VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue(msrest.serialization.Model): + """VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class VirtualMachineScaleSetInstanceView(msrest.serialization.Model): """The instance view of a virtual machine scale set. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models_py3.py index 8bb5a9df1c66..96ca84e142b9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models_py3.py @@ -605,66 +605,6 @@ def __init__( self.status = None -class Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - class ComputeOperationListResult(msrest.serialization.Model): """The List Compute Operation operation response. @@ -6017,6 +5957,36 @@ def __init__( self.media_link = media_link +class UserAssignedIdentitiesValue(msrest.serialization.Model): + """UserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class VaultCertificate(msrest.serialization.Model): """Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM. @@ -6779,7 +6749,7 @@ class VirtualMachineIdentity(msrest.serialization.Model): Machine. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :type user_assigned_identities: dict[str, - ~azure.mgmt.compute.v2019_12_01.models.Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties] + ~azure.mgmt.compute.v2019_12_01.models.UserAssignedIdentitiesValue] """ _validation = { @@ -6791,14 +6761,14 @@ class VirtualMachineIdentity(msrest.serialization.Model): 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentitiesValue}'}, } def __init__( self, *, type: Optional[Union[str, "ResourceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, "Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + user_assigned_identities: Optional[Dict[str, "UserAssignedIdentitiesValue"]] = None, **kwargs ): super(VirtualMachineIdentity, self).__init__(**kwargs) @@ -7541,7 +7511,7 @@ class VirtualMachineScaleSetIdentity(msrest.serialization.Model): form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :type user_assigned_identities: dict[str, - ~azure.mgmt.compute.v2019_12_01.models.ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties] + ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue] """ _validation = { @@ -7553,14 +7523,14 @@ class VirtualMachineScaleSetIdentity(msrest.serialization.Model): 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue}'}, } def __init__( self, *, type: Optional[Union[str, "ResourceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, "ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + user_assigned_identities: Optional[Dict[str, "VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue"]] = None, **kwargs ): super(VirtualMachineScaleSetIdentity, self).__init__(**kwargs) @@ -7570,6 +7540,36 @@ def __init__( self.user_assigned_identities = user_assigned_identities +class VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue(msrest.serialization.Model): + """VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class VirtualMachineScaleSetInstanceView(msrest.serialization.Model): """The instance view of a virtual machine scale set. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_availability_sets_operations.py index 760f9f15cf23..4e9bfef669fd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_availability_sets_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailabilitySetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str availability_set_name, # type: str - parameters, # type: "models.AvailabilitySet" + parameters, # type: "_models.AvailabilitySet" **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Create or update an availability set. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~azure.mgmt.compute.v2019_12_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,10 +116,10 @@ def update( self, resource_group_name, # type: str availability_set_name, # type: str - parameters, # type: "models.AvailabilitySetUpdate" + parameters, # type: "_models.AvailabilitySetUpdate" **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Update an availability set. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ def update( :rtype: ~azure.mgmt.compute.v2019_12_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -239,7 +239,7 @@ def get( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Retrieves information about an availability set. :param resource_group_name: The name of the resource group. @@ -251,7 +251,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -297,7 +297,7 @@ def list_by_subscription( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailabilitySetListResult"] + # type: (...) -> Iterable["_models.AvailabilitySetListResult"] """Lists all availability sets in a subscription. :param expand: The expand expression to apply to the operation. Allowed values are @@ -308,7 +308,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -370,7 +370,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailabilitySetListResult"] + # type: (...) -> Iterable["_models.AvailabilitySetListResult"] """Lists all availability sets in a resource group. :param resource_group_name: The name of the resource group. @@ -380,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -442,7 +442,7 @@ def list_available_sizes( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. @@ -455,7 +455,7 @@ def list_available_sizes( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_host_groups_operations.py index c49668eaed55..f460880de576 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_host_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DedicatedHostGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str host_group_name, # type: str - parameters, # type: "models.DedicatedHostGroup" + parameters, # type: "_models.DedicatedHostGroup" **kwargs # type: Any ): - # type: (...) -> "models.DedicatedHostGroup" + # type: (...) -> "_models.DedicatedHostGroup" """Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.compute.v2019_12_01.models.DedicatedHostGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,10 +122,10 @@ def update( self, resource_group_name, # type: str host_group_name, # type: str - parameters, # type: "models.DedicatedHostGroupUpdate" + parameters, # type: "_models.DedicatedHostGroupUpdate" **kwargs # type: Any ): - # type: (...) -> "models.DedicatedHostGroup" + # type: (...) -> "_models.DedicatedHostGroup" """Update an dedicated host group. :param resource_group_name: The name of the resource group. @@ -139,7 +139,7 @@ def update( :rtype: ~azure.mgmt.compute.v2019_12_01.models.DedicatedHostGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -245,7 +245,7 @@ def get( host_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DedicatedHostGroup" + # type: (...) -> "_models.DedicatedHostGroup" """Retrieves information about a dedicated host group. :param resource_group_name: The name of the resource group. @@ -257,7 +257,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.DedicatedHostGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,7 +303,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DedicatedHostGroupListResult"] + # type: (...) -> Iterable["_models.DedicatedHostGroupListResult"] """Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. @@ -314,7 +314,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.DedicatedHostGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -374,7 +374,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DedicatedHostGroupListResult"] + # type: (...) -> Iterable["_models.DedicatedHostGroupListResult"] """Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. @@ -383,7 +383,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.DedicatedHostGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_hosts_operations.py index a9f0a02df5d3..7f848aa314ca 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DedicatedHostsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str host_group_name, # type: str host_name, # type: str - parameters, # type: "models.DedicatedHost" + parameters, # type: "_models.DedicatedHost" **kwargs # type: Any ): - # type: (...) -> "models.DedicatedHost" - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + # type: (...) -> "_models.DedicatedHost" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def begin_create_or_update( resource_group_name, # type: str host_group_name, # type: str host_name, # type: str - parameters, # type: "models.DedicatedHost" + parameters, # type: "_models.DedicatedHost" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DedicatedHost"] + # type: (...) -> LROPoller["_models.DedicatedHost"] """Create or update a dedicated host . :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -182,11 +189,11 @@ def _update_initial( resource_group_name, # type: str host_group_name, # type: str host_name, # type: str - parameters, # type: "models.DedicatedHostUpdate" + parameters, # type: "_models.DedicatedHostUpdate" **kwargs # type: Any ): - # type: (...) -> "models.DedicatedHost" - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + # type: (...) -> "_models.DedicatedHost" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -238,10 +245,10 @@ def begin_update( resource_group_name, # type: str host_group_name, # type: str host_name, # type: str - parameters, # type: "models.DedicatedHostUpdate" + parameters, # type: "_models.DedicatedHostUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DedicatedHost"] + # type: (...) -> LROPoller["_models.DedicatedHost"] """Update an dedicated host . :param resource_group_name: The name of the resource group. @@ -263,7 +270,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -289,7 +296,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -397,7 +411,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -419,7 +440,7 @@ def get( expand="instanceView", # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.DedicatedHost" + # type: (...) -> "_models.DedicatedHost" """Retrieves information about a dedicated host. :param resource_group_name: The name of the resource group. @@ -435,7 +456,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.DedicatedHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -485,7 +506,7 @@ def list_by_host_group( host_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DedicatedHostListResult"] + # type: (...) -> Iterable["_models.DedicatedHostListResult"] """Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. @@ -498,7 +519,7 @@ def list_by_host_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.DedicatedHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_galleries_operations.py index aa918a42b34d..5209766a44d3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_galleries_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class GalleriesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str gallery_name, # type: str - gallery, # type: "models.Gallery" + gallery, # type: "_models.Gallery" **kwargs # type: Any ): - # type: (...) -> "models.Gallery" - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + # type: (...) -> "_models.Gallery" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def begin_create_or_update( self, resource_group_name, # type: str gallery_name, # type: str - gallery, # type: "models.Gallery" + gallery, # type: "_models.Gallery" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Gallery"] + # type: (...) -> LROPoller["_models.Gallery"] """Create or update a Shared Image Gallery. :param resource_group_name: The name of the resource group. @@ -136,7 +136,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -161,7 +161,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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: @@ -179,11 +185,11 @@ def _update_initial( self, resource_group_name, # type: str gallery_name, # type: str - gallery, # type: "models.GalleryUpdate" + gallery, # type: "_models.GalleryUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Gallery" - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + # type: (...) -> "_models.Gallery" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -233,10 +239,10 @@ def begin_update( self, resource_group_name, # type: str gallery_name, # type: str - gallery, # type: "models.GalleryUpdate" + gallery, # type: "_models.GalleryUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Gallery"] + # type: (...) -> LROPoller["_models.Gallery"] """Update a Shared Image Gallery. :param resource_group_name: The name of the resource group. @@ -257,7 +263,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -282,7 +288,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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: @@ -302,7 +314,7 @@ def get( gallery_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Gallery" + # type: (...) -> "_models.Gallery" """Retrieves information about a Shared Image Gallery. :param resource_group_name: The name of the resource group. @@ -314,7 +326,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.Gallery :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Gallery"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -445,7 +457,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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: @@ -464,7 +482,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.GalleryList"] + # type: (...) -> Iterable["_models.GalleryList"] """List galleries under a resource group. :param resource_group_name: The name of the resource group. @@ -474,7 +492,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.GalleryList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -534,7 +552,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.GalleryList"] + # type: (...) -> Iterable["_models.GalleryList"] """List galleries under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -542,7 +560,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.GalleryList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_application_versions_operations.py index 71ba90003b63..4f741c62bb6a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_application_versions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class GalleryApplicationVersionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,11 +53,11 @@ def _create_or_update_initial( gallery_name, # type: str gallery_application_name, # type: str gallery_application_version_name, # type: str - gallery_application_version, # type: "models.GalleryApplicationVersion" + gallery_application_version, # type: "_models.GalleryApplicationVersion" **kwargs # type: Any ): - # type: (...) -> "models.GalleryApplicationVersion" - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] + # type: (...) -> "_models.GalleryApplicationVersion" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,10 +118,10 @@ def begin_create_or_update( gallery_name, # type: str gallery_application_name, # type: str gallery_application_version_name, # type: str - gallery_application_version, # type: "models.GalleryApplicationVersion" + gallery_application_version, # type: "_models.GalleryApplicationVersion" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GalleryApplicationVersion"] + # type: (...) -> LROPoller["_models.GalleryApplicationVersion"] """Create or update a gallery Application Version. :param resource_group_name: The name of the resource group. @@ -151,7 +151,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -178,7 +178,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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: @@ -198,11 +206,11 @@ def _update_initial( gallery_name, # type: str gallery_application_name, # type: str gallery_application_version_name, # type: str - gallery_application_version, # type: "models.GalleryApplicationVersionUpdate" + gallery_application_version, # type: "_models.GalleryApplicationVersionUpdate" **kwargs # type: Any ): - # type: (...) -> "models.GalleryApplicationVersion" - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] + # type: (...) -> "_models.GalleryApplicationVersion" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -256,10 +264,10 @@ def begin_update( gallery_name, # type: str gallery_application_name, # type: str gallery_application_version_name, # type: str - gallery_application_version, # type: "models.GalleryApplicationVersionUpdate" + gallery_application_version, # type: "_models.GalleryApplicationVersionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GalleryApplicationVersion"] + # type: (...) -> LROPoller["_models.GalleryApplicationVersion"] """Update a gallery Application Version. :param resource_group_name: The name of the resource group. @@ -289,7 +297,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +324,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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: @@ -336,10 +352,10 @@ def get( gallery_name, # type: str gallery_application_name, # type: str gallery_application_version_name, # type: str - expand=None, # type: Optional[Union[str, "models.ReplicationStatusTypes"]] + expand=None, # type: Optional[Union[str, "_models.ReplicationStatusTypes"]] **kwargs # type: Any ): - # type: (...) -> "models.GalleryApplicationVersion" + # type: (...) -> "_models.GalleryApplicationVersion" """Retrieves information about a gallery Application Version. :param resource_group_name: The name of the resource group. @@ -360,7 +376,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.GalleryApplicationVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -510,7 +526,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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: @@ -531,7 +555,7 @@ def list_by_gallery_application( gallery_application_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.GalleryApplicationVersionList"] + # type: (...) -> Iterable["_models.GalleryApplicationVersionList"] """List gallery Application Versions in a gallery Application Definition. :param resource_group_name: The name of the resource group. @@ -547,7 +571,7 @@ def list_by_gallery_application( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.GalleryApplicationVersionList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationVersionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_applications_operations.py index 24fdc771c531..ba971ccbef38 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_applications_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class GalleryApplicationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str gallery_name, # type: str gallery_application_name, # type: str - gallery_application, # type: "models.GalleryApplication" + gallery_application, # type: "_models.GalleryApplication" **kwargs # type: Any ): - # type: (...) -> "models.GalleryApplication" - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] + # type: (...) -> "_models.GalleryApplication" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,10 +115,10 @@ def begin_create_or_update( resource_group_name, # type: str gallery_name, # type: str gallery_application_name, # type: str - gallery_application, # type: "models.GalleryApplication" + gallery_application, # type: "_models.GalleryApplication" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GalleryApplication"] + # type: (...) -> LROPoller["_models.GalleryApplication"] """Create or update a gallery Application Definition. :param resource_group_name: The name of the resource group. @@ -144,7 +144,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -170,7 +170,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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: @@ -189,11 +196,11 @@ def _update_initial( resource_group_name, # type: str gallery_name, # type: str gallery_application_name, # type: str - gallery_application, # type: "models.GalleryApplicationUpdate" + gallery_application, # type: "_models.GalleryApplicationUpdate" **kwargs # type: Any ): - # type: (...) -> "models.GalleryApplication" - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] + # type: (...) -> "_models.GalleryApplication" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -245,10 +252,10 @@ def begin_update( resource_group_name, # type: str gallery_name, # type: str gallery_application_name, # type: str - gallery_application, # type: "models.GalleryApplicationUpdate" + gallery_application, # type: "_models.GalleryApplicationUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GalleryApplication"] + # type: (...) -> LROPoller["_models.GalleryApplication"] """Update a gallery Application Definition. :param resource_group_name: The name of the resource group. @@ -273,7 +280,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -299,7 +306,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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: @@ -320,7 +334,7 @@ def get( gallery_application_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GalleryApplication" + # type: (...) -> "_models.GalleryApplication" """Retrieves information about a gallery Application Definition. :param resource_group_name: The name of the resource group. @@ -336,7 +350,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.GalleryApplication :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplication"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -475,7 +489,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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: @@ -495,7 +516,7 @@ def list_by_gallery( gallery_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.GalleryApplicationList"] + # type: (...) -> Iterable["_models.GalleryApplicationList"] """List gallery Application Definitions in a gallery. :param resource_group_name: The name of the resource group. @@ -508,7 +529,7 @@ def list_by_gallery( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.GalleryApplicationList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryApplicationList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_image_versions_operations.py index 6297f645cc9c..8ddafde27a41 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_image_versions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class GalleryImageVersionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,11 +53,11 @@ def _create_or_update_initial( gallery_name, # type: str gallery_image_name, # type: str gallery_image_version_name, # type: str - gallery_image_version, # type: "models.GalleryImageVersion" + gallery_image_version, # type: "_models.GalleryImageVersion" **kwargs # type: Any ): - # type: (...) -> "models.GalleryImageVersion" - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + # type: (...) -> "_models.GalleryImageVersion" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,10 +118,10 @@ def begin_create_or_update( gallery_name, # type: str gallery_image_name, # type: str gallery_image_version_name, # type: str - gallery_image_version, # type: "models.GalleryImageVersion" + gallery_image_version, # type: "_models.GalleryImageVersion" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GalleryImageVersion"] + # type: (...) -> LROPoller["_models.GalleryImageVersion"] """Create or update a gallery Image Version. :param resource_group_name: The name of the resource group. @@ -151,7 +151,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -178,7 +178,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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: @@ -198,11 +206,11 @@ def _update_initial( gallery_name, # type: str gallery_image_name, # type: str gallery_image_version_name, # type: str - gallery_image_version, # type: "models.GalleryImageVersionUpdate" + gallery_image_version, # type: "_models.GalleryImageVersionUpdate" **kwargs # type: Any ): - # type: (...) -> "models.GalleryImageVersion" - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + # type: (...) -> "_models.GalleryImageVersion" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -256,10 +264,10 @@ def begin_update( gallery_name, # type: str gallery_image_name, # type: str gallery_image_version_name, # type: str - gallery_image_version, # type: "models.GalleryImageVersionUpdate" + gallery_image_version, # type: "_models.GalleryImageVersionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GalleryImageVersion"] + # type: (...) -> LROPoller["_models.GalleryImageVersion"] """Update a gallery Image Version. :param resource_group_name: The name of the resource group. @@ -289,7 +297,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -316,7 +324,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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: @@ -336,10 +352,10 @@ def get( gallery_name, # type: str gallery_image_name, # type: str gallery_image_version_name, # type: str - expand=None, # type: Optional[Union[str, "models.ReplicationStatusTypes"]] + expand=None, # type: Optional[Union[str, "_models.ReplicationStatusTypes"]] **kwargs # type: Any ): - # type: (...) -> "models.GalleryImageVersion" + # type: (...) -> "_models.GalleryImageVersion" """Retrieves information about a gallery Image Version. :param resource_group_name: The name of the resource group. @@ -359,7 +375,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.GalleryImageVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersion"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -508,7 +524,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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: @@ -529,7 +553,7 @@ def list_by_gallery_image( gallery_image_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.GalleryImageVersionList"] + # type: (...) -> Iterable["_models.GalleryImageVersionList"] """List gallery Image Versions in a gallery Image Definition. :param resource_group_name: The name of the resource group. @@ -545,7 +569,7 @@ def list_by_gallery_image( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.GalleryImageVersionList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageVersionList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersionList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_images_operations.py index 12cab89fc5d4..c47bb3e8d611 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class GalleryImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str gallery_name, # type: str gallery_image_name, # type: str - gallery_image, # type: "models.GalleryImage" + gallery_image, # type: "_models.GalleryImage" **kwargs # type: Any ): - # type: (...) -> "models.GalleryImage" - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + # type: (...) -> "_models.GalleryImage" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,10 +115,10 @@ def begin_create_or_update( resource_group_name, # type: str gallery_name, # type: str gallery_image_name, # type: str - gallery_image, # type: "models.GalleryImage" + gallery_image, # type: "_models.GalleryImage" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GalleryImage"] + # type: (...) -> LROPoller["_models.GalleryImage"] """Create or update a gallery Image Definition. :param resource_group_name: The name of the resource group. @@ -143,7 +143,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -169,7 +169,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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: @@ -188,11 +195,11 @@ def _update_initial( resource_group_name, # type: str gallery_name, # type: str gallery_image_name, # type: str - gallery_image, # type: "models.GalleryImageUpdate" + gallery_image, # type: "_models.GalleryImageUpdate" **kwargs # type: Any ): - # type: (...) -> "models.GalleryImage" - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + # type: (...) -> "_models.GalleryImage" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -244,10 +251,10 @@ def begin_update( resource_group_name, # type: str gallery_name, # type: str gallery_image_name, # type: str - gallery_image, # type: "models.GalleryImageUpdate" + gallery_image, # type: "_models.GalleryImageUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.GalleryImage"] + # type: (...) -> LROPoller["_models.GalleryImage"] """Update a gallery Image Definition. :param resource_group_name: The name of the resource group. @@ -272,7 +279,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -298,7 +305,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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: @@ -319,7 +333,7 @@ def get( gallery_image_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.GalleryImage" + # type: (...) -> "_models.GalleryImage" """Retrieves information about a gallery Image Definition. :param resource_group_name: The name of the resource group. @@ -334,7 +348,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.GalleryImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -473,7 +487,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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: @@ -493,7 +514,7 @@ def list_by_gallery( gallery_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.GalleryImageList"] + # type: (...) -> Iterable["_models.GalleryImageList"] """List gallery Image Definitions in a gallery. :param resource_group_name: The name of the resource group. @@ -506,7 +527,7 @@ def list_by_gallery( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.GalleryImageList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.GalleryImageList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_images_operations.py index d9a180119898..684855f7d0f1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.Image" + parameters, # type: "_models.Image" **kwargs # type: Any ): - # type: (...) -> "models.Image" - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + # type: (...) -> "_models.Image" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.Image" + parameters, # type: "_models.Image" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Image"] + # type: (...) -> LROPoller["_models.Image"] """Create or update an image. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -175,11 +181,11 @@ def _update_initial( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.ImageUpdate" + parameters, # type: "_models.ImageUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Image" - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + # type: (...) -> "_models.Image" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -233,10 +239,10 @@ def begin_update( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.ImageUpdate" + parameters, # type: "_models.ImageUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Image"] + # type: (...) -> LROPoller["_models.Image"] """Update an image. :param resource_group_name: The name of the resource group. @@ -256,7 +262,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -281,7 +287,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -383,7 +395,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -404,7 +422,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Image" + # type: (...) -> "_models.Image" """Gets an image. :param resource_group_name: The name of the resource group. @@ -418,7 +436,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.Image :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +484,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ImageListResult"] + # type: (...) -> Iterable["_models.ImageListResult"] """Gets the list of images under a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +494,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -536,7 +554,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ImageListResult"] + # type: (...) -> Iterable["_models.ImageListResult"] """Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. @@ -545,7 +563,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_log_analytics_operations.py index 57218b2d9891..c20eb08be893 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_log_analytics_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class LogAnalyticsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,11 +49,11 @@ def __init__(self, client, config, serializer, deserializer): def _export_request_rate_by_interval_initial( self, location, # type: str - parameters, # type: "models.RequestRateByIntervalInput" + parameters, # type: "_models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> Optional["models.LogAnalyticsOperationResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + # type: (...) -> Optional["_models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -103,10 +103,10 @@ def _export_request_rate_by_interval_initial( def begin_export_request_rate_by_interval( self, location, # type: str - parameters, # type: "models.RequestRateByIntervalInput" + parameters, # type: "_models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] + # type: (...) -> LROPoller["_models.LogAnalyticsOperationResult"] """Export logs that show Api requests made by this subscription in the given time window to show throttling activities. @@ -125,7 +125,7 @@ def begin_export_request_rate_by_interval( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -149,7 +149,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -166,11 +171,11 @@ def get_long_running_output(pipeline_response): def _export_throttled_requests_initial( self, location, # type: str - parameters, # type: "models.LogAnalyticsInputBase" + parameters, # type: "_models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> Optional["models.LogAnalyticsOperationResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + # type: (...) -> Optional["_models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,10 +225,10 @@ def _export_throttled_requests_initial( def begin_export_throttled_requests( self, location, # type: str - parameters, # type: "models.LogAnalyticsInputBase" + parameters, # type: "_models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] + # type: (...) -> LROPoller["_models.LogAnalyticsOperationResult"] """Export logs that show total throttled Api requests for this subscription in the given time window. @@ -242,7 +247,7 @@ def begin_export_throttled_requests( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -266,7 +271,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_operations.py index 2fb09afc3f6f..97b37638b781 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ComputeOperationListResult"] + # type: (...) -> Iterable["_models.ComputeOperationListResult"] """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.ComputeOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeOperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_proximity_placement_groups_operations.py index 6e408f760eb6..3596a3d4ff63 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_proximity_placement_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ProximityPlacementGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str proximity_placement_group_name, # type: str - parameters, # type: "models.ProximityPlacementGroup" + parameters, # type: "_models.ProximityPlacementGroup" **kwargs # type: Any ): - # type: (...) -> "models.ProximityPlacementGroup" + # type: (...) -> "_models.ProximityPlacementGroup" """Create or update a proximity placement group. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~azure.mgmt.compute.v2019_12_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,10 +120,10 @@ def update( self, resource_group_name, # type: str proximity_placement_group_name, # type: str - parameters, # type: "models.UpdateResource" + parameters, # type: "_models.UpdateResource" **kwargs # type: Any ): - # type: (...) -> "models.ProximityPlacementGroup" + # type: (...) -> "_models.ProximityPlacementGroup" """Update a proximity placement group. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def update( :rtype: ~azure.mgmt.compute.v2019_12_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -244,7 +244,7 @@ def get( include_colocation_status=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ProximityPlacementGroup" + # type: (...) -> "_models.ProximityPlacementGroup" """Retrieves information about a proximity placement group . :param resource_group_name: The name of the resource group. @@ -259,7 +259,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -306,7 +306,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProximityPlacementGroupListResult"] + # type: (...) -> Iterable["_models.ProximityPlacementGroupListResult"] """Lists all proximity placement groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -314,7 +314,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.ProximityPlacementGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -374,7 +374,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProximityPlacementGroupListResult"] + # type: (...) -> Iterable["_models.ProximityPlacementGroupListResult"] """Lists all proximity placement groups in a resource group. :param resource_group_name: The name of the resource group. @@ -384,7 +384,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.ProximityPlacementGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_ssh_public_keys_operations.py index a29cd3f62a97..779efa1ff9c4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_ssh_public_keys_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class SshPublicKeysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.SshPublicKeysGroupListResult"] + # type: (...) -> Iterable["_models.SshPublicKeysGroupListResult"] """Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. @@ -58,7 +58,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.SshPublicKeysGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeysGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SshPublicKeysGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,7 +118,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SshPublicKeysGroupListResult"] + # type: (...) -> Iterable["_models.SshPublicKeysGroupListResult"] """Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. @@ -129,7 +129,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.SshPublicKeysGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeysGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SshPublicKeysGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -189,10 +189,10 @@ def create( self, resource_group_name, # type: str ssh_public_key_name, # type: str - parameters, # type: "models.SshPublicKeyResource" + parameters, # type: "_models.SshPublicKeyResource" **kwargs # type: Any ): - # type: (...) -> "models.SshPublicKeyResource" + # type: (...) -> "_models.SshPublicKeyResource" """Creates a new SSH public key resource. :param resource_group_name: The name of the resource group. @@ -206,7 +206,7 @@ def create( :rtype: ~azure.mgmt.compute.v2019_12_01.models.SshPublicKeyResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SshPublicKeyResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -260,10 +260,10 @@ def update( self, resource_group_name, # type: str ssh_public_key_name, # type: str - parameters, # type: "models.SshPublicKeyUpdateResource" + parameters, # type: "_models.SshPublicKeyUpdateResource" **kwargs # type: Any ): - # type: (...) -> "models.SshPublicKeyResource" + # type: (...) -> "_models.SshPublicKeyResource" """Updates a new SSH public key resource. :param resource_group_name: The name of the resource group. @@ -277,7 +277,7 @@ def update( :rtype: ~azure.mgmt.compute.v2019_12_01.models.SshPublicKeyResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SshPublicKeyResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -383,7 +383,7 @@ def get( ssh_public_key_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SshPublicKeyResource" + # type: (...) -> "_models.SshPublicKeyResource" """Retrieves information about an SSH public key. :param resource_group_name: The name of the resource group. @@ -395,7 +395,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.SshPublicKeyResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SshPublicKeyResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -442,7 +442,7 @@ def generate_key_pair( ssh_public_key_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SshPublicKeyGenerateKeyPairResult" + # type: (...) -> "_models.SshPublicKeyGenerateKeyPairResult" """Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. @@ -456,7 +456,7 @@ def generate_key_pair( :rtype: ~azure.mgmt.compute.v2019_12_01.models.SshPublicKeyGenerateKeyPairResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyGenerateKeyPairResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SshPublicKeyGenerateKeyPairResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_usage_operations.py index f194c135090a..a724d1d11106 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsageOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListUsagesResult"] + # type: (...) -> Iterable["_models.ListUsagesResult"] """Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extension_images_operations.py index 968d664d7526..c57d3f6881cb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extension_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VirtualMachineExtensionImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( version, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtensionImage" + # type: (...) -> "_models.VirtualMachineExtensionImage" """Gets a virtual machine extension image. :param location: The name of a supported Azure region. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtensionImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def list_types( publisher_name, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineExtensionImage"] + # type: (...) -> List["_models.VirtualMachineExtensionImage"] """Gets a list of virtual machine extension image types. :param location: The name of a supported Azure region. @@ -129,7 +129,7 @@ def list_types( :rtype: list[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -180,7 +180,7 @@ def list_versions( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineExtensionImage"] + # type: (...) -> List["_models.VirtualMachineExtensionImage"] """Gets a list of virtual machine extension image versions. :param location: The name of a supported Azure region. @@ -200,7 +200,7 @@ def list_versions( :rtype: list[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extensions_operations.py index 467c5ff396f2..84466a2d85b1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VirtualMachineExtensionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineExtension"] """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -183,11 +190,11 @@ def _update_initial( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -239,10 +246,10 @@ def begin_update( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineExtension"] """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -265,7 +272,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -291,7 +298,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -399,7 +413,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -421,7 +442,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" + # type: (...) -> "_models.VirtualMachineExtension" """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -437,7 +458,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,7 +509,7 @@ def list( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtensionsListResult" + # type: (...) -> "_models.VirtualMachineExtensionsListResult" """The operation to get all extensions of a Virtual Machine. :param resource_group_name: The name of the resource group. @@ -502,7 +523,7 @@ def list( :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtensionsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_images_operations.py index f1d1c3e8652c..466937425427 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VirtualMachineImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( version, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineImage" + # type: (...) -> "_models.VirtualMachineImage" """Gets a virtual machine image. :param location: The name of a supported Azure region. @@ -71,7 +71,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -126,7 +126,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. @@ -149,7 +149,7 @@ def list( :rtype: list[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -204,7 +204,7 @@ def list_offers( publisher_name, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image offers for the specified location and publisher. :param location: The name of a supported Azure region. @@ -216,7 +216,7 @@ def list_offers( :rtype: list[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,7 +262,7 @@ def list_publishers( location, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image publishers for the specified Azure location. :param location: The name of a supported Azure region. @@ -272,7 +272,7 @@ def list_publishers( :rtype: list[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -319,7 +319,7 @@ def list_skus( offer, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. :param location: The name of a supported Azure region. @@ -333,7 +333,7 @@ def list_skus( :rtype: list[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_run_commands_operations.py index a3ea89d142a6..f25a409f6bb7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_run_commands_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VirtualMachineRunCommandsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RunCommandListResult"] + # type: (...) -> Iterable["_models.RunCommandListResult"] """Lists all available run commands for a subscription in a location. :param location: The location upon which run commands is queried. @@ -60,7 +60,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.RunCommandListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +122,7 @@ def get( command_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RunCommandDocument" + # type: (...) -> "_models.RunCommandDocument" """Gets specific run command for a subscription in a location. :param location: The location upon which run commands is queried. @@ -134,7 +134,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.RunCommandDocument :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandDocument"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_extensions_operations.py index 4c7caa19ee3a..ca9efa335fcf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetExtensionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str vm_scale_set_name, # type: str vmss_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineScaleSetExtension" + extension_parameters, # type: "_models.VirtualMachineScaleSetExtension" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + # type: (...) -> "_models.VirtualMachineScaleSetExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def begin_create_or_update( resource_group_name, # type: str vm_scale_set_name, # type: str vmss_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineScaleSetExtension" + extension_parameters, # type: "_models.VirtualMachineScaleSetExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSetExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSetExtension"] """The operation to create or update an extension. :param resource_group_name: The name of the resource group. @@ -139,7 +139,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -165,7 +165,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -184,11 +191,11 @@ def _update_initial( resource_group_name, # type: str vm_scale_set_name, # type: str vmss_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineScaleSetExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineScaleSetExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + # type: (...) -> "_models.VirtualMachineScaleSetExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -244,10 +251,10 @@ def begin_update( resource_group_name, # type: str vm_scale_set_name, # type: str vmss_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineScaleSetExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineScaleSetExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSetExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSetExtension"] """The operation to update an extension. :param resource_group_name: The name of the resource group. @@ -270,7 +277,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -296,7 +303,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -404,7 +418,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -426,7 +447,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetExtension" + # type: (...) -> "_models.VirtualMachineScaleSetExtension" """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -442,7 +463,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -492,7 +513,7 @@ def list( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetExtensionListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetExtensionListResult"] """Gets a list of all extensions in a VM scale set. :param resource_group_name: The name of the resource group. @@ -504,7 +525,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetExtensionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtensionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 6aa20879d16a..72cd75cb72ab 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VirtualMachineScaleSetRollingUpgradesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -134,7 +134,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -238,7 +244,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -342,7 +354,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -362,7 +380,7 @@ def get_latest( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RollingUpgradeStatusInfo" + # type: (...) -> "_models.RollingUpgradeStatusInfo" """Gets the status of the latest virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -374,7 +392,7 @@ def get_latest( :rtype: ~azure.mgmt.compute.v2019_12_01.models.RollingUpgradeStatusInfo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RollingUpgradeStatusInfo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 99983dfe0f7e..d0ea6e3fdce6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VirtualMachineScaleSetVMExtensionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( vm_scale_set_name, # type: str instance_id, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -114,10 +114,10 @@ def begin_create_or_update( vm_scale_set_name, # type: str instance_id, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineExtension"] """The operation to create or update the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -142,7 +142,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -169,7 +169,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -189,11 +197,11 @@ def _update_initial( vm_scale_set_name, # type: str instance_id, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -247,10 +255,10 @@ def begin_update( vm_scale_set_name, # type: str instance_id, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineExtension"] """The operation to update the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -275,7 +283,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -302,7 +310,15 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -418,7 +434,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -441,7 +465,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" + # type: (...) -> "_models.VirtualMachineExtension" """The operation to get the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -459,7 +483,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -512,7 +536,7 @@ def list( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtensionsListResult" + # type: (...) -> "_models.VirtualMachineExtensionsListResult" """The operation to get all extensions of an instance in Virtual Machine Scaleset. :param resource_group_name: The name of the resource group. @@ -528,7 +552,7 @@ def list( :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineExtensionsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vms_operations.py index b8858b108f2c..82cc452b21e2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetVMsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def _reimage_initial( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - vm_scale_set_vm_reimage_input=None, # type: Optional["models.VirtualMachineReimageParameters"] + vm_scale_set_vm_reimage_input=None, # type: Optional["_models.VirtualMachineReimageParameters"] **kwargs # type: Any ): # type: (...) -> None @@ -106,7 +106,7 @@ def begin_reimage( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - vm_scale_set_vm_reimage_input=None, # type: Optional["models.VirtualMachineReimageParameters"] + vm_scale_set_vm_reimage_input=None, # type: Optional["_models.VirtualMachineReimageParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -154,7 +154,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -263,7 +270,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -373,7 +387,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -392,11 +413,11 @@ def _update_initial( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.VirtualMachineScaleSetVM" + parameters, # type: "_models.VirtualMachineScaleSetVM" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVM" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + # type: (...) -> "_models.VirtualMachineScaleSetVM" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -452,10 +473,10 @@ def begin_update( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.VirtualMachineScaleSetVM" + parameters, # type: "_models.VirtualMachineScaleSetVM" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSetVM"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSetVM"] """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. @@ -478,7 +499,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -504,7 +525,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -612,7 +640,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -634,7 +669,7 @@ def get( expand="instanceView", # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVM" + # type: (...) -> "_models.VirtualMachineScaleSetVM" """Gets a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -650,7 +685,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetVM :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -701,7 +736,7 @@ def get_instance_view( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVMInstanceView" + # type: (...) -> "_models.VirtualMachineScaleSetVMInstanceView" """Gets the status of a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -715,7 +750,7 @@ def get_instance_view( :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetVMInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -766,7 +801,7 @@ def list( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetVMListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetVMListResult"] """Gets a list of all virtual machines in a VM scale sets. :param resource_group_name: The name of the resource group. @@ -787,7 +822,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetVMListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -955,7 +990,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1063,7 +1105,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1171,7 +1220,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1280,7 +1336,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1347,7 +1410,8 @@ def begin_perform_maintenance( **kwargs # type: Any ): # type: (...) -> LROPoller[None] - """Performs maintenance on a virtual machine in a VM scale set. + """Shuts down the virtual machine in a VMScaleSet, moves it to an already updated node, and powers + it back on during the self-service phase of planned maintenance. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1388,7 +1452,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1466,11 +1537,11 @@ def _run_command_initial( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> Optional["models.RunCommandResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + # type: (...) -> Optional["_models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1524,10 +1595,10 @@ def begin_run_command( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RunCommandResult"] + # type: (...) -> LROPoller["_models.RunCommandResult"] """Run command on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1549,7 +1620,7 @@ def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1575,7 +1646,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_sets_operations.py index d5bbc4985b3b..3927047665ca 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSet" + parameters, # type: "_models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + # type: (...) -> "_models.VirtualMachineScaleSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSet" + parameters, # type: "_models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSet"] """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -175,11 +181,11 @@ def _update_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSetUpdate" + parameters, # type: "_models.VirtualMachineScaleSetUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + # type: (...) -> "_models.VirtualMachineScaleSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -229,10 +235,10 @@ def begin_update( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSetUpdate" + parameters, # type: "_models.VirtualMachineScaleSetUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSet"] """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -379,7 +391,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -399,7 +417,7 @@ def get( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" + # type: (...) -> "_models.VirtualMachineScaleSet" """Display information about a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -411,7 +429,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -456,7 +474,7 @@ def _deallocate_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -508,7 +526,7 @@ def begin_deallocate( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -555,7 +573,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -573,7 +597,7 @@ def _delete_instances_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): # type: (...) -> None @@ -622,7 +646,7 @@ def begin_delete_instances( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -667,7 +691,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -687,7 +717,7 @@ def get_instance_view( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetInstanceView" + # type: (...) -> "_models.VirtualMachineScaleSetInstanceView" """Gets the status of a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -699,7 +729,7 @@ def get_instance_view( :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -745,7 +775,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListResult"] """Gets a list of all VM scale sets under a resource group. :param resource_group_name: The name of the resource group. @@ -755,7 +785,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -815,7 +845,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListWithLinkResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListWithLinkResult"] """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. @@ -825,7 +855,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetListWithLinkResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListWithLinkResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -886,7 +916,7 @@ def list_skus( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListSkusResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListSkusResult"] """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. @@ -899,7 +929,7 @@ def list_skus( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetListSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -962,7 +992,7 @@ def get_os_upgrade_history( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListOSUpgradeHistory"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListOSUpgradeHistory"] """Gets list of OS upgrades on a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -974,7 +1004,7 @@ def get_os_upgrade_history( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineScaleSetListOSUpgradeHistory] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListOSUpgradeHistory"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1036,7 +1066,7 @@ def _power_off_initial( resource_group_name, # type: str vm_scale_set_name, # type: str skip_shutdown=False, # type: Optional[bool] - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1091,7 +1121,7 @@ def begin_power_off( resource_group_name, # type: str vm_scale_set_name, # type: str skip_shutdown=False, # type: Optional[bool] - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1143,7 +1173,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1161,7 +1197,7 @@ def _restart_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1213,7 +1249,7 @@ def begin_restart( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1258,7 +1294,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1276,7 +1318,7 @@ def _start_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1328,7 +1370,7 @@ def begin_start( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1373,7 +1415,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1391,7 +1439,7 @@ def _redeploy_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1443,7 +1491,7 @@ def begin_redeploy( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1489,7 +1537,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1507,7 +1561,7 @@ def _perform_maintenance_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1559,7 +1613,7 @@ def begin_perform_maintenance( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1607,7 +1661,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1625,7 +1685,7 @@ def _update_instances_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): # type: (...) -> None @@ -1674,7 +1734,7 @@ def begin_update_instances( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1719,7 +1779,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1737,7 +1803,7 @@ def _reimage_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_scale_set_reimage_input=None, # type: Optional["models.VirtualMachineScaleSetReimageParameters"] + vm_scale_set_reimage_input=None, # type: Optional["_models.VirtualMachineScaleSetReimageParameters"] **kwargs # type: Any ): # type: (...) -> None @@ -1789,7 +1855,7 @@ def begin_reimage( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_scale_set_reimage_input=None, # type: Optional["models.VirtualMachineScaleSetReimageParameters"] + vm_scale_set_reimage_input=None, # type: Optional["_models.VirtualMachineScaleSetReimageParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1836,7 +1902,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1854,7 +1926,7 @@ def _reimage_all_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1906,7 +1978,7 @@ def begin_reimage_all( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1952,7 +2024,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1973,7 +2051,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( platform_update_domain, # type: int **kwargs # type: Any ): - # type: (...) -> "models.RecoveryWalkResponse" + # type: (...) -> "_models.RecoveryWalkResponse" """Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. @@ -1989,7 +2067,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( :rtype: ~azure.mgmt.compute.v2019_12_01.models.RecoveryWalkResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryWalkResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2035,11 +2113,11 @@ def convert_to_single_placement_group( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VMScaleSetConvertToSinglePlacementGroupInput" + parameters, # type: "_models.VMScaleSetConvertToSinglePlacementGroupInput" **kwargs # type: Any ): # type: (...) -> None - """Converts SinglePlacementGroup property to false for a existing virtual machine scale set. + """Converts SinglePlacementGroup property to true for a existing virtual machine scale set. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -2097,7 +2175,7 @@ def _set_orchestration_service_state_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.OrchestrationServiceStateInput" + parameters, # type: "_models.OrchestrationServiceStateInput" **kwargs # type: Any ): # type: (...) -> None @@ -2146,7 +2224,7 @@ def begin_set_orchestration_service_state( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.OrchestrationServiceStateInput" + parameters, # type: "_models.OrchestrationServiceStateInput" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -2191,7 +2269,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_sizes_operations.py index bf92a4c9b341..d212e013241f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_sizes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VirtualMachineSizesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """This API is deprecated. Use `Resources Skus `_. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machines_operations.py index a24398f33fbc..ab3911b9fc47 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machines_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachinesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list_by_location( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Gets all the virtual machines under the specified subscription for the specified location. :param location: The location for which virtual machines under the subscription are queried. @@ -62,7 +62,7 @@ def list_by_location( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,11 +122,11 @@ def _capture_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineCaptureParameters" + parameters, # type: "_models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualMachineCaptureResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + # type: (...) -> Optional["_models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualMachineCaptureResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -178,10 +178,10 @@ def begin_capture( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineCaptureParameters" + parameters, # type: "_models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineCaptureResult"] + # type: (...) -> LROPoller["_models.VirtualMachineCaptureResult"] """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -202,7 +202,7 @@ def begin_capture( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -227,7 +227,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -245,11 +251,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachine" + parameters, # type: "_models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + # type: (...) -> "_models.VirtualMachine" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,10 +309,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachine" + parameters, # type: "_models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachine"] + # type: (...) -> LROPoller["_models.VirtualMachine"] """The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. @@ -327,7 +333,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -352,7 +358,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -370,11 +382,11 @@ def _update_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineUpdate" + parameters, # type: "_models.VirtualMachineUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + # type: (...) -> "_models.VirtualMachine" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -428,10 +440,10 @@ def begin_update( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineUpdate" + parameters, # type: "_models.VirtualMachineUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachine"] + # type: (...) -> LROPoller["_models.VirtualMachine"] """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -451,7 +463,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -476,7 +488,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -578,7 +596,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -599,7 +623,7 @@ def get( expand="instanceView", # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" + # type: (...) -> "_models.VirtualMachine" """Retrieves information about the model view or the instance view of a virtual machine. :param resource_group_name: The name of the resource group. @@ -613,7 +637,7 @@ def get( :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachine :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -662,7 +686,7 @@ def instance_view( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineInstanceView" + # type: (...) -> "_models.VirtualMachineInstanceView" """Retrieves information about the run-time state of a virtual machine. :param resource_group_name: The name of the resource group. @@ -674,7 +698,7 @@ def instance_view( :rtype: ~azure.mgmt.compute.v2019_12_01.models.VirtualMachineInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -766,7 +790,12 @@ def begin_convert_to_managed_disks( ): # type: (...) -> LROPoller[None] """Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop- - deallocated before invoking this operation. + deallocated before invoking this operation. :code:`
`For Windows, please refer to `Convert a + virtual machine from unmanaged disks to managed disks. `_.:code:`
`For Linux, + please refer to `Convert a virtual machine from unmanaged disks to managed disks. + `_. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -804,7 +833,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -907,7 +942,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -985,7 +1026,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. @@ -996,7 +1037,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1057,7 +1098,7 @@ def list_all( status_only=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. @@ -1069,7 +1110,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1132,7 +1173,7 @@ def list_available_sizes( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes to which the specified virtual machine can be resized. @@ -1145,7 +1186,7 @@ def list_available_sizes( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2019_12_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1300,7 +1341,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1404,7 +1451,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1506,7 +1559,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1608,7 +1667,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1710,7 +1775,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1728,7 +1799,7 @@ def _reimage_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters=None, # type: Optional["models.VirtualMachineReimageParameters"] + parameters=None, # type: Optional["_models.VirtualMachineReimageParameters"] **kwargs # type: Any ): # type: (...) -> None @@ -1780,7 +1851,7 @@ def begin_reimage( self, resource_group_name, # type: str vm_name, # type: str - parameters=None, # type: Optional["models.VirtualMachineReimageParameters"] + parameters=None, # type: Optional["_models.VirtualMachineReimageParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1825,7 +1896,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1889,7 +1966,8 @@ def begin_perform_maintenance( **kwargs # type: Any ): # type: (...) -> LROPoller[None] - """The operation to perform maintenance on a virtual machine. + """Shuts down the virtual machine, moves it to an already updated node, and powers it back on + during the self-service phase of planned maintenance. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -1927,7 +2005,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -2000,11 +2084,11 @@ def _run_command_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> Optional["models.RunCommandResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + # type: (...) -> Optional["_models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2056,10 +2140,10 @@ def begin_run_command( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RunCommandResult"] + # type: (...) -> LROPoller["_models.RunCommandResult"] """Run command on the VM. :param resource_group_name: The name of the resource group. @@ -2079,7 +2163,7 @@ def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2104,7 +2188,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_compute_management_client.py index e4349e9e25cc..c77d74efa0e4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_compute_management_client.py @@ -59,7 +59,6 @@ def __init__( 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.disks = DisksOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_metadata.json index d76b82acbb70..baa5352567dc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/_compute_management_client.py index d0f08ca2041e..b2fb191fd399 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/_compute_management_client.py @@ -56,7 +56,6 @@ def __init__( 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.disks = DisksOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_accesses_operations.py index 8785efa72929..074ed05ce9f2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_accesses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DiskAccessesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, disk_access_name: str, - disk_access: "models.DiskAccess", + disk_access: "_models.DiskAccess", **kwargs - ) -> "models.DiskAccess": - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskAccess"] + ) -> "_models.DiskAccess": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, disk_access_name: str, - disk_access: "models.DiskAccess", + disk_access: "_models.DiskAccess", **kwargs - ) -> AsyncLROPoller["models.DiskAccess"]: + ) -> AsyncLROPoller["_models.DiskAccess"]: """Creates or updates a disk access resource. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskAccess"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_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: @@ -171,10 +177,10 @@ async def _update_initial( self, resource_group_name: str, disk_access_name: str, - disk_access: "models.DiskAccessUpdate", + disk_access: "_models.DiskAccessUpdate", **kwargs - ) -> "models.DiskAccess": - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskAccess"] + ) -> "_models.DiskAccess": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,9 +234,9 @@ async def begin_update( self, resource_group_name: str, disk_access_name: str, - disk_access: "models.DiskAccessUpdate", + disk_access: "_models.DiskAccessUpdate", **kwargs - ) -> AsyncLROPoller["models.DiskAccess"]: + ) -> AsyncLROPoller["_models.DiskAccess"]: """Updates (patches) a disk access resource. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskAccess"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_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: @@ -296,7 +308,7 @@ async def get( resource_group_name: str, disk_access_name: str, **kwargs - ) -> "models.DiskAccess": + ) -> "_models.DiskAccess": """Gets information about a disk access resource. :param resource_group_name: The name of the resource group. @@ -310,7 +322,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2020_05_01.models.DiskAccess :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskAccess"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -441,7 +453,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_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: @@ -459,7 +477,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DiskAccessList"]: + ) -> AsyncIterable["_models.DiskAccessList"]: """Lists all the disk access resources under a resource group. :param resource_group_name: The name of the resource group. @@ -469,7 +487,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_05_01.models.DiskAccessList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskAccessList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccessList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -528,7 +546,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.DiskAccessList"]: + ) -> AsyncIterable["_models.DiskAccessList"]: """Lists all the disk access resources under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -536,7 +554,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_05_01.models.DiskAccessList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskAccessList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccessList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -596,7 +614,7 @@ async def get_private_link_resources( resource_group_name: str, disk_access_name: str, **kwargs - ) -> "models.PrivateLinkResourceListResult": + ) -> "_models.PrivateLinkResourceListResult": """Gets the private link resources possible under disk access resource. :param resource_group_name: The name of the resource group. @@ -610,7 +628,7 @@ async def get_private_link_resources( :rtype: ~azure.mgmt.compute.v2020_05_01.models.PrivateLinkResourceListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResourceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_encryption_sets_operations.py index 9de6decb3cd9..31b31960b7f9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_encryption_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DiskEncryptionSetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, disk_encryption_set_name: str, - disk_encryption_set: "models.DiskEncryptionSet", + disk_encryption_set: "_models.DiskEncryptionSet", **kwargs - ) -> "models.DiskEncryptionSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + ) -> "_models.DiskEncryptionSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, disk_encryption_set_name: str, - disk_encryption_set: "models.DiskEncryptionSet", + disk_encryption_set: "_models.DiskEncryptionSet", **kwargs - ) -> AsyncLROPoller["models.DiskEncryptionSet"]: + ) -> AsyncLROPoller["_models.DiskEncryptionSet"]: """Creates or updates a disk encryption set. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -154,7 +154,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_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: @@ -172,10 +178,10 @@ async def _update_initial( self, resource_group_name: str, disk_encryption_set_name: str, - disk_encryption_set: "models.DiskEncryptionSetUpdate", + disk_encryption_set: "_models.DiskEncryptionSetUpdate", **kwargs - ) -> "models.DiskEncryptionSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + ) -> "_models.DiskEncryptionSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -229,9 +235,9 @@ async def begin_update( self, resource_group_name: str, disk_encryption_set_name: str, - disk_encryption_set: "models.DiskEncryptionSetUpdate", + disk_encryption_set: "_models.DiskEncryptionSetUpdate", **kwargs - ) -> AsyncLROPoller["models.DiskEncryptionSet"]: + ) -> AsyncLROPoller["_models.DiskEncryptionSet"]: """Updates (patches) a disk encryption set. :param resource_group_name: The name of the resource group. @@ -254,7 +260,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -279,7 +285,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_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: @@ -298,7 +310,7 @@ async def get( resource_group_name: str, disk_encryption_set_name: str, **kwargs - ) -> "models.DiskEncryptionSet": + ) -> "_models.DiskEncryptionSet": """Gets information about a disk encryption set. :param resource_group_name: The name of the resource group. @@ -312,7 +324,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2020_05_01.models.DiskEncryptionSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_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: @@ -461,7 +479,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DiskEncryptionSetList"]: + ) -> AsyncIterable["_models.DiskEncryptionSetList"]: """Lists all the disk encryption sets under a resource group. :param resource_group_name: The name of the resource group. @@ -471,7 +489,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_05_01.models.DiskEncryptionSetList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSetList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSetList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.DiskEncryptionSetList"]: + ) -> AsyncIterable["_models.DiskEncryptionSetList"]: """Lists all the disk encryption sets under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -538,7 +556,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_05_01.models.DiskEncryptionSetList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSetList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSetList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disks_operations.py index cfda150cca3a..b65ae1c30e95 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DisksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, disk_name: str, - disk: "models.Disk", + disk: "_models.Disk", **kwargs - ) -> "models.Disk": - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + ) -> "_models.Disk": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, disk_name: str, - disk: "models.Disk", + disk: "_models.Disk", **kwargs - ) -> AsyncLROPoller["models.Disk"]: + ) -> AsyncLROPoller["_models.Disk"]: """Creates or updates a disk. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -171,10 +177,10 @@ async def _update_initial( self, resource_group_name: str, disk_name: str, - disk: "models.DiskUpdate", + disk: "_models.DiskUpdate", **kwargs - ) -> "models.Disk": - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + ) -> "_models.Disk": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,9 +234,9 @@ async def begin_update( self, resource_group_name: str, disk_name: str, - disk: "models.DiskUpdate", + disk: "_models.DiskUpdate", **kwargs - ) -> AsyncLROPoller["models.Disk"]: + ) -> AsyncLROPoller["_models.Disk"]: """Updates (patches) a disk. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -296,7 +308,7 @@ async def get( resource_group_name: str, disk_name: str, **kwargs - ) -> "models.Disk": + ) -> "_models.Disk": """Gets information about a disk. :param resource_group_name: The name of the resource group. @@ -310,7 +322,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2020_05_01.models.Disk :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -457,7 +475,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DiskList"]: + ) -> AsyncIterable["_models.DiskList"]: """Lists all the disks under a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_05_01.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -526,7 +544,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.DiskList"]: + ) -> AsyncIterable["_models.DiskList"]: """Lists all the disks under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -534,7 +552,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_05_01.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -593,10 +611,10 @@ async def _grant_access_initial( self, resource_group_name: str, disk_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> Optional["models.AccessUri"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + ) -> Optional["_models.AccessUri"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -648,9 +666,9 @@ async def begin_grant_access( self, resource_group_name: str, disk_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> AsyncLROPoller["models.AccessUri"]: + ) -> AsyncLROPoller["_models.AccessUri"]: """Grants access to a disk. :param resource_group_name: The name of the resource group. @@ -673,7 +691,7 @@ async def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -698,7 +716,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -800,7 +824,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_snapshots_operations.py index cf511f8bc5e8..8a124d187b89 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_snapshots_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SnapshotsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.Snapshot", + snapshot: "_models.Snapshot", **kwargs - ) -> "models.Snapshot": - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + ) -> "_models.Snapshot": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.Snapshot", + snapshot: "_models.Snapshot", **kwargs - ) -> AsyncLROPoller["models.Snapshot"]: + ) -> AsyncLROPoller["_models.Snapshot"]: """Creates or updates a snapshot. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -171,10 +177,10 @@ async def _update_initial( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.SnapshotUpdate", + snapshot: "_models.SnapshotUpdate", **kwargs - ) -> "models.Snapshot": - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + ) -> "_models.Snapshot": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,9 +234,9 @@ async def begin_update( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.SnapshotUpdate", + snapshot: "_models.SnapshotUpdate", **kwargs - ) -> AsyncLROPoller["models.Snapshot"]: + ) -> AsyncLROPoller["_models.Snapshot"]: """Updates (patches) a snapshot. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -296,7 +308,7 @@ async def get( resource_group_name: str, snapshot_name: str, **kwargs - ) -> "models.Snapshot": + ) -> "_models.Snapshot": """Gets information about a snapshot. :param resource_group_name: The name of the resource group. @@ -310,7 +322,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2020_05_01.models.Snapshot :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -457,7 +475,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.SnapshotList"]: + ) -> AsyncIterable["_models.SnapshotList"]: """Lists snapshots under a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_05_01.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -526,7 +544,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.SnapshotList"]: + ) -> AsyncIterable["_models.SnapshotList"]: """Lists snapshots under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -534,7 +552,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_05_01.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -593,10 +611,10 @@ async def _grant_access_initial( self, resource_group_name: str, snapshot_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> Optional["models.AccessUri"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + ) -> Optional["_models.AccessUri"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -648,9 +666,9 @@ async def begin_grant_access( self, resource_group_name: str, snapshot_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> AsyncLROPoller["models.AccessUri"]: + ) -> AsyncLROPoller["_models.AccessUri"]: """Grants access to a snapshot. :param resource_group_name: The name of the resource group. @@ -673,7 +691,7 @@ async def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -698,7 +716,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -800,7 +824,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_accesses_operations.py index 43706935e19a..926ec023efdb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_accesses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DiskAccessesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str disk_access_name, # type: str - disk_access, # type: "models.DiskAccess" + disk_access, # type: "_models.DiskAccess" **kwargs # type: Any ): - # type: (...) -> "models.DiskAccess" - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskAccess"] + # type: (...) -> "_models.DiskAccess" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str disk_access_name, # type: str - disk_access, # type: "models.DiskAccess" + disk_access, # type: "_models.DiskAccess" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DiskAccess"] + # type: (...) -> LROPoller["_models.DiskAccess"] """Creates or updates a disk access resource. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskAccess"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_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: @@ -177,11 +183,11 @@ def _update_initial( self, resource_group_name, # type: str disk_access_name, # type: str - disk_access, # type: "models.DiskAccessUpdate" + disk_access, # type: "_models.DiskAccessUpdate" **kwargs # type: Any ): - # type: (...) -> "models.DiskAccess" - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskAccess"] + # type: (...) -> "_models.DiskAccess" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,10 +241,10 @@ def begin_update( self, resource_group_name, # type: str disk_access_name, # type: str - disk_access, # type: "models.DiskAccessUpdate" + disk_access, # type: "_models.DiskAccessUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DiskAccess"] + # type: (...) -> LROPoller["_models.DiskAccess"] """Updates (patches) a disk access resource. :param resource_group_name: The name of the resource group. @@ -260,7 +266,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskAccess"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -285,7 +291,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_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: @@ -305,7 +317,7 @@ def get( disk_access_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DiskAccess" + # type: (...) -> "_models.DiskAccess" """Gets information about a disk access resource. :param resource_group_name: The name of the resource group. @@ -319,7 +331,7 @@ def get( :rtype: ~azure.mgmt.compute.v2020_05_01.models.DiskAccess :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskAccess"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -452,7 +464,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_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: @@ -471,7 +489,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskAccessList"] + # type: (...) -> Iterable["_models.DiskAccessList"] """Lists all the disk access resources under a resource group. :param resource_group_name: The name of the resource group. @@ -481,7 +499,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_05_01.models.DiskAccessList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskAccessList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccessList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -541,7 +559,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskAccessList"] + # type: (...) -> Iterable["_models.DiskAccessList"] """Lists all the disk access resources under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -549,7 +567,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_05_01.models.DiskAccessList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskAccessList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccessList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -610,7 +628,7 @@ def get_private_link_resources( disk_access_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkResourceListResult" + # type: (...) -> "_models.PrivateLinkResourceListResult" """Gets the private link resources possible under disk access resource. :param resource_group_name: The name of the resource group. @@ -624,7 +642,7 @@ def get_private_link_resources( :rtype: ~azure.mgmt.compute.v2020_05_01.models.PrivateLinkResourceListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResourceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_encryption_sets_operations.py index f3a012417c0c..36cfe8b4deaf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_encryption_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DiskEncryptionSetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str disk_encryption_set_name, # type: str - disk_encryption_set, # type: "models.DiskEncryptionSet" + disk_encryption_set, # type: "_models.DiskEncryptionSet" **kwargs # type: Any ): - # type: (...) -> "models.DiskEncryptionSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + # type: (...) -> "_models.DiskEncryptionSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str disk_encryption_set_name, # type: str - disk_encryption_set, # type: "models.DiskEncryptionSet" + disk_encryption_set, # type: "_models.DiskEncryptionSet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DiskEncryptionSet"] + # type: (...) -> LROPoller["_models.DiskEncryptionSet"] """Creates or updates a disk encryption set. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -160,7 +160,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_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: @@ -178,11 +184,11 @@ def _update_initial( self, resource_group_name, # type: str disk_encryption_set_name, # type: str - disk_encryption_set, # type: "models.DiskEncryptionSetUpdate" + disk_encryption_set, # type: "_models.DiskEncryptionSetUpdate" **kwargs # type: Any ): - # type: (...) -> "models.DiskEncryptionSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + # type: (...) -> "_models.DiskEncryptionSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -236,10 +242,10 @@ def begin_update( self, resource_group_name, # type: str disk_encryption_set_name, # type: str - disk_encryption_set, # type: "models.DiskEncryptionSetUpdate" + disk_encryption_set, # type: "_models.DiskEncryptionSetUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DiskEncryptionSet"] + # type: (...) -> LROPoller["_models.DiskEncryptionSet"] """Updates (patches) a disk encryption set. :param resource_group_name: The name of the resource group. @@ -262,7 +268,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -287,7 +293,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_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: @@ -307,7 +319,7 @@ def get( disk_encryption_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DiskEncryptionSet" + # type: (...) -> "_models.DiskEncryptionSet" """Gets information about a disk encryption set. :param resource_group_name: The name of the resource group. @@ -321,7 +333,7 @@ def get( :rtype: ~azure.mgmt.compute.v2020_05_01.models.DiskEncryptionSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -454,7 +466,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_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: @@ -473,7 +491,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskEncryptionSetList"] + # type: (...) -> Iterable["_models.DiskEncryptionSetList"] """Lists all the disk encryption sets under a resource group. :param resource_group_name: The name of the resource group. @@ -483,7 +501,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_05_01.models.DiskEncryptionSetList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSetList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSetList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -543,7 +561,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskEncryptionSetList"] + # type: (...) -> Iterable["_models.DiskEncryptionSetList"] """Lists all the disk encryption sets under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -551,7 +569,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_05_01.models.DiskEncryptionSetList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSetList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSetList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disks_operations.py index 74facb9c7ba9..fceac1b70fcd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DisksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.Disk" + disk, # type: "_models.Disk" **kwargs # type: Any ): - # type: (...) -> "models.Disk" - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + # type: (...) -> "_models.Disk" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.Disk" + disk, # type: "_models.Disk" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Disk"] + # type: (...) -> LROPoller["_models.Disk"] """Creates or updates a disk. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -177,11 +183,11 @@ def _update_initial( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.DiskUpdate" + disk, # type: "_models.DiskUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Disk" - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + # type: (...) -> "_models.Disk" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,10 +241,10 @@ def begin_update( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.DiskUpdate" + disk, # type: "_models.DiskUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Disk"] + # type: (...) -> LROPoller["_models.Disk"] """Updates (patches) a disk. :param resource_group_name: The name of the resource group. @@ -260,7 +266,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -285,7 +291,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -305,7 +317,7 @@ def get( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Disk" + # type: (...) -> "_models.Disk" """Gets information about a disk. :param resource_group_name: The name of the resource group. @@ -319,7 +331,7 @@ def get( :rtype: ~azure.mgmt.compute.v2020_05_01.models.Disk :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -450,7 +462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -469,7 +487,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskList"] + # type: (...) -> Iterable["_models.DiskList"] """Lists all the disks under a resource group. :param resource_group_name: The name of the resource group. @@ -479,7 +497,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_05_01.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -539,7 +557,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskList"] + # type: (...) -> Iterable["_models.DiskList"] """Lists all the disks under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -547,7 +565,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_05_01.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -606,11 +624,11 @@ def _grant_access_initial( self, resource_group_name, # type: str disk_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> Optional["models.AccessUri"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + # type: (...) -> Optional["_models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -662,10 +680,10 @@ def begin_grant_access( self, resource_group_name, # type: str disk_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AccessUri"] + # type: (...) -> LROPoller["_models.AccessUri"] """Grants access to a disk. :param resource_group_name: The name of the resource group. @@ -688,7 +706,7 @@ def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -713,7 +731,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -817,7 +841,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_snapshots_operations.py index ab723b84a4cc..09c9dd1f500a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_snapshots_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SnapshotsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.Snapshot" + snapshot, # type: "_models.Snapshot" **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + # type: (...) -> "_models.Snapshot" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.Snapshot" + snapshot, # type: "_models.Snapshot" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Snapshot"] + # type: (...) -> LROPoller["_models.Snapshot"] """Creates or updates a snapshot. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -177,11 +183,11 @@ def _update_initial( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.SnapshotUpdate" + snapshot, # type: "_models.SnapshotUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + # type: (...) -> "_models.Snapshot" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,10 +241,10 @@ def begin_update( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.SnapshotUpdate" + snapshot, # type: "_models.SnapshotUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Snapshot"] + # type: (...) -> LROPoller["_models.Snapshot"] """Updates (patches) a snapshot. :param resource_group_name: The name of the resource group. @@ -260,7 +266,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -285,7 +291,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -305,7 +317,7 @@ def get( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" + # type: (...) -> "_models.Snapshot" """Gets information about a snapshot. :param resource_group_name: The name of the resource group. @@ -319,7 +331,7 @@ def get( :rtype: ~azure.mgmt.compute.v2020_05_01.models.Snapshot :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -450,7 +462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -469,7 +487,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SnapshotList"] + # type: (...) -> Iterable["_models.SnapshotList"] """Lists snapshots under a resource group. :param resource_group_name: The name of the resource group. @@ -479,7 +497,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_05_01.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -539,7 +557,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.SnapshotList"] + # type: (...) -> Iterable["_models.SnapshotList"] """Lists snapshots under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -547,7 +565,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_05_01.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -606,11 +624,11 @@ def _grant_access_initial( self, resource_group_name, # type: str snapshot_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> Optional["models.AccessUri"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + # type: (...) -> Optional["_models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -662,10 +680,10 @@ def begin_grant_access( self, resource_group_name, # type: str snapshot_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AccessUri"] + # type: (...) -> LROPoller["_models.AccessUri"] """Grants access to a snapshot. :param resource_group_name: The name of the resource group. @@ -688,7 +706,7 @@ def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -713,7 +731,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -817,7 +841,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_compute_management_client.py index 7d4c6c501c3b..71348d9ef1c0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_compute_management_client.py @@ -38,6 +38,7 @@ from .operations import VirtualMachineScaleSetVMsOperations from .operations import LogAnalyticsOperations from .operations import VirtualMachineRunCommandsOperations +from .operations import VirtualMachineScaleSetVMRunCommandsOperations from . import models @@ -84,6 +85,8 @@ class ComputeManagementClient(object): :vartype log_analytics: azure.mgmt.compute.v2020_06_01.operations.LogAnalyticsOperations :ivar virtual_machine_run_commands: VirtualMachineRunCommandsOperations operations :vartype virtual_machine_run_commands: azure.mgmt.compute.v2020_06_01.operations.VirtualMachineRunCommandsOperations + :ivar virtual_machine_scale_set_vm_run_commands: VirtualMachineScaleSetVMRunCommandsOperations operations + :vartype virtual_machine_scale_set_vm_run_commands: azure.mgmt.compute.v2020_06_01.operations.VirtualMachineScaleSetVMRunCommandsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. @@ -107,7 +110,6 @@ def __init__( 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( @@ -150,6 +152,8 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.virtual_machine_run_commands = VirtualMachineRunCommandsOperations( self._client, self._config, self._serialize, self._deserialize) + self.virtual_machine_scale_set_vm_run_commands = VirtualMachineScaleSetVMRunCommandsOperations( + self._client, self._config, self._serialize, self._deserialize) def close(self): # type: () -> None diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_metadata.json index 5317d08e1be7..2373304ad82d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true @@ -70,7 +71,8 @@ "virtual_machine_scale_set_vm_extensions": "VirtualMachineScaleSetVMExtensionsOperations", "virtual_machine_scale_set_vms": "VirtualMachineScaleSetVMsOperations", "log_analytics": "LogAnalyticsOperations", - "virtual_machine_run_commands": "VirtualMachineRunCommandsOperations" + "virtual_machine_run_commands": "VirtualMachineRunCommandsOperations", + "virtual_machine_scale_set_vm_run_commands": "VirtualMachineScaleSetVMRunCommandsOperations" }, "operation_mixins": { }, diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/_compute_management_client.py index 83afd173f469..07d80653cc48 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/_compute_management_client.py @@ -36,6 +36,7 @@ from .operations import VirtualMachineScaleSetVMsOperations from .operations import LogAnalyticsOperations from .operations import VirtualMachineRunCommandsOperations +from .operations import VirtualMachineScaleSetVMRunCommandsOperations from .. import models @@ -82,6 +83,8 @@ class ComputeManagementClient(object): :vartype log_analytics: azure.mgmt.compute.v2020_06_01.aio.operations.LogAnalyticsOperations :ivar virtual_machine_run_commands: VirtualMachineRunCommandsOperations operations :vartype virtual_machine_run_commands: azure.mgmt.compute.v2020_06_01.aio.operations.VirtualMachineRunCommandsOperations + :ivar virtual_machine_scale_set_vm_run_commands: VirtualMachineScaleSetVMRunCommandsOperations operations + :vartype virtual_machine_scale_set_vm_run_commands: azure.mgmt.compute.v2020_06_01.aio.operations.VirtualMachineScaleSetVMRunCommandsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. @@ -104,7 +107,6 @@ def __init__( 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( @@ -147,6 +149,8 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.virtual_machine_run_commands = VirtualMachineRunCommandsOperations( self._client, self._config, self._serialize, self._deserialize) + self.virtual_machine_scale_set_vm_run_commands = VirtualMachineScaleSetVMRunCommandsOperations( + self._client, self._config, self._serialize, self._deserialize) async def close(self) -> None: await self._client.close() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/__init__.py index 059428308b09..504bd3ccebae 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/__init__.py @@ -26,6 +26,7 @@ from ._virtual_machine_scale_set_vms_operations import VirtualMachineScaleSetVMsOperations from ._log_analytics_operations import LogAnalyticsOperations from ._virtual_machine_run_commands_operations import VirtualMachineRunCommandsOperations +from ._virtual_machine_scale_set_vm_run_commands_operations import VirtualMachineScaleSetVMRunCommandsOperations __all__ = [ 'Operations', @@ -48,4 +49,5 @@ 'VirtualMachineScaleSetVMsOperations', 'LogAnalyticsOperations', 'VirtualMachineRunCommandsOperations', + 'VirtualMachineScaleSetVMRunCommandsOperations', ] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_availability_sets_operations.py index fe5d5207ccb4..b8ac2fdcfe0b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_availability_sets_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class AvailabilitySetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, availability_set_name: str, - parameters: "models.AvailabilitySet", + parameters: "_models.AvailabilitySet", **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Create or update an availability set. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~azure.mgmt.compute.v2020_06_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,9 +111,9 @@ async def update( self, resource_group_name: str, availability_set_name: str, - parameters: "models.AvailabilitySetUpdate", + parameters: "_models.AvailabilitySetUpdate", **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Update an availability set. :param resource_group_name: The name of the resource group. @@ -127,7 +127,7 @@ async def update( :rtype: ~azure.mgmt.compute.v2020_06_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,7 +231,7 @@ async def get( resource_group_name: str, availability_set_name: str, **kwargs - ) -> "models.AvailabilitySet": + ) -> "_models.AvailabilitySet": """Retrieves information about an availability set. :param resource_group_name: The name of the resource group. @@ -243,7 +243,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2020_06_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -288,7 +288,7 @@ def list_by_subscription( self, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.AvailabilitySetListResult"]: + ) -> AsyncIterable["_models.AvailabilitySetListResult"]: """Lists all availability sets in a subscription. :param expand: The expand expression to apply to the operation. Allowed values are @@ -299,7 +299,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -360,7 +360,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.AvailabilitySetListResult"]: + ) -> AsyncIterable["_models.AvailabilitySetListResult"]: """Lists all availability sets in a resource group. :param resource_group_name: The name of the resource group. @@ -370,7 +370,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -431,7 +431,7 @@ def list_available_sizes( resource_group_name: str, availability_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. @@ -444,7 +444,7 @@ def list_available_sizes( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_host_groups_operations.py index c48dbb60b127..5ca6b81b5e56 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_host_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class DedicatedHostGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, host_group_name: str, - parameters: "models.DedicatedHostGroup", + parameters: "_models.DedicatedHostGroup", **kwargs - ) -> "models.DedicatedHostGroup": + ) -> "_models.DedicatedHostGroup": """Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). @@ -63,7 +63,7 @@ async def create_or_update( :rtype: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,9 +117,9 @@ async def update( self, resource_group_name: str, host_group_name: str, - parameters: "models.DedicatedHostGroupUpdate", + parameters: "_models.DedicatedHostGroupUpdate", **kwargs - ) -> "models.DedicatedHostGroup": + ) -> "_models.DedicatedHostGroup": """Update an dedicated host group. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ async def update( :rtype: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -238,7 +238,7 @@ async def get( host_group_name: str, expand: Optional[str] = "instanceView", **kwargs - ) -> "models.DedicatedHostGroup": + ) -> "_models.DedicatedHostGroup": """Retrieves information about a dedicated host group. :param resource_group_name: The name of the resource group. @@ -253,7 +253,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -300,7 +300,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DedicatedHostGroupListResult"]: + ) -> AsyncIterable["_models.DedicatedHostGroupListResult"]: """Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. @@ -311,7 +311,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -370,7 +370,7 @@ async def get_next(next_link=None): def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.DedicatedHostGroupListResult"]: + ) -> AsyncIterable["_models.DedicatedHostGroupListResult"]: """Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. @@ -379,7 +379,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_hosts_operations.py index bd1d309c92f0..b718a6aa1071 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DedicatedHostsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, host_group_name: str, host_name: str, - parameters: "models.DedicatedHost", + parameters: "_models.DedicatedHost", **kwargs - ) -> "models.DedicatedHost": - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + ) -> "_models.DedicatedHost": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def begin_create_or_update( resource_group_name: str, host_group_name: str, host_name: str, - parameters: "models.DedicatedHost", + parameters: "_models.DedicatedHost", **kwargs - ) -> AsyncLROPoller["models.DedicatedHost"]: + ) -> AsyncLROPoller["_models.DedicatedHost"]: """Create or update a dedicated host . :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -176,10 +183,10 @@ async def _update_initial( resource_group_name: str, host_group_name: str, host_name: str, - parameters: "models.DedicatedHostUpdate", + parameters: "_models.DedicatedHostUpdate", **kwargs - ) -> "models.DedicatedHost": - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + ) -> "_models.DedicatedHost": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -231,9 +238,9 @@ async def begin_update( resource_group_name: str, host_group_name: str, host_name: str, - parameters: "models.DedicatedHostUpdate", + parameters: "_models.DedicatedHostUpdate", **kwargs - ) -> AsyncLROPoller["models.DedicatedHost"]: + ) -> AsyncLROPoller["_models.DedicatedHost"]: """Update an dedicated host . :param resource_group_name: The name of the resource group. @@ -255,7 +262,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -281,7 +288,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -387,7 +401,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -408,7 +429,7 @@ async def get( host_name: str, expand: Optional[str] = "instanceView", **kwargs - ) -> "models.DedicatedHost": + ) -> "_models.DedicatedHost": """Retrieves information about a dedicated host. :param resource_group_name: The name of the resource group. @@ -424,7 +445,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -473,7 +494,7 @@ def list_by_host_group( resource_group_name: str, host_group_name: str, **kwargs - ) -> AsyncIterable["models.DedicatedHostListResult"]: + ) -> AsyncIterable["_models.DedicatedHostListResult"]: """Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. @@ -486,7 +507,7 @@ def list_by_host_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.DedicatedHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_images_operations.py index ec64eb20c490..a1d670e3d605 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class ImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, image_name: str, - parameters: "models.Image", + parameters: "_models.Image", **kwargs - ) -> "models.Image": - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + ) -> "_models.Image": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, image_name: str, - parameters: "models.Image", + parameters: "_models.Image", **kwargs - ) -> AsyncLROPoller["models.Image"]: + ) -> AsyncLROPoller["_models.Image"]: """Create or update an image. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -169,10 +175,10 @@ async def _update_initial( self, resource_group_name: str, image_name: str, - parameters: "models.ImageUpdate", + parameters: "_models.ImageUpdate", **kwargs - ) -> "models.Image": - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + ) -> "_models.Image": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -226,9 +232,9 @@ async def begin_update( self, resource_group_name: str, image_name: str, - parameters: "models.ImageUpdate", + parameters: "_models.ImageUpdate", **kwargs - ) -> AsyncLROPoller["models.Image"]: + ) -> AsyncLROPoller["_models.Image"]: """Update an image. :param resource_group_name: The name of the resource group. @@ -248,7 +254,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -273,7 +279,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -373,7 +385,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -393,7 +411,7 @@ async def get( image_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.Image": + ) -> "_models.Image": """Gets an image. :param resource_group_name: The name of the resource group. @@ -407,7 +425,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2020_06_01.models.Image :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -454,7 +472,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ImageListResult"]: + ) -> AsyncIterable["_models.ImageListResult"]: """Gets the list of images under a resource group. :param resource_group_name: The name of the resource group. @@ -464,7 +482,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -523,7 +541,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.ImageListResult"]: + ) -> AsyncIterable["_models.ImageListResult"]: """Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. @@ -532,7 +550,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_log_analytics_operations.py index dc01813d8e6d..e22c9c61bad1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_log_analytics_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class LogAnalyticsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,10 +45,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def _export_request_rate_by_interval_initial( self, location: str, - parameters: "models.RequestRateByIntervalInput", + parameters: "_models.RequestRateByIntervalInput", **kwargs - ) -> Optional["models.LogAnalyticsOperationResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + ) -> Optional["_models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -98,9 +98,9 @@ async def _export_request_rate_by_interval_initial( async def begin_export_request_rate_by_interval( self, location: str, - parameters: "models.RequestRateByIntervalInput", + parameters: "_models.RequestRateByIntervalInput", **kwargs - ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: + ) -> AsyncLROPoller["_models.LogAnalyticsOperationResult"]: """Export logs that show Api requests made by this subscription in the given time window to show throttling activities. @@ -119,7 +119,7 @@ async def begin_export_request_rate_by_interval( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -143,7 +143,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -160,10 +165,10 @@ def get_long_running_output(pipeline_response): async def _export_throttled_requests_initial( self, location: str, - parameters: "models.LogAnalyticsInputBase", + parameters: "_models.LogAnalyticsInputBase", **kwargs - ) -> Optional["models.LogAnalyticsOperationResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + ) -> Optional["_models.LogAnalyticsOperationResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -213,9 +218,9 @@ async def _export_throttled_requests_initial( async def begin_export_throttled_requests( self, location: str, - parameters: "models.LogAnalyticsInputBase", + parameters: "_models.LogAnalyticsInputBase", **kwargs - ) -> AsyncLROPoller["models.LogAnalyticsOperationResult"]: + ) -> AsyncLROPoller["_models.LogAnalyticsOperationResult"]: """Export logs that show total throttled Api requests for this subscription in the given time window. @@ -234,7 +239,7 @@ async def begin_export_throttled_requests( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -258,7 +263,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_operations.py index 06b729ce9567..6c00974f6e74 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class Operations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ComputeOperationListResult"]: + ) -> AsyncIterable["_models.ComputeOperationListResult"]: """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -52,7 +52,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.ComputeOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeOperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_proximity_placement_groups_operations.py index 99189268556d..e54bd7c6fdc6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_proximity_placement_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class ProximityPlacementGroupsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,9 +45,9 @@ async def create_or_update( self, resource_group_name: str, proximity_placement_group_name: str, - parameters: "models.ProximityPlacementGroup", + parameters: "_models.ProximityPlacementGroup", **kwargs - ) -> "models.ProximityPlacementGroup": + ) -> "_models.ProximityPlacementGroup": """Create or update a proximity placement group. :param resource_group_name: The name of the resource group. @@ -61,7 +61,7 @@ async def create_or_update( :rtype: ~azure.mgmt.compute.v2020_06_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -115,9 +115,9 @@ async def update( self, resource_group_name: str, proximity_placement_group_name: str, - parameters: "models.UpdateResource", + parameters: "_models.UpdateResource", **kwargs - ) -> "models.ProximityPlacementGroup": + ) -> "_models.ProximityPlacementGroup": """Update a proximity placement group. :param resource_group_name: The name of the resource group. @@ -131,7 +131,7 @@ async def update( :rtype: ~azure.mgmt.compute.v2020_06_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -236,7 +236,7 @@ async def get( proximity_placement_group_name: str, include_colocation_status: Optional[str] = None, **kwargs - ) -> "models.ProximityPlacementGroup": + ) -> "_models.ProximityPlacementGroup": """Retrieves information about a proximity placement group . :param resource_group_name: The name of the resource group. @@ -251,7 +251,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2020_06_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -297,7 +297,7 @@ async def get( def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.ProximityPlacementGroupListResult"]: + ) -> AsyncIterable["_models.ProximityPlacementGroupListResult"]: """Lists all proximity placement groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -305,7 +305,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.ProximityPlacementGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -364,7 +364,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.ProximityPlacementGroupListResult"]: + ) -> AsyncIterable["_models.ProximityPlacementGroupListResult"]: """Lists all proximity placement groups in a resource group. :param resource_group_name: The name of the resource group. @@ -374,7 +374,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.ProximityPlacementGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_ssh_public_keys_operations.py index 364ce8d32574..3b266e1cd36c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_ssh_public_keys_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class SshPublicKeysOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.SshPublicKeysGroupListResult"]: + ) -> AsyncIterable["_models.SshPublicKeysGroupListResult"]: """Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. @@ -53,7 +53,7 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.SshPublicKeysGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeysGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SshPublicKeysGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,7 +112,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.SshPublicKeysGroupListResult"]: + ) -> AsyncIterable["_models.SshPublicKeysGroupListResult"]: """Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. @@ -123,7 +123,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.SshPublicKeysGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeysGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SshPublicKeysGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -183,9 +183,9 @@ async def create( self, resource_group_name: str, ssh_public_key_name: str, - parameters: "models.SshPublicKeyResource", + parameters: "_models.SshPublicKeyResource", **kwargs - ) -> "models.SshPublicKeyResource": + ) -> "_models.SshPublicKeyResource": """Creates a new SSH public key resource. :param resource_group_name: The name of the resource group. @@ -199,7 +199,7 @@ async def create( :rtype: ~azure.mgmt.compute.v2020_06_01.models.SshPublicKeyResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SshPublicKeyResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -253,9 +253,9 @@ async def update( self, resource_group_name: str, ssh_public_key_name: str, - parameters: "models.SshPublicKeyUpdateResource", + parameters: "_models.SshPublicKeyUpdateResource", **kwargs - ) -> "models.SshPublicKeyResource": + ) -> "_models.SshPublicKeyResource": """Updates a new SSH public key resource. :param resource_group_name: The name of the resource group. @@ -269,7 +269,7 @@ async def update( :rtype: ~azure.mgmt.compute.v2020_06_01.models.SshPublicKeyResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SshPublicKeyResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -373,7 +373,7 @@ async def get( resource_group_name: str, ssh_public_key_name: str, **kwargs - ) -> "models.SshPublicKeyResource": + ) -> "_models.SshPublicKeyResource": """Retrieves information about an SSH public key. :param resource_group_name: The name of the resource group. @@ -385,7 +385,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2020_06_01.models.SshPublicKeyResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SshPublicKeyResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -431,7 +431,7 @@ async def generate_key_pair( resource_group_name: str, ssh_public_key_name: str, **kwargs - ) -> "models.SshPublicKeyGenerateKeyPairResult": + ) -> "_models.SshPublicKeyGenerateKeyPairResult": """Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. @@ -445,7 +445,7 @@ async def generate_key_pair( :rtype: ~azure.mgmt.compute.v2020_06_01.models.SshPublicKeyGenerateKeyPairResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyGenerateKeyPairResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SshPublicKeyGenerateKeyPairResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_usage_operations.py index f468d6482324..9b2d5453d613 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class UsageOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.ListUsagesResult"]: + ) -> AsyncIterable["_models.ListUsagesResult"]: """Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extension_images_operations.py index 93e06b6a292f..6122a6ba803e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VirtualMachineExtensionImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ async def get( type: str, version: str, **kwargs - ) -> "models.VirtualMachineExtensionImage": + ) -> "_models.VirtualMachineExtensionImage": """Gets a virtual machine extension image. :param location: The name of a supported Azure region. @@ -63,7 +63,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,7 +111,7 @@ async def list_types( location: str, publisher_name: str, **kwargs - ) -> List["models.VirtualMachineExtensionImage"]: + ) -> List["_models.VirtualMachineExtensionImage"]: """Gets a list of virtual machine extension image types. :param location: The name of a supported Azure region. @@ -123,7 +123,7 @@ async def list_types( :rtype: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -173,7 +173,7 @@ async def list_versions( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> List["models.VirtualMachineExtensionImage"]: + ) -> List["_models.VirtualMachineExtensionImage"]: """Gets a list of virtual machine extension image versions. :param location: The name of a supported Azure region. @@ -193,7 +193,7 @@ async def list_versions( :rtype: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extensions_operations.py index 8c92337d23c8..007164e0cc1c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VirtualMachineExtensionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineExtension", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -106,9 +106,9 @@ async def begin_create_or_update( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineExtension", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineExtension"]: """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -158,7 +158,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -177,10 +184,10 @@ async def _update_initial( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineExtensionUpdate", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -232,9 +239,9 @@ async def begin_update( resource_group_name: str, vm_name: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineExtensionUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineExtension"]: """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -257,7 +264,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -283,7 +290,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -389,7 +403,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -410,7 +431,7 @@ async def get( vm_extension_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtension": + ) -> "_models.VirtualMachineExtension": """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -426,7 +447,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -476,7 +497,7 @@ async def list( vm_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtensionsListResult": + ) -> "_models.VirtualMachineExtensionsListResult": """The operation to get all extensions of a Virtual Machine. :param resource_group_name: The name of the resource group. @@ -490,7 +511,7 @@ async def list( :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_images_operations.py index 3f040b69572b..016bbfb65145 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -32,7 +32,7 @@ class VirtualMachineImagesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def get( skus: str, version: str, **kwargs - ) -> "models.VirtualMachineImage": + ) -> "_models.VirtualMachineImage": """Gets a virtual machine image. :param location: The name of a supported Azure region. @@ -66,7 +66,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,7 +120,7 @@ async def list( top: Optional[int] = None, orderby: Optional[str] = None, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. @@ -143,7 +143,7 @@ async def list( :rtype: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -197,7 +197,7 @@ async def list_offers( location: str, publisher_name: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image offers for the specified location and publisher. :param location: The name of a supported Azure region. @@ -209,7 +209,7 @@ async def list_offers( :rtype: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -254,7 +254,7 @@ async def list_publishers( self, location: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image publishers for the specified Azure location. :param location: The name of a supported Azure region. @@ -264,7 +264,7 @@ async def list_publishers( :rtype: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -310,7 +310,7 @@ async def list_skus( publisher_name: str, offer: str, **kwargs - ) -> List["models.VirtualMachineImageResource"]: + ) -> List["_models.VirtualMachineImageResource"]: """Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. :param location: The name of a supported Azure region. @@ -324,7 +324,7 @@ async def list_skus( :rtype: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_run_commands_operations.py index 241fb7b4594f..3d03b51febbd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -5,16 +5,18 @@ # 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 +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 +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +35,7 @@ class VirtualMachineRunCommandsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +47,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.RunCommandListResult"]: + ) -> AsyncIterable["_models.RunCommandListResult"]: """Lists all available run commands for a subscription in a location. :param location: The location upon which run commands is queried. @@ -55,7 +57,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.RunCommandListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,7 +118,7 @@ async def get( location: str, command_id: str, **kwargs - ) -> "models.RunCommandDocument": + ) -> "_models.RunCommandDocument": """Gets specific run command for a subscription in a location. :param location: The location upon which run commands is queried. @@ -128,7 +130,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2020_06_01.models.RunCommandDocument :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandDocument"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -168,3 +170,531 @@ async def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + vm_name: str, + run_command_name: str, + run_command: "_models.VirtualMachineRunCommand", + **kwargs + ) -> "_models.VirtualMachineRunCommand": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + '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') + + # 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(run_command, 'VirtualMachineRunCommand') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualMachineRunCommand', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + vm_name: str, + run_command_name: str, + run_command: "_models.VirtualMachineRunCommand", + **kwargs + ) -> AsyncLROPoller["_models.VirtualMachineRunCommand"]: + """The operation to create or update the run command. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine where the run command should be created or + updated. + :type vm_name: str + :param run_command_name: The name of the virtual machine run command. + :type run_command_name: str + :param run_command: Parameters supplied to the Create Virtual Machine RunCommand operation. + :type run_command: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommand + :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: True for ARMPolling, False for no polling, or a + polling object for 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 VirtualMachineRunCommand or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + 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, + vm_name=vm_name, + run_command_name=run_command_name, + run_command=run_command, + 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('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + vm_name: str, + run_command_name: str, + run_command: "_models.VirtualMachineRunCommandUpdate", + **kwargs + ) -> "_models.VirtualMachineRunCommand": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + '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') + + # 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(run_command, 'VirtualMachineRunCommandUpdate') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + vm_name: str, + run_command_name: str, + run_command: "_models.VirtualMachineRunCommandUpdate", + **kwargs + ) -> AsyncLROPoller["_models.VirtualMachineRunCommand"]: + """The operation to update the run command. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine where the run command should be updated. + :type vm_name: str + :param run_command_name: The name of the virtual machine run command. + :type run_command_name: str + :param run_command: Parameters supplied to the Update Virtual Machine RunCommand operation. + :type run_command: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommandUpdate + :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: True for ARMPolling, False for no polling, or a + polling object for 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 VirtualMachineRunCommand or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + 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, + vm_name=vm_name, + run_command_name=run_command_name, + run_command=run_command, + 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('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + vm_name: str, + run_command_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-06-01" + accept = "application/json, text/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + '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') + + # 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + vm_name: str, + run_command_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """The operation to delete the run command. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine where the run command should be deleted. + :type vm_name: str + :param run_command_name: The name of the virtual machine run command. + :type run_command_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: True for ARMPolling, False for no polling, or a + polling object for 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, + vm_name=vm_name, + run_command_name=run_command_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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}'} # type: ignore + + async def get_by_virtual_machine( + self, + resource_group_name: str, + vm_name: str, + run_command_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "_models.VirtualMachineRunCommand": + """The operation to get the run command. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine containing the run command. + :type vm_name: str + :param run_command_name: The name of the virtual machine run command. + :type run_command_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: VirtualMachineRunCommand, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommand + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json, text/json" + + # Construct URL + url = self.get_by_virtual_machine.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_virtual_machine.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}'} # type: ignore + + def list_by_virtual_machine( + self, + resource_group_name: str, + vm_name: str, + expand: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.VirtualMachineRunCommandsListResult"]: + """The operation to get all run commands of a Virtual Machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine containing the run command. + :type vm_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 VirtualMachineRunCommandsListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommandsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommandsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json, text/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_virtual_machine.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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('VirtualMachineRunCommandsListResult', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_virtual_machine.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index f37cedac99f6..1bc479c24c4a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetExtensionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( resource_group_name: str, vm_scale_set_name: str, vmss_extension_name: str, - extension_parameters: "models.VirtualMachineScaleSetExtension", + extension_parameters: "_models.VirtualMachineScaleSetExtension", **kwargs - ) -> "models.VirtualMachineScaleSetExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + ) -> "_models.VirtualMachineScaleSetExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -107,9 +107,9 @@ async def begin_create_or_update( resource_group_name: str, vm_scale_set_name: str, vmss_extension_name: str, - extension_parameters: "models.VirtualMachineScaleSetExtension", + extension_parameters: "_models.VirtualMachineScaleSetExtension", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSetExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSetExtension"]: """The operation to create or update an extension. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -178,10 +185,10 @@ async def _update_initial( resource_group_name: str, vm_scale_set_name: str, vmss_extension_name: str, - extension_parameters: "models.VirtualMachineScaleSetExtensionUpdate", + extension_parameters: "_models.VirtualMachineScaleSetExtensionUpdate", **kwargs - ) -> "models.VirtualMachineScaleSetExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + ) -> "_models.VirtualMachineScaleSetExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -237,9 +244,9 @@ async def begin_update( resource_group_name: str, vm_scale_set_name: str, vmss_extension_name: str, - extension_parameters: "models.VirtualMachineScaleSetExtensionUpdate", + extension_parameters: "_models.VirtualMachineScaleSetExtensionUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSetExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSetExtension"]: """The operation to update an extension. :param resource_group_name: The name of the resource group. @@ -262,7 +269,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -288,7 +295,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -394,7 +408,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -415,7 +436,7 @@ async def get( vmss_extension_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineScaleSetExtension": + ) -> "_models.VirtualMachineScaleSetExtension": """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -431,7 +452,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -480,7 +501,7 @@ def list( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetExtensionListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetExtensionListResult"]: """Gets a list of all extensions in a VM scale set. :param resource_group_name: The name of the resource group. @@ -492,7 +513,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetExtensionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtensionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index d69cfe207219..4b563e793afd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VirtualMachineScaleSetRollingUpgradesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -128,7 +128,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -230,7 +236,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -332,7 +344,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -351,7 +369,7 @@ async def get_latest( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.RollingUpgradeStatusInfo": + ) -> "_models.RollingUpgradeStatusInfo": """Gets the status of the latest virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -363,7 +381,7 @@ async def get_latest( :rtype: ~azure.mgmt.compute.v2020_06_01.models.RollingUpgradeStatusInfo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RollingUpgradeStatusInfo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 5492e715e7ea..d2cc6c395a2e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -34,7 +34,7 @@ class VirtualMachineScaleSetVMExtensionsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,10 +48,10 @@ async def _create_or_update_initial( vm_scale_set_name: str, instance_id: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineScaleSetVMExtension", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineScaleSetVMExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -81,7 +81,7 @@ async def _create_or_update_initial( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension') + body_content = self._serialize.body(extension_parameters, 'VirtualMachineScaleSetVMExtension') 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) @@ -92,10 +92,10 @@ async def _create_or_update_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('VirtualMachineExtension', pipeline_response) + deserialized = self._deserialize('VirtualMachineScaleSetVMExtension', pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('VirtualMachineExtension', pipeline_response) + deserialized = self._deserialize('VirtualMachineScaleSetVMExtension', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -109,9 +109,9 @@ async def begin_create_or_update( vm_scale_set_name: str, instance_id: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtension", + extension_parameters: "_models.VirtualMachineScaleSetVMExtension", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSetVMExtension"]: """The operation to create or update the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -124,19 +124,19 @@ async def begin_create_or_update( :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension operation. - :type extension_parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension + :type extension_parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMExtension :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: True for ARMPolling, False for no polling, or a polling object for 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 VirtualMachineExtension or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension] + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSetVMExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,13 +157,21 @@ async def begin_create_or_update( kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('VirtualMachineExtension', pipeline_response) + deserialized = self._deserialize('VirtualMachineScaleSetVMExtension', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -183,10 +191,10 @@ async def _update_initial( vm_scale_set_name: str, instance_id: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineScaleSetVMExtensionUpdate", **kwargs - ) -> "models.VirtualMachineExtension": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + ) -> "_models.VirtualMachineScaleSetVMExtension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -216,7 +224,7 @@ async def _update_initial( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate') + body_content = self._serialize.body(extension_parameters, 'VirtualMachineScaleSetVMExtensionUpdate') 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) @@ -226,7 +234,7 @@ async def _update_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('VirtualMachineExtension', pipeline_response) + deserialized = self._deserialize('VirtualMachineScaleSetVMExtension', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -240,9 +248,9 @@ async def begin_update( vm_scale_set_name: str, instance_id: str, vm_extension_name: str, - extension_parameters: "models.VirtualMachineExtensionUpdate", + extension_parameters: "_models.VirtualMachineScaleSetVMExtensionUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineExtension"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSetVMExtension"]: """The operation to update the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -255,19 +263,19 @@ async def begin_update( :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension operation. - :type extension_parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionUpdate + :type extension_parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMExtensionUpdate :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: True for ARMPolling, False for no polling, or a polling object for 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 VirtualMachineExtension or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension] + :return: An instance of AsyncLROPoller that returns either VirtualMachineScaleSetVMExtension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -288,13 +296,21 @@ async def begin_update( kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('VirtualMachineExtension', pipeline_response) + deserialized = self._deserialize('VirtualMachineScaleSetVMExtension', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -408,7 +424,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -430,7 +454,7 @@ async def get( vm_extension_name: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtension": + ) -> "_models.VirtualMachineScaleSetVMExtension": """The operation to get the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -444,11 +468,11 @@ async def get( :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: VirtualMachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension + :return: VirtualMachineScaleSetVMExtension, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -485,7 +509,7 @@ async def get( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('VirtualMachineExtension', pipeline_response) + deserialized = self._deserialize('VirtualMachineScaleSetVMExtension', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -500,7 +524,7 @@ async def list( instance_id: str, expand: Optional[str] = None, **kwargs - ) -> "models.VirtualMachineExtensionsListResult": + ) -> "_models.VirtualMachineScaleSetVMExtensionsListResult": """The operation to get all extensions of an instance in Virtual Machine Scaleset. :param resource_group_name: The name of the resource group. @@ -512,11 +536,11 @@ async def list( :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: VirtualMachineExtensionsListResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionsListResult + :return: VirtualMachineScaleSetVMExtensionsListResult, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMExtensionsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMExtensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -552,7 +576,7 @@ async def list( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('VirtualMachineExtensionsListResult', pipeline_response) + deserialized = self._deserialize('VirtualMachineScaleSetVMExtensionsListResult', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py new file mode 100644 index 000000000000..a732c488ec42 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -0,0 +1,600 @@ +# 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 VirtualMachineScaleSetVMRunCommandsOperations: + """VirtualMachineScaleSetVMRunCommandsOperations 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.mgmt.compute.v2020_06_01.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, + vm_scale_set_name: str, + instance_id: str, + run_command_name: str, + run_command: "_models.VirtualMachineRunCommand", + **kwargs + ) -> "_models.VirtualMachineRunCommand": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + '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') + + # 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(run_command, 'VirtualMachineRunCommand') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualMachineRunCommand', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + run_command_name: str, + run_command: "_models.VirtualMachineRunCommand", + **kwargs + ) -> AsyncLROPoller["_models.VirtualMachineRunCommand"]: + """The operation to create or update the VMSS VM run command. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param run_command_name: The name of the virtual machine run command. + :type run_command_name: str + :param run_command: Parameters supplied to the Create Virtual Machine RunCommand operation. + :type run_command: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommand + :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: True for ARMPolling, False for no polling, or a + polling object for 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 VirtualMachineRunCommand or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + 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, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + run_command_name=run_command_name, + run_command=run_command, + 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('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + run_command_name: str, + run_command: "_models.VirtualMachineRunCommandUpdate", + **kwargs + ) -> "_models.VirtualMachineRunCommand": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + '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') + + # 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(run_command, 'VirtualMachineRunCommandUpdate') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + run_command_name: str, + run_command: "_models.VirtualMachineRunCommandUpdate", + **kwargs + ) -> AsyncLROPoller["_models.VirtualMachineRunCommand"]: + """The operation to update the VMSS VM run command. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param run_command_name: The name of the virtual machine run command. + :type run_command_name: str + :param run_command: Parameters supplied to the Update Virtual Machine RunCommand operation. + :type run_command: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommandUpdate + :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: True for ARMPolling, False for no polling, or a + polling object for 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 VirtualMachineRunCommand or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + 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, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + run_command_name=run_command_name, + run_command=run_command, + 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('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + run_command_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-06-01" + accept = "application/json, text/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + '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') + + # 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + run_command_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """The operation to delete the VMSS VM run command. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param run_command_name: The name of the virtual machine run command. + :type run_command_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: True for ARMPolling, False for no polling, or a + polling object for 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, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + run_command_name=run_command_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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + run_command_name: str, + expand: Optional[str] = None, + **kwargs + ) -> "_models.VirtualMachineRunCommand": + """The operation to get the VMSS VM run command. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param run_command_name: The name of the virtual machine run command. + :type run_command_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: VirtualMachineRunCommand, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommand + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json, text/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}'} # type: ignore + + def list( + self, + resource_group_name: str, + vm_scale_set_name: str, + instance_id: str, + expand: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.VirtualMachineRunCommandsListResult"]: + """The operation to get all run commands of an instance in Virtual Machine Scaleset. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: 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 VirtualMachineRunCommandsListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommandsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommandsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json, text/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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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('VirtualMachineRunCommandsListResult', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 1f507ea53e09..63b774b01290 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetVMsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -48,7 +48,7 @@ async def _reimage_initial( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - vm_scale_set_vm_reimage_input: Optional["models.VirtualMachineReimageParameters"] = None, + vm_scale_set_vm_reimage_input: Optional["_models.VirtualMachineReimageParameters"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -101,7 +101,7 @@ async def begin_reimage( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - vm_scale_set_vm_reimage_input: Optional["models.VirtualMachineReimageParameters"] = None, + vm_scale_set_vm_reimage_input: Optional["_models.VirtualMachineReimageParameters"] = None, **kwargs ) -> AsyncLROPoller[None]: """Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. @@ -148,7 +148,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -255,7 +262,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -363,7 +377,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -382,10 +403,10 @@ async def _update_initial( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.VirtualMachineScaleSetVM", + parameters: "_models.VirtualMachineScaleSetVM", **kwargs - ) -> "models.VirtualMachineScaleSetVM": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + ) -> "_models.VirtualMachineScaleSetVM": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -441,9 +462,9 @@ async def begin_update( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.VirtualMachineScaleSetVM", + parameters: "_models.VirtualMachineScaleSetVM", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSetVM"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSetVM"]: """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. @@ -466,7 +487,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -492,7 +513,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -598,7 +626,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -619,7 +654,7 @@ async def get( instance_id: str, expand: Optional[str] = "instanceView", **kwargs - ) -> "models.VirtualMachineScaleSetVM": + ) -> "_models.VirtualMachineScaleSetVM": """Gets a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -635,7 +670,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVM :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -685,7 +720,7 @@ async def get_instance_view( vm_scale_set_name: str, instance_id: str, **kwargs - ) -> "models.VirtualMachineScaleSetVMInstanceView": + ) -> "_models.VirtualMachineScaleSetVMInstanceView": """Gets the status of a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -699,7 +734,7 @@ async def get_instance_view( :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -749,7 +784,7 @@ def list( select: Optional[str] = None, expand: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetVMListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetVMListResult"]: """Gets a list of all virtual machines in a VM scale sets. :param resource_group_name: The name of the resource group. @@ -770,7 +805,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -936,7 +971,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1042,7 +1084,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1148,7 +1197,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1255,7 +1311,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1276,7 +1339,7 @@ async def retrieve_boot_diagnostics_data( instance_id: str, sas_uri_expiration_time_in_minutes: Optional[int] = None, **kwargs - ) -> "models.RetrieveBootDiagnosticsDataResult": + ) -> "_models.RetrieveBootDiagnosticsDataResult": """The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. @@ -1295,7 +1358,7 @@ async def retrieve_boot_diagnostics_data( :rtype: ~azure.mgmt.compute.v2020_06_01.models.RetrieveBootDiagnosticsDataResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RetrieveBootDiagnosticsDataResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RetrieveBootDiagnosticsDataResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1431,7 +1494,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1507,10 +1577,10 @@ async def _run_command_initial( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> Optional["models.RunCommandResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + ) -> Optional["_models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1564,9 +1634,9 @@ async def begin_run_command( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> AsyncLROPoller["models.RunCommandResult"]: + ) -> AsyncLROPoller["_models.RunCommandResult"]: """Run command on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1588,7 +1658,7 @@ async def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1614,7 +1684,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_sets_operations.py index 9dd0892a6f1a..c0e4b4c7c0db 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachineScaleSetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSet", + parameters: "_models.VirtualMachineScaleSet", **kwargs - ) -> "models.VirtualMachineScaleSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + ) -> "_models.VirtualMachineScaleSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSet", + parameters: "_models.VirtualMachineScaleSet", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSet"]: """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -126,7 +126,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -151,7 +151,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -169,10 +175,10 @@ async def _update_initial( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSetUpdate", + parameters: "_models.VirtualMachineScaleSetUpdate", **kwargs - ) -> "models.VirtualMachineScaleSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + ) -> "_models.VirtualMachineScaleSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -222,9 +228,9 @@ async def begin_update( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VirtualMachineScaleSetUpdate", + parameters: "_models.VirtualMachineScaleSetUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineScaleSet"]: + ) -> AsyncLROPoller["_models.VirtualMachineScaleSet"]: """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -244,7 +250,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -269,7 +275,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -369,7 +381,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -388,7 +406,7 @@ async def get( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.VirtualMachineScaleSet": + ) -> "_models.VirtualMachineScaleSet": """Display information about a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -400,7 +418,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -445,7 +463,7 @@ async def _deallocate_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -496,7 +514,7 @@ async def begin_deallocate( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and @@ -542,7 +560,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -560,7 +584,7 @@ async def _delete_instances_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -608,7 +632,7 @@ async def begin_delete_instances( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs ) -> AsyncLROPoller[None]: """Deletes virtual machines in a VM scale set. @@ -652,7 +676,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -671,7 +701,7 @@ async def get_instance_view( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> "models.VirtualMachineScaleSetInstanceView": + ) -> "_models.VirtualMachineScaleSetInstanceView": """Gets the status of a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -683,7 +713,7 @@ async def get_instance_view( :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -728,7 +758,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListResult"]: """Gets a list of all VM scale sets under a resource group. :param resource_group_name: The name of the resource group. @@ -738,7 +768,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -797,7 +827,7 @@ async def get_next(next_link=None): def list_all( self, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListWithLinkResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListWithLinkResult"]: """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. @@ -807,7 +837,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetListWithLinkResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListWithLinkResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -867,7 +897,7 @@ def list_skus( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListSkusResult"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListSkusResult"]: """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. @@ -880,7 +910,7 @@ def list_skus( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetListSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -942,7 +972,7 @@ def get_os_upgrade_history( resource_group_name: str, vm_scale_set_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineScaleSetListOSUpgradeHistory"]: + ) -> AsyncIterable["_models.VirtualMachineScaleSetListOSUpgradeHistory"]: """Gets list of OS upgrades on a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -954,7 +984,7 @@ def get_os_upgrade_history( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetListOSUpgradeHistory] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListOSUpgradeHistory"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1016,7 +1046,7 @@ async def _power_off_initial( resource_group_name: str, vm_scale_set_name: str, skip_shutdown: Optional[bool] = False, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1070,7 +1100,7 @@ async def begin_power_off( resource_group_name: str, vm_scale_set_name: str, skip_shutdown: Optional[bool] = False, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still @@ -1121,7 +1151,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1139,7 +1175,7 @@ async def _restart_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1190,7 +1226,7 @@ async def begin_restart( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Restarts one or more virtual machines in a VM scale set. @@ -1234,7 +1270,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1252,7 +1294,7 @@ async def _start_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1303,7 +1345,7 @@ async def begin_start( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Starts one or more virtual machines in a VM scale set. @@ -1347,7 +1389,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1365,7 +1413,7 @@ async def _redeploy_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1416,7 +1464,7 @@ async def begin_redeploy( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, @@ -1461,7 +1509,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1479,7 +1533,7 @@ async def _perform_maintenance_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1530,7 +1584,7 @@ async def begin_perform_maintenance( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances @@ -1577,7 +1631,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1595,7 +1655,7 @@ async def _update_instances_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1643,7 +1703,7 @@ async def begin_update_instances( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: "models.VirtualMachineScaleSetVMInstanceRequiredIDs", + vm_instance_i_ds: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs", **kwargs ) -> AsyncLROPoller[None]: """Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. @@ -1687,7 +1747,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1705,7 +1771,7 @@ async def _reimage_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_scale_set_reimage_input: Optional["models.VirtualMachineScaleSetReimageParameters"] = None, + vm_scale_set_reimage_input: Optional["_models.VirtualMachineScaleSetReimageParameters"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1756,7 +1822,7 @@ async def begin_reimage( self, resource_group_name: str, vm_scale_set_name: str, - vm_scale_set_reimage_input: Optional["models.VirtualMachineScaleSetReimageParameters"] = None, + vm_scale_set_reimage_input: Optional["_models.VirtualMachineScaleSetReimageParameters"] = None, **kwargs ) -> AsyncLROPoller[None]: """Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which @@ -1802,7 +1868,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1820,7 +1892,7 @@ async def _reimage_all_initial( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1871,7 +1943,7 @@ async def begin_reimage_all( self, resource_group_name: str, vm_scale_set_name: str, - vm_instance_i_ds: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] = None, + vm_instance_i_ds: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] = None, **kwargs ) -> AsyncLROPoller[None]: """Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This @@ -1916,7 +1988,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1936,7 +2014,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( vm_scale_set_name: str, platform_update_domain: int, **kwargs - ) -> "models.RecoveryWalkResponse": + ) -> "_models.RecoveryWalkResponse": """Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. @@ -1952,7 +2030,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( :rtype: ~azure.mgmt.compute.v2020_06_01.models.RecoveryWalkResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryWalkResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1998,7 +2076,7 @@ async def convert_to_single_placement_group( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.VMScaleSetConvertToSinglePlacementGroupInput", + parameters: "_models.VMScaleSetConvertToSinglePlacementGroupInput", **kwargs ) -> None: """Converts SinglePlacementGroup property to false for a existing virtual machine scale set. @@ -2059,7 +2137,7 @@ async def _set_orchestration_service_state_initial( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.OrchestrationServiceStateInput", + parameters: "_models.OrchestrationServiceStateInput", **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -2107,7 +2185,7 @@ async def begin_set_orchestration_service_state( self, resource_group_name: str, vm_scale_set_name: str, - parameters: "models.OrchestrationServiceStateInput", + parameters: "_models.OrchestrationServiceStateInput", **kwargs ) -> AsyncLROPoller[None]: """Changes ServiceState property for a given service. @@ -2151,7 +2229,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_sizes_operations.py index 97afe7a81142..ed385a923d45 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_sizes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class VirtualMachineSizesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -45,7 +45,7 @@ def list( self, location: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """This API is deprecated. Use `Resources Skus `_. @@ -56,7 +56,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machines_operations.py index 1ff6ac5c324e..e476dbf7a894 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machines_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class VirtualMachinesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,7 +47,7 @@ def list_by_location( self, location: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Gets all the virtual machines under the specified subscription for the specified location. :param location: The location for which virtual machines under the subscription are queried. @@ -57,7 +57,7 @@ def list_by_location( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,10 +117,10 @@ async def _capture_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineCaptureParameters", + parameters: "_models.VirtualMachineCaptureParameters", **kwargs - ) -> Optional["models.VirtualMachineCaptureResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + ) -> Optional["_models.VirtualMachineCaptureResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualMachineCaptureResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -172,9 +172,9 @@ async def begin_capture( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineCaptureParameters", + parameters: "_models.VirtualMachineCaptureParameters", **kwargs - ) -> AsyncLROPoller["models.VirtualMachineCaptureResult"]: + ) -> AsyncLROPoller["_models.VirtualMachineCaptureResult"]: """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -195,7 +195,7 @@ async def begin_capture( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -220,7 +220,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -238,10 +244,10 @@ async def _create_or_update_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachine", + parameters: "_models.VirtualMachine", **kwargs - ) -> "models.VirtualMachine": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + ) -> "_models.VirtualMachine": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -295,9 +301,9 @@ async def begin_create_or_update( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachine", + parameters: "_models.VirtualMachine", **kwargs - ) -> AsyncLROPoller["models.VirtualMachine"]: + ) -> AsyncLROPoller["_models.VirtualMachine"]: """The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. @@ -318,7 +324,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -343,7 +349,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -361,10 +373,10 @@ async def _update_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineUpdate", + parameters: "_models.VirtualMachineUpdate", **kwargs - ) -> "models.VirtualMachine": - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + ) -> "_models.VirtualMachine": + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -418,9 +430,9 @@ async def begin_update( self, resource_group_name: str, vm_name: str, - parameters: "models.VirtualMachineUpdate", + parameters: "_models.VirtualMachineUpdate", **kwargs - ) -> AsyncLROPoller["models.VirtualMachine"]: + ) -> AsyncLROPoller["_models.VirtualMachine"]: """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -440,7 +452,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -465,7 +477,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -483,6 +501,7 @@ async def _delete_initial( self, resource_group_name: str, vm_name: str, + force_deletion: Optional[bool] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -503,6 +522,8 @@ async def _delete_initial( # Construct parameters query_parameters = {} # type: Dict[str, Any] + if force_deletion is not None: + query_parameters['forceDeletion'] = self._serialize.query("force_deletion", force_deletion, 'bool') query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers @@ -525,6 +546,7 @@ async def begin_delete( self, resource_group_name: str, vm_name: str, + force_deletion: Optional[bool] = None, **kwargs ) -> AsyncLROPoller[None]: """The operation to delete a virtual machine. @@ -533,6 +555,8 @@ async def begin_delete( :type resource_group_name: str :param vm_name: The name of the virtual machine. :type vm_name: str + :param force_deletion: Optional parameter to force delete virtual machines. + :type force_deletion: 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: True for ARMPolling, False for no polling, or a @@ -554,6 +578,7 @@ async def begin_delete( raw_result = await self._delete_initial( resource_group_name=resource_group_name, vm_name=vm_name, + force_deletion=force_deletion, cls=lambda x,y,z: x, **kwargs ) @@ -565,7 +590,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -585,7 +616,7 @@ async def get( vm_name: str, expand: Optional[str] = "instanceView", **kwargs - ) -> "models.VirtualMachine": + ) -> "_models.VirtualMachine": """Retrieves information about the model view or the instance view of a virtual machine. :param resource_group_name: The name of the resource group. @@ -599,7 +630,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachine :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -647,7 +678,7 @@ async def instance_view( resource_group_name: str, vm_name: str, **kwargs - ) -> "models.VirtualMachineInstanceView": + ) -> "_models.VirtualMachineInstanceView": """Retrieves information about the run-time state of a virtual machine. :param resource_group_name: The name of the resource group. @@ -659,7 +690,7 @@ async def instance_view( :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -787,7 +818,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -888,7 +925,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -964,7 +1007,7 @@ def list( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. @@ -975,7 +1018,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1035,7 +1078,7 @@ def list_all( self, status_only: Optional[str] = None, **kwargs - ) -> AsyncIterable["models.VirtualMachineListResult"]: + ) -> AsyncIterable["_models.VirtualMachineListResult"]: """Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. @@ -1047,7 +1090,7 @@ def list_all( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1109,7 +1152,7 @@ def list_available_sizes( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncIterable["models.VirtualMachineSizeListResult"]: + ) -> AsyncIterable["_models.VirtualMachineSizeListResult"]: """Lists all available virtual machine sizes to which the specified virtual machine can be resized. @@ -1122,7 +1165,7 @@ def list_available_sizes( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1275,7 +1318,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1377,7 +1426,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1477,7 +1532,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1577,7 +1638,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1677,7 +1744,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1695,7 +1768,7 @@ async def _reimage_initial( self, resource_group_name: str, vm_name: str, - parameters: Optional["models.VirtualMachineReimageParameters"] = None, + parameters: Optional["_models.VirtualMachineReimageParameters"] = None, **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] @@ -1746,7 +1819,7 @@ async def begin_reimage( self, resource_group_name: str, vm_name: str, - parameters: Optional["models.VirtualMachineReimageParameters"] = None, + parameters: Optional["_models.VirtualMachineReimageParameters"] = None, **kwargs ) -> AsyncLROPoller[None]: """Reimages the virtual machine which has an ephemeral OS disk back to its initial state. @@ -1790,7 +1863,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1810,7 +1889,7 @@ async def retrieve_boot_diagnostics_data( vm_name: str, sas_uri_expiration_time_in_minutes: Optional[int] = None, **kwargs - ) -> "models.RetrieveBootDiagnosticsDataResult": + ) -> "_models.RetrieveBootDiagnosticsDataResult": """The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. :param resource_group_name: The name of the resource group. @@ -1826,7 +1905,7 @@ async def retrieve_boot_diagnostics_data( :rtype: ~azure.mgmt.compute.v2020_06_01.models.RetrieveBootDiagnosticsDataResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RetrieveBootDiagnosticsDataResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RetrieveBootDiagnosticsDataResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1955,7 +2034,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -2027,8 +2112,8 @@ async def _assess_patches_initial( resource_group_name: str, vm_name: str, **kwargs - ) -> Optional["models.VirtualMachineAssessPatchesResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineAssessPatchesResult"]] + ) -> Optional["_models.VirtualMachineAssessPatchesResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualMachineAssessPatchesResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2076,7 +2161,7 @@ async def begin_assess_patches( resource_group_name: str, vm_name: str, **kwargs - ) -> AsyncLROPoller["models.VirtualMachineAssessPatchesResult"]: + ) -> AsyncLROPoller["_models.VirtualMachineAssessPatchesResult"]: """Assess patches on the VM. :param resource_group_name: The name of the resource group. @@ -2094,7 +2179,7 @@ async def begin_assess_patches( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineAssessPatchesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineAssessPatchesResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2118,7 +2203,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -2136,10 +2227,10 @@ async def _run_command_initial( self, resource_group_name: str, vm_name: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> Optional["models.RunCommandResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + ) -> Optional["_models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2191,9 +2282,9 @@ async def begin_run_command( self, resource_group_name: str, vm_name: str, - parameters: "models.RunCommandInput", + parameters: "_models.RunCommandInput", **kwargs - ) -> AsyncLROPoller["models.RunCommandResult"]: + ) -> AsyncLROPoller["_models.RunCommandResult"]: """Run command on the VM. :param resource_group_name: The name of the resource group. @@ -2213,7 +2304,7 @@ async def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2238,7 +2329,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/__init__.py index e9fd5c30685f..d841724b49cd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/__init__.py @@ -22,8 +22,6 @@ from ._models_py3 import BillingProfile from ._models_py3 import BootDiagnostics from ._models_py3 import BootDiagnosticsInstanceView - from ._models_py3 import Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties - from ._models_py3 import ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties from ._models_py3 import ComputeOperationListResult from ._models_py3 import ComputeOperationValue from ._models_py3 import DataDisk @@ -118,6 +116,7 @@ from ._models_py3 import UpgradePolicy from ._models_py3 import Usage from ._models_py3 import UsageName + from ._models_py3 import UserAssignedIdentitiesValue from ._models_py3 import VMScaleSetConvertToSinglePlacementGroupInput from ._models_py3 import VaultCertificate from ._models_py3 import VaultSecretGroup @@ -141,6 +140,11 @@ from ._models_py3 import VirtualMachineListResult from ._models_py3 import VirtualMachinePatchStatus from ._models_py3 import VirtualMachineReimageParameters + from ._models_py3 import VirtualMachineRunCommand + from ._models_py3 import VirtualMachineRunCommandInstanceView + from ._models_py3 import VirtualMachineRunCommandScriptSource + from ._models_py3 import VirtualMachineRunCommandUpdate + from ._models_py3 import VirtualMachineRunCommandsListResult from ._models_py3 import VirtualMachineScaleSet from ._models_py3 import VirtualMachineScaleSetDataDisk from ._models_py3 import VirtualMachineScaleSetExtension @@ -149,6 +153,7 @@ from ._models_py3 import VirtualMachineScaleSetExtensionUpdate from ._models_py3 import VirtualMachineScaleSetIPConfiguration from ._models_py3 import VirtualMachineScaleSetIdentity + from ._models_py3 import VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue from ._models_py3 import VirtualMachineScaleSetInstanceView from ._models_py3 import VirtualMachineScaleSetInstanceViewStatusesSummary from ._models_py3 import VirtualMachineScaleSetIpTag @@ -178,6 +183,9 @@ from ._models_py3 import VirtualMachineScaleSetUpdateStorageProfile from ._models_py3 import VirtualMachineScaleSetUpdateVMProfile from ._models_py3 import VirtualMachineScaleSetVM + from ._models_py3 import VirtualMachineScaleSetVMExtension + from ._models_py3 import VirtualMachineScaleSetVMExtensionUpdate + from ._models_py3 import VirtualMachineScaleSetVMExtensionsListResult from ._models_py3 import VirtualMachineScaleSetVMExtensionsSummary from ._models_py3 import VirtualMachineScaleSetVMInstanceIDs from ._models_py3 import VirtualMachineScaleSetVMInstanceRequiredIDs @@ -211,8 +219,6 @@ from ._models import BillingProfile # type: ignore from ._models import BootDiagnostics # type: ignore from ._models import BootDiagnosticsInstanceView # type: ignore - from ._models import Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore - from ._models import ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore from ._models import ComputeOperationListResult # type: ignore from ._models import ComputeOperationValue # type: ignore from ._models import DataDisk # type: ignore @@ -307,6 +313,7 @@ from ._models import UpgradePolicy # type: ignore from ._models import Usage # type: ignore from ._models import UsageName # type: ignore + from ._models import UserAssignedIdentitiesValue # type: ignore from ._models import VMScaleSetConvertToSinglePlacementGroupInput # type: ignore from ._models import VaultCertificate # type: ignore from ._models import VaultSecretGroup # type: ignore @@ -330,6 +337,11 @@ from ._models import VirtualMachineListResult # type: ignore from ._models import VirtualMachinePatchStatus # type: ignore from ._models import VirtualMachineReimageParameters # type: ignore + from ._models import VirtualMachineRunCommand # type: ignore + from ._models import VirtualMachineRunCommandInstanceView # type: ignore + from ._models import VirtualMachineRunCommandScriptSource # type: ignore + from ._models import VirtualMachineRunCommandUpdate # type: ignore + from ._models import VirtualMachineRunCommandsListResult # type: ignore from ._models import VirtualMachineScaleSet # type: ignore from ._models import VirtualMachineScaleSetDataDisk # type: ignore from ._models import VirtualMachineScaleSetExtension # type: ignore @@ -338,6 +350,7 @@ from ._models import VirtualMachineScaleSetExtensionUpdate # type: ignore from ._models import VirtualMachineScaleSetIPConfiguration # type: ignore from ._models import VirtualMachineScaleSetIdentity # type: ignore + from ._models import VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue # type: ignore from ._models import VirtualMachineScaleSetInstanceView # type: ignore from ._models import VirtualMachineScaleSetInstanceViewStatusesSummary # type: ignore from ._models import VirtualMachineScaleSetIpTag # type: ignore @@ -367,6 +380,9 @@ from ._models import VirtualMachineScaleSetUpdateStorageProfile # type: ignore from ._models import VirtualMachineScaleSetUpdateVMProfile # type: ignore from ._models import VirtualMachineScaleSetVM # type: ignore + from ._models import VirtualMachineScaleSetVMExtension # type: ignore + from ._models import VirtualMachineScaleSetVMExtensionUpdate # type: ignore + from ._models import VirtualMachineScaleSetVMExtensionsListResult # type: ignore from ._models import VirtualMachineScaleSetVMExtensionsSummary # type: ignore from ._models import VirtualMachineScaleSetVMInstanceIDs # type: ignore from ._models import VirtualMachineScaleSetVMInstanceRequiredIDs # type: ignore @@ -392,6 +408,7 @@ DiffDiskOptions, DiffDiskPlacement, DiskCreateOptionTypes, + ExecutionState, HyperVGenerationType, HyperVGenerationTypes, IPVersion, @@ -442,8 +459,6 @@ 'BillingProfile', 'BootDiagnostics', 'BootDiagnosticsInstanceView', - 'Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties', - 'ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties', 'ComputeOperationListResult', 'ComputeOperationValue', 'DataDisk', @@ -538,6 +553,7 @@ 'UpgradePolicy', 'Usage', 'UsageName', + 'UserAssignedIdentitiesValue', 'VMScaleSetConvertToSinglePlacementGroupInput', 'VaultCertificate', 'VaultSecretGroup', @@ -561,6 +577,11 @@ 'VirtualMachineListResult', 'VirtualMachinePatchStatus', 'VirtualMachineReimageParameters', + 'VirtualMachineRunCommand', + 'VirtualMachineRunCommandInstanceView', + 'VirtualMachineRunCommandScriptSource', + 'VirtualMachineRunCommandUpdate', + 'VirtualMachineRunCommandsListResult', 'VirtualMachineScaleSet', 'VirtualMachineScaleSetDataDisk', 'VirtualMachineScaleSetExtension', @@ -569,6 +590,7 @@ 'VirtualMachineScaleSetExtensionUpdate', 'VirtualMachineScaleSetIPConfiguration', 'VirtualMachineScaleSetIdentity', + 'VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue', 'VirtualMachineScaleSetInstanceView', 'VirtualMachineScaleSetInstanceViewStatusesSummary', 'VirtualMachineScaleSetIpTag', @@ -598,6 +620,9 @@ 'VirtualMachineScaleSetUpdateStorageProfile', 'VirtualMachineScaleSetUpdateVMProfile', 'VirtualMachineScaleSetVM', + 'VirtualMachineScaleSetVMExtension', + 'VirtualMachineScaleSetVMExtensionUpdate', + 'VirtualMachineScaleSetVMExtensionsListResult', 'VirtualMachineScaleSetVMExtensionsSummary', 'VirtualMachineScaleSetVMInstanceIDs', 'VirtualMachineScaleSetVMInstanceRequiredIDs', @@ -621,6 +646,7 @@ 'DiffDiskOptions', 'DiffDiskPlacement', 'DiskCreateOptionTypes', + 'ExecutionState', 'HyperVGenerationType', 'HyperVGenerationTypes', 'IPVersion', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_compute_management_client_enums.py index 7c70d90e97ad..38ea852a0385 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_compute_management_client_enums.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_compute_management_client_enums.py @@ -88,6 +88,18 @@ class DiskCreateOptionTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)) EMPTY = "Empty" ATTACH = "Attach" +class ExecutionState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Script execution status. + """ + + UNKNOWN = "Unknown" + PENDING = "Pending" + RUNNING = "Running" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + TIMED_OUT = "TimedOut" + CANCELED = "Canceled" + class HyperVGenerationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the HyperVGeneration Type associated with a resource """ diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_models.py index 461000731f12..b6ebc100c2da 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_models.py @@ -620,66 +620,6 @@ def __init__( self.status = None -class Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - class ComputeOperationListResult(msrest.serialization.Model): """The List Compute Operation operation response. @@ -927,7 +867,7 @@ class DedicatedHost(Resource): 'type': {'readonly': True}, 'location': {'required': True}, 'sku': {'required': True}, - 'platform_fault_domain': {'maximum': 2, 'minimum': 0}, + 'platform_fault_domain': {'minimum': 0}, 'host_id': {'readonly': True}, 'virtual_machines': {'readonly': True}, 'provisioning_time': {'readonly': True}, @@ -1043,8 +983,8 @@ class DedicatedHostGroup(Resource): :param support_automatic_placement: Specifies whether virtual machines or virtual machine scale sets can be placed automatically on the dedicated host group. Automatic placement means resources are allocated on dedicated hosts, that are chosen by Azure, under the dedicated host - group. The value is defaulted to 'true' when not provided. :code:`
`:code:`
`Minimum api- - version: 2020-06-01. + group. The value is defaulted to 'false' when not provided. :code:`
`:code:`
`Minimum + api-version: 2020-06-01. :type support_automatic_placement: bool """ @@ -1053,7 +993,7 @@ class DedicatedHostGroup(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, - 'platform_fault_domain_count': {'maximum': 3, 'minimum': 1}, + 'platform_fault_domain_count': {'minimum': 1}, 'hosts': {'readonly': True}, 'instance_view': {'readonly': True}, } @@ -1153,13 +1093,13 @@ class DedicatedHostGroupUpdate(UpdateResource): :param support_automatic_placement: Specifies whether virtual machines or virtual machine scale sets can be placed automatically on the dedicated host group. Automatic placement means resources are allocated on dedicated hosts, that are chosen by Azure, under the dedicated host - group. The value is defaulted to 'true' when not provided. :code:`
`:code:`
`Minimum api- - version: 2020-06-01. + group. The value is defaulted to 'false' when not provided. :code:`
`:code:`
`Minimum + api-version: 2020-06-01. :type support_automatic_placement: bool """ _validation = { - 'platform_fault_domain_count': {'maximum': 3, 'minimum': 1}, + 'platform_fault_domain_count': {'minimum': 1}, 'hosts': {'readonly': True}, 'instance_view': {'readonly': True}, } @@ -1317,7 +1257,7 @@ class DedicatedHostUpdate(UpdateResource): """ _validation = { - 'platform_fault_domain': {'maximum': 2, 'minimum': 0}, + 'platform_fault_domain': {'minimum': 0}, 'host_id': {'readonly': True}, 'virtual_machines': {'readonly': True}, 'provisioning_time': {'readonly': True}, @@ -4225,6 +4165,36 @@ def __init__( self.localized_value = kwargs.get('localized_value', None) +class UserAssignedIdentitiesValue(msrest.serialization.Model): + """UserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class VaultCertificate(msrest.serialization.Model): """Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM. @@ -4404,14 +4374,15 @@ class VirtualMachine(Resource): :ivar instance_view: The virtual machine instance view. :vartype instance_view: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineInstanceView :param license_type: Specifies that the image or disk that is being used was licensed on- - premises. This element is only used for images that contain the Windows Server operating - system. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` Windows_Client - :code:`
`:code:`
` Windows_Server :code:`
`:code:`
` If this element is included in - a request for an update, the value must match the initial value. This value cannot be updated. + premises. :code:`
`:code:`
` Possible values for Windows Server operating system are: + :code:`
`:code:`
` Windows_Client :code:`
`:code:`
` Windows_Server + :code:`
`:code:`
` Possible values for Linux Server operating system are: + :code:`
`:code:`
` RHEL_BYOS (for RHEL) :code:`
`:code:`
` SLES_BYOS (for SUSE) :code:`
`:code:`
` For more information, see `Azure Hybrid Use Benefit for Windows Server - `_ :code:`
`:code:`
` - Minimum api-version: 2015-06-15. + `_ + :code:`
`:code:`
` `Azure Hybrid Use Benefit for Linux Server + `_ + :code:`
`:code:`
` Minimum api-version: 2015-06-15. :type license_type: str :ivar vm_id: Specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands. @@ -5006,7 +4977,7 @@ class VirtualMachineIdentity(msrest.serialization.Model): Machine. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :type user_assigned_identities: dict[str, - ~azure.mgmt.compute.v2020_06_01.models.Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties] + ~azure.mgmt.compute.v2020_06_01.models.UserAssignedIdentitiesValue] """ _validation = { @@ -5018,7 +4989,7 @@ class VirtualMachineIdentity(msrest.serialization.Model): 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentitiesValue}'}, } def __init__( @@ -5306,6 +5277,278 @@ def __init__( self.temp_disk = kwargs.get('temp_disk', None) +class VirtualMachineRunCommand(Resource): + """Describes a Virtual Machine run command. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param source: The source of the run command script. + :type source: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommandScriptSource + :param parameters: The parameters used by the script. + :type parameters: list[~azure.mgmt.compute.v2020_06_01.models.RunCommandInputParameter] + :param protected_parameters: The parameters used by the script. + :type protected_parameters: + list[~azure.mgmt.compute.v2020_06_01.models.RunCommandInputParameter] + :param async_execution: Optional. If set to true, provisioning will complete as soon as the + script starts and will not wait for script to complete. + :type async_execution: bool + :param run_as_user: Specifies the user account on the VM when executing the run command. + :type run_as_user: str + :param run_as_password: Specifies the user account password on the VM when executing the run + command. + :type run_as_password: str + :param timeout_in_seconds: The timeout in seconds to execute the run command. + :type timeout_in_seconds: int + :param output_blob_uri: Specifies the Azure storage blob where script output stream will be + uploaded. + :type output_blob_uri: str + :param error_blob_uri: Specifies the Azure storage blob where script error stream will be + uploaded. + :type error_blob_uri: str + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar instance_view: The virtual machine run command instance view. + :vartype instance_view: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommandInstanceView + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'instance_view': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source': {'key': 'properties.source', 'type': 'VirtualMachineRunCommandScriptSource'}, + 'parameters': {'key': 'properties.parameters', 'type': '[RunCommandInputParameter]'}, + 'protected_parameters': {'key': 'properties.protectedParameters', 'type': '[RunCommandInputParameter]'}, + 'async_execution': {'key': 'properties.asyncExecution', 'type': 'bool'}, + 'run_as_user': {'key': 'properties.runAsUser', 'type': 'str'}, + 'run_as_password': {'key': 'properties.runAsPassword', 'type': 'str'}, + 'timeout_in_seconds': {'key': 'properties.timeoutInSeconds', 'type': 'int'}, + 'output_blob_uri': {'key': 'properties.outputBlobUri', 'type': 'str'}, + 'error_blob_uri': {'key': 'properties.errorBlobUri', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineRunCommandInstanceView'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineRunCommand, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.parameters = kwargs.get('parameters', None) + self.protected_parameters = kwargs.get('protected_parameters', None) + self.async_execution = kwargs.get('async_execution', False) + self.run_as_user = kwargs.get('run_as_user', None) + self.run_as_password = kwargs.get('run_as_password', None) + self.timeout_in_seconds = kwargs.get('timeout_in_seconds', None) + self.output_blob_uri = kwargs.get('output_blob_uri', None) + self.error_blob_uri = kwargs.get('error_blob_uri', None) + self.provisioning_state = None + self.instance_view = None + + +class VirtualMachineRunCommandInstanceView(msrest.serialization.Model): + """The instance view of a virtual machine run command. + + :param execution_state: Script execution status. Possible values include: "Unknown", "Pending", + "Running", "Failed", "Succeeded", "TimedOut", "Canceled". + :type execution_state: str or ~azure.mgmt.compute.v2020_06_01.models.ExecutionState + :param execution_message: Communicate script configuration errors or execution messages. + :type execution_message: str + :param exit_code: Exit code returned from script execution. + :type exit_code: int + :param output: Script output stream. + :type output: str + :param error: Script error stream. + :type error: str + :param start_time: Script start time. + :type start_time: ~datetime.datetime + :param end_time: Script end time. + :type end_time: ~datetime.datetime + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus] + """ + + _attribute_map = { + 'execution_state': {'key': 'executionState', 'type': 'str'}, + 'execution_message': {'key': 'executionMessage', 'type': 'str'}, + 'exit_code': {'key': 'exitCode', 'type': 'int'}, + 'output': {'key': 'output', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineRunCommandInstanceView, self).__init__(**kwargs) + self.execution_state = kwargs.get('execution_state', None) + self.execution_message = kwargs.get('execution_message', None) + self.exit_code = kwargs.get('exit_code', None) + self.output = kwargs.get('output', None) + self.error = kwargs.get('error', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.statuses = kwargs.get('statuses', None) + + +class VirtualMachineRunCommandScriptSource(msrest.serialization.Model): + """Describes the script sources for run command. + + :param script: Specifies the script content to be executed on the VM. + :type script: str + :param script_uri: Specifies the script download location. + :type script_uri: str + :param command_id: Specifies a commandId of predefined built-in script. + :type command_id: str + """ + + _attribute_map = { + 'script': {'key': 'script', 'type': 'str'}, + 'script_uri': {'key': 'scriptUri', 'type': 'str'}, + 'command_id': {'key': 'commandId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineRunCommandScriptSource, self).__init__(**kwargs) + self.script = kwargs.get('script', None) + self.script_uri = kwargs.get('script_uri', None) + self.command_id = kwargs.get('command_id', None) + + +class VirtualMachineRunCommandsListResult(msrest.serialization.Model): + """The List run command operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of run commands. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommand] + :param next_link: The uri to fetch the next page of run commands. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualMachineRunCommand]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineRunCommandsListResult, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class VirtualMachineRunCommandUpdate(UpdateResource): + """Describes a Virtual Machine run command. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param source: The source of the run command script. + :type source: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommandScriptSource + :param parameters: The parameters used by the script. + :type parameters: list[~azure.mgmt.compute.v2020_06_01.models.RunCommandInputParameter] + :param protected_parameters: The parameters used by the script. + :type protected_parameters: + list[~azure.mgmt.compute.v2020_06_01.models.RunCommandInputParameter] + :param async_execution: Optional. If set to true, provisioning will complete as soon as the + script starts and will not wait for script to complete. + :type async_execution: bool + :param run_as_user: Specifies the user account on the VM when executing the run command. + :type run_as_user: str + :param run_as_password: Specifies the user account password on the VM when executing the run + command. + :type run_as_password: str + :param timeout_in_seconds: The timeout in seconds to execute the run command. + :type timeout_in_seconds: int + :param output_blob_uri: Specifies the Azure storage blob where script output stream will be + uploaded. + :type output_blob_uri: str + :param error_blob_uri: Specifies the Azure storage blob where script error stream will be + uploaded. + :type error_blob_uri: str + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar instance_view: The virtual machine run command instance view. + :vartype instance_view: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommandInstanceView + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'instance_view': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source': {'key': 'properties.source', 'type': 'VirtualMachineRunCommandScriptSource'}, + 'parameters': {'key': 'properties.parameters', 'type': '[RunCommandInputParameter]'}, + 'protected_parameters': {'key': 'properties.protectedParameters', 'type': '[RunCommandInputParameter]'}, + 'async_execution': {'key': 'properties.asyncExecution', 'type': 'bool'}, + 'run_as_user': {'key': 'properties.runAsUser', 'type': 'str'}, + 'run_as_password': {'key': 'properties.runAsPassword', 'type': 'str'}, + 'timeout_in_seconds': {'key': 'properties.timeoutInSeconds', 'type': 'int'}, + 'output_blob_uri': {'key': 'properties.outputBlobUri', 'type': 'str'}, + 'error_blob_uri': {'key': 'properties.errorBlobUri', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineRunCommandInstanceView'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineRunCommandUpdate, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.parameters = kwargs.get('parameters', None) + self.protected_parameters = kwargs.get('protected_parameters', None) + self.async_execution = kwargs.get('async_execution', False) + self.run_as_user = kwargs.get('run_as_user', None) + self.run_as_password = kwargs.get('run_as_password', None) + self.timeout_in_seconds = kwargs.get('timeout_in_seconds', None) + self.output_blob_uri = kwargs.get('output_blob_uri', None) + self.error_blob_uri = kwargs.get('error_blob_uri', None) + self.provisioning_state = None + self.instance_view = None + + class VirtualMachineScaleSet(Resource): """Describes a Virtual Machine Scale Set. @@ -5754,7 +5997,7 @@ class VirtualMachineScaleSetIdentity(msrest.serialization.Model): form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :type user_assigned_identities: dict[str, - ~azure.mgmt.compute.v2020_06_01.models.ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties] + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue] """ _validation = { @@ -5766,7 +6009,7 @@ class VirtualMachineScaleSetIdentity(msrest.serialization.Model): 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue}'}, } def __init__( @@ -5780,6 +6023,36 @@ def __init__( self.user_assigned_identities = kwargs.get('user_assigned_identities', None) +class VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue(msrest.serialization.Model): + """VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class VirtualMachineScaleSetInstanceView(msrest.serialization.Model): """The instance view of a virtual machine scale set. @@ -7049,14 +7322,15 @@ class VirtualMachineScaleSetVM(Resource): :ivar provisioning_state: The provisioning state, which only appears in the response. :vartype provisioning_state: str :param license_type: Specifies that the image or disk that is being used was licensed on- - premises. This element is only used for images that contain the Windows Server operating - system. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` Windows_Client - :code:`
`:code:`
` Windows_Server :code:`
`:code:`
` If this element is included in - a request for an update, the value must match the initial value. This value cannot be updated. + premises. :code:`
`:code:`
` Possible values for Windows Server operating system are: + :code:`
`:code:`
` Windows_Client :code:`
`:code:`
` Windows_Server + :code:`
`:code:`
` Possible values for Linux Server operating system are: + :code:`
`:code:`
` RHEL_BYOS (for RHEL) :code:`
`:code:`
` SLES_BYOS (for SUSE) :code:`
`:code:`
` For more information, see `Azure Hybrid Use Benefit for Windows Server - `_ :code:`
`:code:`
` - Minimum api-version: 2015-06-15. + `_ + :code:`
`:code:`
` `Azure Hybrid Use Benefit for Linux Server + `_ + :code:`
`:code:`
` Minimum api-version: 2015-06-15. :type license_type: str :ivar model_definition_applied: Specifies whether the model applied to the virtual machine is the model of the virtual machine scale set or the customized model for the virtual machine. @@ -7139,6 +7413,106 @@ def __init__( self.protection_policy = kwargs.get('protection_policy', None) +class VirtualMachineScaleSetVMExtension(SubResourceReadOnly): + """Describes a VMSS VM Extension. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: The name of the extension. + :vartype name: str + :ivar type: Resource type. + :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 enable_automatic_upgrade: Indicates whether the extension should be automatically + upgraded by the platform if there is a newer version of the extension available. + :type enable_automatic_upgrade: 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 virtual machine extension instance view. + :type instance_view: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionInstanceView + """ + + _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'}, + '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'}, + 'enable_automatic_upgrade': {'key': 'properties.enableAutomaticUpgrade', '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': 'VirtualMachineExtensionInstanceView'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetVMExtension, self).__init__(**kwargs) + self.name = 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.enable_automatic_upgrade = kwargs.get('enable_automatic_upgrade', 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 VirtualMachineScaleSetVMExtensionsListResult(msrest.serialization.Model): + """The List VMSS VM Extension operation response. + + :param value: The list of VMSS VM extensions. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMExtension] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualMachineScaleSetVMExtension]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetVMExtensionsListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + class VirtualMachineScaleSetVMExtensionsSummary(msrest.serialization.Model): """Extensions summary for virtual machines of a virtual machine scale set. @@ -7170,6 +7544,78 @@ def __init__( self.statuses_summary = None +class VirtualMachineScaleSetVMExtensionUpdate(SubResourceReadOnly): + """Describes a VMSS VM Extension. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: The name of the extension. + :vartype name: str + :ivar type: Resource type. + :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 enable_automatic_upgrade: Indicates whether the extension should be automatically + upgraded by the platform if there is a newer version of the extension available. + :type enable_automatic_upgrade: 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 + """ + + _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'}, + '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'}, + 'enable_automatic_upgrade': {'key': 'properties.enableAutomaticUpgrade', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetVMExtensionUpdate, self).__init__(**kwargs) + self.name = 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.enable_automatic_upgrade = kwargs.get('enable_automatic_upgrade', None) + self.settings = kwargs.get('settings', None) + self.protected_settings = kwargs.get('protected_settings', None) + + class VirtualMachineScaleSetVMInstanceIDs(msrest.serialization.Model): """Specifies a list of virtual machine instance IDs from the VM scale set. @@ -7369,14 +7815,15 @@ class VirtualMachineScaleSetVMProfile(msrest.serialization.Model): :type extension_profile: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetExtensionProfile :param license_type: Specifies that the image or disk that is being used was licensed on- - premises. This element is only used for images that contain the Windows Server operating - system. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` Windows_Client - :code:`
`:code:`
` Windows_Server :code:`
`:code:`
` If this element is included in - a request for an update, the value must match the initial value. This value cannot be updated. + premises. :code:`
`:code:`
` Possible values for Windows Server operating system are: + :code:`
`:code:`
` Windows_Client :code:`
`:code:`
` Windows_Server + :code:`
`:code:`
` Possible values for Linux Server operating system are: + :code:`
`:code:`
` RHEL_BYOS (for RHEL) :code:`
`:code:`
` SLES_BYOS (for SUSE) :code:`
`:code:`
` For more information, see `Azure Hybrid Use Benefit for Windows Server - `_ :code:`
`:code:`
` - Minimum api-version: 2015-06-15. + `_ + :code:`
`:code:`
` `Azure Hybrid Use Benefit for Linux Server + `_ + :code:`
`:code:`
` Minimum api-version: 2015-06-15. :type license_type: str :param priority: Specifies the priority for the virtual machines in the scale set. :code:`
`:code:`
`Minimum api-version: 2017-10-30-preview. Possible values include: @@ -7728,14 +8175,15 @@ class VirtualMachineUpdate(UpdateResource): :ivar instance_view: The virtual machine instance view. :vartype instance_view: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineInstanceView :param license_type: Specifies that the image or disk that is being used was licensed on- - premises. This element is only used for images that contain the Windows Server operating - system. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` Windows_Client - :code:`
`:code:`
` Windows_Server :code:`
`:code:`
` If this element is included in - a request for an update, the value must match the initial value. This value cannot be updated. + premises. :code:`
`:code:`
` Possible values for Windows Server operating system are: + :code:`
`:code:`
` Windows_Client :code:`
`:code:`
` Windows_Server + :code:`
`:code:`
` Possible values for Linux Server operating system are: + :code:`
`:code:`
` RHEL_BYOS (for RHEL) :code:`
`:code:`
` SLES_BYOS (for SUSE) :code:`
`:code:`
` For more information, see `Azure Hybrid Use Benefit for Windows Server - `_ :code:`
`:code:`
` - Minimum api-version: 2015-06-15. + `_ + :code:`
`:code:`
` `Azure Hybrid Use Benefit for Linux Server + `_ + :code:`
`:code:`
` Minimum api-version: 2015-06-15. :type license_type: str :ivar vm_id: Specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_models_py3.py index f1280078a910..9aae7b0f6d36 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_models_py3.py @@ -678,66 +678,6 @@ def __init__( self.status = None -class Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - class ComputeOperationListResult(msrest.serialization.Model): """The List Compute Operation operation response. @@ -996,7 +936,7 @@ class DedicatedHost(Resource): 'type': {'readonly': True}, 'location': {'required': True}, 'sku': {'required': True}, - 'platform_fault_domain': {'maximum': 2, 'minimum': 0}, + 'platform_fault_domain': {'minimum': 0}, 'host_id': {'readonly': True}, 'virtual_machines': {'readonly': True}, 'provisioning_time': {'readonly': True}, @@ -1124,8 +1064,8 @@ class DedicatedHostGroup(Resource): :param support_automatic_placement: Specifies whether virtual machines or virtual machine scale sets can be placed automatically on the dedicated host group. Automatic placement means resources are allocated on dedicated hosts, that are chosen by Azure, under the dedicated host - group. The value is defaulted to 'true' when not provided. :code:`
`:code:`
`Minimum api- - version: 2020-06-01. + group. The value is defaulted to 'false' when not provided. :code:`
`:code:`
`Minimum + api-version: 2020-06-01. :type support_automatic_placement: bool """ @@ -1134,7 +1074,7 @@ class DedicatedHostGroup(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, - 'platform_fault_domain_count': {'maximum': 3, 'minimum': 1}, + 'platform_fault_domain_count': {'minimum': 1}, 'hosts': {'readonly': True}, 'instance_view': {'readonly': True}, } @@ -1245,13 +1185,13 @@ class DedicatedHostGroupUpdate(UpdateResource): :param support_automatic_placement: Specifies whether virtual machines or virtual machine scale sets can be placed automatically on the dedicated host group. Automatic placement means resources are allocated on dedicated hosts, that are chosen by Azure, under the dedicated host - group. The value is defaulted to 'true' when not provided. :code:`
`:code:`
`Minimum api- - version: 2020-06-01. + group. The value is defaulted to 'false' when not provided. :code:`
`:code:`
`Minimum + api-version: 2020-06-01. :type support_automatic_placement: bool """ _validation = { - 'platform_fault_domain_count': {'maximum': 3, 'minimum': 1}, + 'platform_fault_domain_count': {'minimum': 1}, 'hosts': {'readonly': True}, 'instance_view': {'readonly': True}, } @@ -1423,7 +1363,7 @@ class DedicatedHostUpdate(UpdateResource): """ _validation = { - 'platform_fault_domain': {'maximum': 2, 'minimum': 0}, + 'platform_fault_domain': {'minimum': 0}, 'host_id': {'readonly': True}, 'virtual_machines': {'readonly': True}, 'provisioning_time': {'readonly': True}, @@ -4606,6 +4546,36 @@ def __init__( self.localized_value = localized_value +class UserAssignedIdentitiesValue(msrest.serialization.Model): + """UserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class VaultCertificate(msrest.serialization.Model): """Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM. @@ -4793,14 +4763,15 @@ class VirtualMachine(Resource): :ivar instance_view: The virtual machine instance view. :vartype instance_view: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineInstanceView :param license_type: Specifies that the image or disk that is being used was licensed on- - premises. This element is only used for images that contain the Windows Server operating - system. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` Windows_Client - :code:`
`:code:`
` Windows_Server :code:`
`:code:`
` If this element is included in - a request for an update, the value must match the initial value. This value cannot be updated. + premises. :code:`
`:code:`
` Possible values for Windows Server operating system are: + :code:`
`:code:`
` Windows_Client :code:`
`:code:`
` Windows_Server + :code:`
`:code:`
` Possible values for Linux Server operating system are: + :code:`
`:code:`
` RHEL_BYOS (for RHEL) :code:`
`:code:`
` SLES_BYOS (for SUSE) :code:`
`:code:`
` For more information, see `Azure Hybrid Use Benefit for Windows Server - `_ :code:`
`:code:`
` - Minimum api-version: 2015-06-15. + `_ + :code:`
`:code:`
` `Azure Hybrid Use Benefit for Linux Server + `_ + :code:`
`:code:`
` Minimum api-version: 2015-06-15. :type license_type: str :ivar vm_id: Specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands. @@ -5470,7 +5441,7 @@ class VirtualMachineIdentity(msrest.serialization.Model): Machine. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :type user_assigned_identities: dict[str, - ~azure.mgmt.compute.v2020_06_01.models.Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties] + ~azure.mgmt.compute.v2020_06_01.models.UserAssignedIdentitiesValue] """ _validation = { @@ -5482,14 +5453,14 @@ class VirtualMachineIdentity(msrest.serialization.Model): 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentitiesValue}'}, } def __init__( self, *, type: Optional[Union[str, "ResourceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, "Components1H8M3EpSchemasVirtualmachineidentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + user_assigned_identities: Optional[Dict[str, "UserAssignedIdentitiesValue"]] = None, **kwargs ): super(VirtualMachineIdentity, self).__init__(**kwargs) @@ -5812,6 +5783,317 @@ def __init__( self.temp_disk = temp_disk +class VirtualMachineRunCommand(Resource): + """Describes a Virtual Machine run command. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param source: The source of the run command script. + :type source: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommandScriptSource + :param parameters: The parameters used by the script. + :type parameters: list[~azure.mgmt.compute.v2020_06_01.models.RunCommandInputParameter] + :param protected_parameters: The parameters used by the script. + :type protected_parameters: + list[~azure.mgmt.compute.v2020_06_01.models.RunCommandInputParameter] + :param async_execution: Optional. If set to true, provisioning will complete as soon as the + script starts and will not wait for script to complete. + :type async_execution: bool + :param run_as_user: Specifies the user account on the VM when executing the run command. + :type run_as_user: str + :param run_as_password: Specifies the user account password on the VM when executing the run + command. + :type run_as_password: str + :param timeout_in_seconds: The timeout in seconds to execute the run command. + :type timeout_in_seconds: int + :param output_blob_uri: Specifies the Azure storage blob where script output stream will be + uploaded. + :type output_blob_uri: str + :param error_blob_uri: Specifies the Azure storage blob where script error stream will be + uploaded. + :type error_blob_uri: str + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar instance_view: The virtual machine run command instance view. + :vartype instance_view: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommandInstanceView + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'instance_view': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source': {'key': 'properties.source', 'type': 'VirtualMachineRunCommandScriptSource'}, + 'parameters': {'key': 'properties.parameters', 'type': '[RunCommandInputParameter]'}, + 'protected_parameters': {'key': 'properties.protectedParameters', 'type': '[RunCommandInputParameter]'}, + 'async_execution': {'key': 'properties.asyncExecution', 'type': 'bool'}, + 'run_as_user': {'key': 'properties.runAsUser', 'type': 'str'}, + 'run_as_password': {'key': 'properties.runAsPassword', 'type': 'str'}, + 'timeout_in_seconds': {'key': 'properties.timeoutInSeconds', 'type': 'int'}, + 'output_blob_uri': {'key': 'properties.outputBlobUri', 'type': 'str'}, + 'error_blob_uri': {'key': 'properties.errorBlobUri', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineRunCommandInstanceView'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + source: Optional["VirtualMachineRunCommandScriptSource"] = None, + parameters: Optional[List["RunCommandInputParameter"]] = None, + protected_parameters: Optional[List["RunCommandInputParameter"]] = None, + async_execution: Optional[bool] = False, + run_as_user: Optional[str] = None, + run_as_password: Optional[str] = None, + timeout_in_seconds: Optional[int] = None, + output_blob_uri: Optional[str] = None, + error_blob_uri: Optional[str] = None, + **kwargs + ): + super(VirtualMachineRunCommand, self).__init__(location=location, tags=tags, **kwargs) + self.source = source + self.parameters = parameters + self.protected_parameters = protected_parameters + self.async_execution = async_execution + self.run_as_user = run_as_user + self.run_as_password = run_as_password + self.timeout_in_seconds = timeout_in_seconds + self.output_blob_uri = output_blob_uri + self.error_blob_uri = error_blob_uri + self.provisioning_state = None + self.instance_view = None + + +class VirtualMachineRunCommandInstanceView(msrest.serialization.Model): + """The instance view of a virtual machine run command. + + :param execution_state: Script execution status. Possible values include: "Unknown", "Pending", + "Running", "Failed", "Succeeded", "TimedOut", "Canceled". + :type execution_state: str or ~azure.mgmt.compute.v2020_06_01.models.ExecutionState + :param execution_message: Communicate script configuration errors or execution messages. + :type execution_message: str + :param exit_code: Exit code returned from script execution. + :type exit_code: int + :param output: Script output stream. + :type output: str + :param error: Script error stream. + :type error: str + :param start_time: Script start time. + :type start_time: ~datetime.datetime + :param end_time: Script end time. + :type end_time: ~datetime.datetime + :param statuses: The resource status information. + :type statuses: list[~azure.mgmt.compute.v2020_06_01.models.InstanceViewStatus] + """ + + _attribute_map = { + 'execution_state': {'key': 'executionState', 'type': 'str'}, + 'execution_message': {'key': 'executionMessage', 'type': 'str'}, + 'exit_code': {'key': 'exitCode', 'type': 'int'}, + 'output': {'key': 'output', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__( + self, + *, + execution_state: Optional[Union[str, "ExecutionState"]] = None, + execution_message: Optional[str] = None, + exit_code: Optional[int] = None, + output: Optional[str] = None, + error: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + statuses: Optional[List["InstanceViewStatus"]] = None, + **kwargs + ): + super(VirtualMachineRunCommandInstanceView, self).__init__(**kwargs) + self.execution_state = execution_state + self.execution_message = execution_message + self.exit_code = exit_code + self.output = output + self.error = error + self.start_time = start_time + self.end_time = end_time + self.statuses = statuses + + +class VirtualMachineRunCommandScriptSource(msrest.serialization.Model): + """Describes the script sources for run command. + + :param script: Specifies the script content to be executed on the VM. + :type script: str + :param script_uri: Specifies the script download location. + :type script_uri: str + :param command_id: Specifies a commandId of predefined built-in script. + :type command_id: str + """ + + _attribute_map = { + 'script': {'key': 'script', 'type': 'str'}, + 'script_uri': {'key': 'scriptUri', 'type': 'str'}, + 'command_id': {'key': 'commandId', 'type': 'str'}, + } + + def __init__( + self, + *, + script: Optional[str] = None, + script_uri: Optional[str] = None, + command_id: Optional[str] = None, + **kwargs + ): + super(VirtualMachineRunCommandScriptSource, self).__init__(**kwargs) + self.script = script + self.script_uri = script_uri + self.command_id = command_id + + +class VirtualMachineRunCommandsListResult(msrest.serialization.Model): + """The List run command operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The list of run commands. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommand] + :param next_link: The uri to fetch the next page of run commands. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualMachineRunCommand]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["VirtualMachineRunCommand"], + next_link: Optional[str] = None, + **kwargs + ): + super(VirtualMachineRunCommandsListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class VirtualMachineRunCommandUpdate(UpdateResource): + """Describes a Virtual Machine run command. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param source: The source of the run command script. + :type source: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommandScriptSource + :param parameters: The parameters used by the script. + :type parameters: list[~azure.mgmt.compute.v2020_06_01.models.RunCommandInputParameter] + :param protected_parameters: The parameters used by the script. + :type protected_parameters: + list[~azure.mgmt.compute.v2020_06_01.models.RunCommandInputParameter] + :param async_execution: Optional. If set to true, provisioning will complete as soon as the + script starts and will not wait for script to complete. + :type async_execution: bool + :param run_as_user: Specifies the user account on the VM when executing the run command. + :type run_as_user: str + :param run_as_password: Specifies the user account password on the VM when executing the run + command. + :type run_as_password: str + :param timeout_in_seconds: The timeout in seconds to execute the run command. + :type timeout_in_seconds: int + :param output_blob_uri: Specifies the Azure storage blob where script output stream will be + uploaded. + :type output_blob_uri: str + :param error_blob_uri: Specifies the Azure storage blob where script error stream will be + uploaded. + :type error_blob_uri: str + :ivar provisioning_state: The provisioning state, which only appears in the response. + :vartype provisioning_state: str + :ivar instance_view: The virtual machine run command instance view. + :vartype instance_view: + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommandInstanceView + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'instance_view': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source': {'key': 'properties.source', 'type': 'VirtualMachineRunCommandScriptSource'}, + 'parameters': {'key': 'properties.parameters', 'type': '[RunCommandInputParameter]'}, + 'protected_parameters': {'key': 'properties.protectedParameters', 'type': '[RunCommandInputParameter]'}, + 'async_execution': {'key': 'properties.asyncExecution', 'type': 'bool'}, + 'run_as_user': {'key': 'properties.runAsUser', 'type': 'str'}, + 'run_as_password': {'key': 'properties.runAsPassword', 'type': 'str'}, + 'timeout_in_seconds': {'key': 'properties.timeoutInSeconds', 'type': 'int'}, + 'output_blob_uri': {'key': 'properties.outputBlobUri', 'type': 'str'}, + 'error_blob_uri': {'key': 'properties.errorBlobUri', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineRunCommandInstanceView'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + source: Optional["VirtualMachineRunCommandScriptSource"] = None, + parameters: Optional[List["RunCommandInputParameter"]] = None, + protected_parameters: Optional[List["RunCommandInputParameter"]] = None, + async_execution: Optional[bool] = False, + run_as_user: Optional[str] = None, + run_as_password: Optional[str] = None, + timeout_in_seconds: Optional[int] = None, + output_blob_uri: Optional[str] = None, + error_blob_uri: Optional[str] = None, + **kwargs + ): + super(VirtualMachineRunCommandUpdate, self).__init__(tags=tags, **kwargs) + self.source = source + self.parameters = parameters + self.protected_parameters = protected_parameters + self.async_execution = async_execution + self.run_as_user = run_as_user + self.run_as_password = run_as_password + self.timeout_in_seconds = timeout_in_seconds + self.output_blob_uri = output_blob_uri + self.error_blob_uri = error_blob_uri + self.provisioning_state = None + self.instance_view = None + + class VirtualMachineScaleSet(Resource): """Describes a Virtual Machine Scale Set. @@ -6316,7 +6598,7 @@ class VirtualMachineScaleSetIdentity(msrest.serialization.Model): form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :type user_assigned_identities: dict[str, - ~azure.mgmt.compute.v2020_06_01.models.ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties] + ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue] """ _validation = { @@ -6328,14 +6610,14 @@ class VirtualMachineScaleSetIdentity(msrest.serialization.Model): 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue}'}, } def __init__( self, *, type: Optional[Union[str, "ResourceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, "ComponentsNj115SSchemasVirtualmachinescalesetidentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + user_assigned_identities: Optional[Dict[str, "VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue"]] = None, **kwargs ): super(VirtualMachineScaleSetIdentity, self).__init__(**kwargs) @@ -6345,6 +6627,36 @@ def __init__( self.user_assigned_identities = user_assigned_identities +class VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue(msrest.serialization.Model): + """VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class VirtualMachineScaleSetInstanceView(msrest.serialization.Model): """The instance view of a virtual machine scale set. @@ -7761,14 +8073,15 @@ class VirtualMachineScaleSetVM(Resource): :ivar provisioning_state: The provisioning state, which only appears in the response. :vartype provisioning_state: str :param license_type: Specifies that the image or disk that is being used was licensed on- - premises. This element is only used for images that contain the Windows Server operating - system. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` Windows_Client - :code:`
`:code:`
` Windows_Server :code:`
`:code:`
` If this element is included in - a request for an update, the value must match the initial value. This value cannot be updated. + premises. :code:`
`:code:`
` Possible values for Windows Server operating system are: + :code:`
`:code:`
` Windows_Client :code:`
`:code:`
` Windows_Server + :code:`
`:code:`
` Possible values for Linux Server operating system are: + :code:`
`:code:`
` RHEL_BYOS (for RHEL) :code:`
`:code:`
` SLES_BYOS (for SUSE) :code:`
`:code:`
` For more information, see `Azure Hybrid Use Benefit for Windows Server - `_ :code:`
`:code:`
` - Minimum api-version: 2015-06-15. + `_ + :code:`
`:code:`
` `Azure Hybrid Use Benefit for Linux Server + `_ + :code:`
`:code:`
` Minimum api-version: 2015-06-15. :type license_type: str :ivar model_definition_applied: Specifies whether the model applied to the virtual machine is the model of the virtual machine scale set or the customized model for the virtual machine. @@ -7866,6 +8179,118 @@ def __init__( self.protection_policy = protection_policy +class VirtualMachineScaleSetVMExtension(SubResourceReadOnly): + """Describes a VMSS VM Extension. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: The name of the extension. + :vartype name: str + :ivar type: Resource type. + :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 enable_automatic_upgrade: Indicates whether the extension should be automatically + upgraded by the platform if there is a newer version of the extension available. + :type enable_automatic_upgrade: 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 virtual machine extension instance view. + :type instance_view: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionInstanceView + """ + + _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'}, + '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'}, + 'enable_automatic_upgrade': {'key': 'properties.enableAutomaticUpgrade', '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': 'VirtualMachineExtensionInstanceView'}, + } + + def __init__( + self, + *, + 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, + enable_automatic_upgrade: Optional[bool] = None, + settings: Optional[object] = None, + protected_settings: Optional[object] = None, + instance_view: Optional["VirtualMachineExtensionInstanceView"] = None, + **kwargs + ): + super(VirtualMachineScaleSetVMExtension, self).__init__(**kwargs) + self.name = 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.enable_automatic_upgrade = enable_automatic_upgrade + self.settings = settings + self.protected_settings = protected_settings + self.provisioning_state = None + self.instance_view = instance_view + + +class VirtualMachineScaleSetVMExtensionsListResult(msrest.serialization.Model): + """The List VMSS VM Extension operation response. + + :param value: The list of VMSS VM extensions. + :type value: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMExtension] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VirtualMachineScaleSetVMExtension]'}, + } + + def __init__( + self, + *, + value: Optional[List["VirtualMachineScaleSetVMExtension"]] = None, + **kwargs + ): + super(VirtualMachineScaleSetVMExtensionsListResult, self).__init__(**kwargs) + self.value = value + + class VirtualMachineScaleSetVMExtensionsSummary(msrest.serialization.Model): """Extensions summary for virtual machines of a virtual machine scale set. @@ -7897,6 +8322,87 @@ def __init__( self.statuses_summary = None +class VirtualMachineScaleSetVMExtensionUpdate(SubResourceReadOnly): + """Describes a VMSS VM Extension. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: The name of the extension. + :vartype name: str + :ivar type: Resource type. + :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 enable_automatic_upgrade: Indicates whether the extension should be automatically + upgraded by the platform if there is a newer version of the extension available. + :type enable_automatic_upgrade: 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 + """ + + _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'}, + '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'}, + 'enable_automatic_upgrade': {'key': 'properties.enableAutomaticUpgrade', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': 'object'}, + 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, + } + + def __init__( + self, + *, + 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, + enable_automatic_upgrade: Optional[bool] = None, + settings: Optional[object] = None, + protected_settings: Optional[object] = None, + **kwargs + ): + super(VirtualMachineScaleSetVMExtensionUpdate, self).__init__(**kwargs) + self.name = 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.enable_automatic_upgrade = enable_automatic_upgrade + self.settings = settings + self.protected_settings = protected_settings + + class VirtualMachineScaleSetVMInstanceIDs(msrest.serialization.Model): """Specifies a list of virtual machine instance IDs from the VM scale set. @@ -8116,14 +8622,15 @@ class VirtualMachineScaleSetVMProfile(msrest.serialization.Model): :type extension_profile: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetExtensionProfile :param license_type: Specifies that the image or disk that is being used was licensed on- - premises. This element is only used for images that contain the Windows Server operating - system. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` Windows_Client - :code:`
`:code:`
` Windows_Server :code:`
`:code:`
` If this element is included in - a request for an update, the value must match the initial value. This value cannot be updated. + premises. :code:`
`:code:`
` Possible values for Windows Server operating system are: + :code:`
`:code:`
` Windows_Client :code:`
`:code:`
` Windows_Server + :code:`
`:code:`
` Possible values for Linux Server operating system are: + :code:`
`:code:`
` RHEL_BYOS (for RHEL) :code:`
`:code:`
` SLES_BYOS (for SUSE) :code:`
`:code:`
` For more information, see `Azure Hybrid Use Benefit for Windows Server - `_ :code:`
`:code:`
` - Minimum api-version: 2015-06-15. + `_ + :code:`
`:code:`
` `Azure Hybrid Use Benefit for Linux Server + `_ + :code:`
`:code:`
` Minimum api-version: 2015-06-15. :type license_type: str :param priority: Specifies the priority for the virtual machines in the scale set. :code:`
`:code:`
`Minimum api-version: 2017-10-30-preview. Possible values include: @@ -8501,14 +9008,15 @@ class VirtualMachineUpdate(UpdateResource): :ivar instance_view: The virtual machine instance view. :vartype instance_view: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineInstanceView :param license_type: Specifies that the image or disk that is being used was licensed on- - premises. This element is only used for images that contain the Windows Server operating - system. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` Windows_Client - :code:`
`:code:`
` Windows_Server :code:`
`:code:`
` If this element is included in - a request for an update, the value must match the initial value. This value cannot be updated. + premises. :code:`
`:code:`
` Possible values for Windows Server operating system are: + :code:`
`:code:`
` Windows_Client :code:`
`:code:`
` Windows_Server + :code:`
`:code:`
` Possible values for Linux Server operating system are: + :code:`
`:code:`
` RHEL_BYOS (for RHEL) :code:`
`:code:`
` SLES_BYOS (for SUSE) :code:`
`:code:`
` For more information, see `Azure Hybrid Use Benefit for Windows Server - `_ :code:`
`:code:`
` - Minimum api-version: 2015-06-15. + `_ + :code:`
`:code:`
` `Azure Hybrid Use Benefit for Linux Server + `_ + :code:`
`:code:`
` Minimum api-version: 2015-06-15. :type license_type: str :ivar vm_id: Specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/__init__.py index 059428308b09..504bd3ccebae 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/__init__.py @@ -26,6 +26,7 @@ from ._virtual_machine_scale_set_vms_operations import VirtualMachineScaleSetVMsOperations from ._log_analytics_operations import LogAnalyticsOperations from ._virtual_machine_run_commands_operations import VirtualMachineRunCommandsOperations +from ._virtual_machine_scale_set_vm_run_commands_operations import VirtualMachineScaleSetVMRunCommandsOperations __all__ = [ 'Operations', @@ -48,4 +49,5 @@ 'VirtualMachineScaleSetVMsOperations', 'LogAnalyticsOperations', 'VirtualMachineRunCommandsOperations', + 'VirtualMachineScaleSetVMRunCommandsOperations', ] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_availability_sets_operations.py index f91ad1088426..eb909335cc21 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_availability_sets_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class AvailabilitySetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str availability_set_name, # type: str - parameters, # type: "models.AvailabilitySet" + parameters, # type: "_models.AvailabilitySet" **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Create or update an availability set. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~azure.mgmt.compute.v2020_06_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -116,10 +116,10 @@ def update( self, resource_group_name, # type: str availability_set_name, # type: str - parameters, # type: "models.AvailabilitySetUpdate" + parameters, # type: "_models.AvailabilitySetUpdate" **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Update an availability set. :param resource_group_name: The name of the resource group. @@ -133,7 +133,7 @@ def update( :rtype: ~azure.mgmt.compute.v2020_06_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -239,7 +239,7 @@ def get( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.AvailabilitySet" + # type: (...) -> "_models.AvailabilitySet" """Retrieves information about an availability set. :param resource_group_name: The name of the resource group. @@ -251,7 +251,7 @@ def get( :rtype: ~azure.mgmt.compute.v2020_06_01.models.AvailabilitySet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -297,7 +297,7 @@ def list_by_subscription( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailabilitySetListResult"] + # type: (...) -> Iterable["_models.AvailabilitySetListResult"] """Lists all availability sets in a subscription. :param expand: The expand expression to apply to the operation. Allowed values are @@ -308,7 +308,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -370,7 +370,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.AvailabilitySetListResult"] + # type: (...) -> Iterable["_models.AvailabilitySetListResult"] """Lists all availability sets in a resource group. :param resource_group_name: The name of the resource group. @@ -380,7 +380,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.AvailabilitySetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.AvailabilitySetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailabilitySetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -442,7 +442,7 @@ def list_available_sizes( availability_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. @@ -455,7 +455,7 @@ def list_available_sizes( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_host_groups_operations.py index 79f0fb8ebc96..8c821ecbf0b6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_host_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class DedicatedHostGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str host_group_name, # type: str - parameters, # type: "models.DedicatedHostGroup" + parameters, # type: "_models.DedicatedHostGroup" **kwargs # type: Any ): - # type: (...) -> "models.DedicatedHostGroup" + # type: (...) -> "_models.DedicatedHostGroup" """Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). @@ -68,7 +68,7 @@ def create_or_update( :rtype: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,10 +122,10 @@ def update( self, resource_group_name, # type: str host_group_name, # type: str - parameters, # type: "models.DedicatedHostGroupUpdate" + parameters, # type: "_models.DedicatedHostGroupUpdate" **kwargs # type: Any ): - # type: (...) -> "models.DedicatedHostGroup" + # type: (...) -> "_models.DedicatedHostGroup" """Update an dedicated host group. :param resource_group_name: The name of the resource group. @@ -139,7 +139,7 @@ def update( :rtype: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -246,7 +246,7 @@ def get( expand="instanceView", # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.DedicatedHostGroup" + # type: (...) -> "_models.DedicatedHostGroup" """Retrieves information about a dedicated host group. :param resource_group_name: The name of the resource group. @@ -261,7 +261,7 @@ def get( :rtype: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -309,7 +309,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DedicatedHostGroupListResult"] + # type: (...) -> Iterable["_models.DedicatedHostGroupListResult"] """Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups. @@ -320,7 +320,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -380,7 +380,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DedicatedHostGroupListResult"] + # type: (...) -> Iterable["_models.DedicatedHostGroupListResult"] """Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups. @@ -389,7 +389,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.DedicatedHostGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_hosts_operations.py index a5b7c07a63c1..a7bc88585e8d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_hosts_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DedicatedHostsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str host_group_name, # type: str host_name, # type: str - parameters, # type: "models.DedicatedHost" + parameters, # type: "_models.DedicatedHost" **kwargs # type: Any ): - # type: (...) -> "models.DedicatedHost" - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + # type: (...) -> "_models.DedicatedHost" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def begin_create_or_update( resource_group_name, # type: str host_group_name, # type: str host_name, # type: str - parameters, # type: "models.DedicatedHost" + parameters, # type: "_models.DedicatedHost" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DedicatedHost"] + # type: (...) -> LROPoller["_models.DedicatedHost"] """Create or update a dedicated host . :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,7 +163,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -182,11 +189,11 @@ def _update_initial( resource_group_name, # type: str host_group_name, # type: str host_name, # type: str - parameters, # type: "models.DedicatedHostUpdate" + parameters, # type: "_models.DedicatedHostUpdate" **kwargs # type: Any ): - # type: (...) -> "models.DedicatedHost" - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + # type: (...) -> "_models.DedicatedHost" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -238,10 +245,10 @@ def begin_update( resource_group_name, # type: str host_group_name, # type: str host_name, # type: str - parameters, # type: "models.DedicatedHostUpdate" + parameters, # type: "_models.DedicatedHostUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DedicatedHost"] + # type: (...) -> LROPoller["_models.DedicatedHost"] """Update an dedicated host . :param resource_group_name: The name of the resource group. @@ -263,7 +270,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -289,7 +296,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -397,7 +411,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -419,7 +440,7 @@ def get( expand="instanceView", # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.DedicatedHost" + # type: (...) -> "_models.DedicatedHost" """Retrieves information about a dedicated host. :param resource_group_name: The name of the resource group. @@ -435,7 +456,7 @@ def get( :rtype: ~azure.mgmt.compute.v2020_06_01.models.DedicatedHost :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHost"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHost"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -485,7 +506,7 @@ def list_by_host_group( host_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DedicatedHostListResult"] + # type: (...) -> Iterable["_models.DedicatedHostListResult"] """Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. @@ -498,7 +519,7 @@ def list_by_host_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.DedicatedHostListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DedicatedHostListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHostListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_images_operations.py index dd4e0dd1c34e..07829cdfb222 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_images_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class ImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.Image" + parameters, # type: "_models.Image" **kwargs # type: Any ): - # type: (...) -> "models.Image" - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + # type: (...) -> "_models.Image" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.Image" + parameters, # type: "_models.Image" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Image"] + # type: (...) -> LROPoller["_models.Image"] """Create or update an image. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -175,11 +181,11 @@ def _update_initial( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.ImageUpdate" + parameters, # type: "_models.ImageUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Image" - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + # type: (...) -> "_models.Image" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -233,10 +239,10 @@ def begin_update( self, resource_group_name, # type: str image_name, # type: str - parameters, # type: "models.ImageUpdate" + parameters, # type: "_models.ImageUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Image"] + # type: (...) -> LROPoller["_models.Image"] """Update an image. :param resource_group_name: The name of the resource group. @@ -256,7 +262,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -281,7 +287,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -383,7 +395,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -404,7 +422,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.Image" + # type: (...) -> "_models.Image" """Gets an image. :param resource_group_name: The name of the resource group. @@ -418,7 +436,7 @@ def get( :rtype: ~azure.mgmt.compute.v2020_06_01.models.Image :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Image"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Image"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -466,7 +484,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ImageListResult"] + # type: (...) -> Iterable["_models.ImageListResult"] """Gets the list of images under a resource group. :param resource_group_name: The name of the resource group. @@ -476,7 +494,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -536,7 +554,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ImageListResult"] + # type: (...) -> Iterable["_models.ImageListResult"] """Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images. @@ -545,7 +563,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.ImageListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ImageListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImageListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_log_analytics_operations.py index 7ffe9ff1cb31..9cef1c81d615 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_log_analytics_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class LogAnalyticsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,11 +49,11 @@ def __init__(self, client, config, serializer, deserializer): def _export_request_rate_by_interval_initial( self, location, # type: str - parameters, # type: "models.RequestRateByIntervalInput" + parameters, # type: "_models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> Optional["models.LogAnalyticsOperationResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + # type: (...) -> Optional["_models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -103,10 +103,10 @@ def _export_request_rate_by_interval_initial( def begin_export_request_rate_by_interval( self, location, # type: str - parameters, # type: "models.RequestRateByIntervalInput" + parameters, # type: "_models.RequestRateByIntervalInput" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] + # type: (...) -> LROPoller["_models.LogAnalyticsOperationResult"] """Export logs that show Api requests made by this subscription in the given time window to show throttling activities. @@ -125,7 +125,7 @@ def begin_export_request_rate_by_interval( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -149,7 +149,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -166,11 +171,11 @@ def get_long_running_output(pipeline_response): def _export_throttled_requests_initial( self, location, # type: str - parameters, # type: "models.LogAnalyticsInputBase" + parameters, # type: "_models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> Optional["models.LogAnalyticsOperationResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.LogAnalyticsOperationResult"]] + # type: (...) -> Optional["_models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogAnalyticsOperationResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -220,10 +225,10 @@ def _export_throttled_requests_initial( def begin_export_throttled_requests( self, location, # type: str - parameters, # type: "models.LogAnalyticsInputBase" + parameters, # type: "_models.LogAnalyticsInputBase" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.LogAnalyticsOperationResult"] + # type: (...) -> LROPoller["_models.LogAnalyticsOperationResult"] """Export logs that show total throttled Api requests for this subscription in the given time window. @@ -242,7 +247,7 @@ def begin_export_throttled_requests( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.LogAnalyticsOperationResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsOperationResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -266,7 +271,12 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_operations.py index 44bff37857c6..9c78af266ec3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class Operations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ComputeOperationListResult"] + # type: (...) -> Iterable["_models.ComputeOperationListResult"] """Gets a list of compute operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -57,7 +57,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.ComputeOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ComputeOperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ComputeOperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_proximity_placement_groups_operations.py index 8e71ef581a63..f68dbc57fca8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_proximity_placement_groups_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class ProximityPlacementGroupsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,10 +49,10 @@ def create_or_update( self, resource_group_name, # type: str proximity_placement_group_name, # type: str - parameters, # type: "models.ProximityPlacementGroup" + parameters, # type: "_models.ProximityPlacementGroup" **kwargs # type: Any ): - # type: (...) -> "models.ProximityPlacementGroup" + # type: (...) -> "_models.ProximityPlacementGroup" """Create or update a proximity placement group. :param resource_group_name: The name of the resource group. @@ -66,7 +66,7 @@ def create_or_update( :rtype: ~azure.mgmt.compute.v2020_06_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -120,10 +120,10 @@ def update( self, resource_group_name, # type: str proximity_placement_group_name, # type: str - parameters, # type: "models.UpdateResource" + parameters, # type: "_models.UpdateResource" **kwargs # type: Any ): - # type: (...) -> "models.ProximityPlacementGroup" + # type: (...) -> "_models.ProximityPlacementGroup" """Update a proximity placement group. :param resource_group_name: The name of the resource group. @@ -137,7 +137,7 @@ def update( :rtype: ~azure.mgmt.compute.v2020_06_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -244,7 +244,7 @@ def get( include_colocation_status=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.ProximityPlacementGroup" + # type: (...) -> "_models.ProximityPlacementGroup" """Retrieves information about a proximity placement group . :param resource_group_name: The name of the resource group. @@ -259,7 +259,7 @@ def get( :rtype: ~azure.mgmt.compute.v2020_06_01.models.ProximityPlacementGroup :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroup"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroup"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -306,7 +306,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProximityPlacementGroupListResult"] + # type: (...) -> Iterable["_models.ProximityPlacementGroupListResult"] """Lists all proximity placement groups in a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -314,7 +314,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.ProximityPlacementGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -374,7 +374,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ProximityPlacementGroupListResult"] + # type: (...) -> Iterable["_models.ProximityPlacementGroupListResult"] """Lists all proximity placement groups in a resource group. :param resource_group_name: The name of the resource group. @@ -384,7 +384,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.ProximityPlacementGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ProximityPlacementGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProximityPlacementGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_ssh_public_keys_operations.py index 180952c99c94..85bd6bffcb51 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_ssh_public_keys_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class SshPublicKeysOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.SshPublicKeysGroupListResult"] + # type: (...) -> Iterable["_models.SshPublicKeysGroupListResult"] """Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys. @@ -58,7 +58,7 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.SshPublicKeysGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeysGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SshPublicKeysGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -118,7 +118,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SshPublicKeysGroupListResult"] + # type: (...) -> Iterable["_models.SshPublicKeysGroupListResult"] """Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys. @@ -129,7 +129,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.SshPublicKeysGroupListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeysGroupListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SshPublicKeysGroupListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -189,10 +189,10 @@ def create( self, resource_group_name, # type: str ssh_public_key_name, # type: str - parameters, # type: "models.SshPublicKeyResource" + parameters, # type: "_models.SshPublicKeyResource" **kwargs # type: Any ): - # type: (...) -> "models.SshPublicKeyResource" + # type: (...) -> "_models.SshPublicKeyResource" """Creates a new SSH public key resource. :param resource_group_name: The name of the resource group. @@ -206,7 +206,7 @@ def create( :rtype: ~azure.mgmt.compute.v2020_06_01.models.SshPublicKeyResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SshPublicKeyResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -260,10 +260,10 @@ def update( self, resource_group_name, # type: str ssh_public_key_name, # type: str - parameters, # type: "models.SshPublicKeyUpdateResource" + parameters, # type: "_models.SshPublicKeyUpdateResource" **kwargs # type: Any ): - # type: (...) -> "models.SshPublicKeyResource" + # type: (...) -> "_models.SshPublicKeyResource" """Updates a new SSH public key resource. :param resource_group_name: The name of the resource group. @@ -277,7 +277,7 @@ def update( :rtype: ~azure.mgmt.compute.v2020_06_01.models.SshPublicKeyResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SshPublicKeyResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -383,7 +383,7 @@ def get( ssh_public_key_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SshPublicKeyResource" + # type: (...) -> "_models.SshPublicKeyResource" """Retrieves information about an SSH public key. :param resource_group_name: The name of the resource group. @@ -395,7 +395,7 @@ def get( :rtype: ~azure.mgmt.compute.v2020_06_01.models.SshPublicKeyResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SshPublicKeyResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -442,7 +442,7 @@ def generate_key_pair( ssh_public_key_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.SshPublicKeyGenerateKeyPairResult" + # type: (...) -> "_models.SshPublicKeyGenerateKeyPairResult" """Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. @@ -456,7 +456,7 @@ def generate_key_pair( :rtype: ~azure.mgmt.compute.v2020_06_01.models.SshPublicKeyGenerateKeyPairResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SshPublicKeyGenerateKeyPairResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SshPublicKeyGenerateKeyPairResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_usage_operations.py index 4c7e6beba9e9..968d695d7f5c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_usage_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class UsageOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ListUsagesResult"] + # type: (...) -> Iterable["_models.ListUsagesResult"] """Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.ListUsagesResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ListUsagesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListUsagesResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extension_images_operations.py index acccd3ea823e..e9aed02e09f5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extension_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VirtualMachineExtensionImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def get( version, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtensionImage" + # type: (...) -> "_models.VirtualMachineExtensionImage" """Gets a virtual machine extension image. :param location: The name of a supported Azure region. @@ -68,7 +68,7 @@ def get( :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -117,7 +117,7 @@ def list_types( publisher_name, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineExtensionImage"] + # type: (...) -> List["_models.VirtualMachineExtensionImage"] """Gets a list of virtual machine extension image types. :param location: The name of a supported Azure region. @@ -129,7 +129,7 @@ def list_types( :rtype: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -180,7 +180,7 @@ def list_versions( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineExtensionImage"] + # type: (...) -> List["_models.VirtualMachineExtensionImage"] """Gets a list of virtual machine extension image versions. :param location: The name of a supported Azure region. @@ -200,7 +200,7 @@ def list_versions( :rtype: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionImage] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineExtensionImage"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineExtensionImage"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extensions_operations.py index cea48dfdc574..16ba3bf5c6b8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VirtualMachineExtensionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -111,10 +111,10 @@ def begin_create_or_update( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineExtension"] """The operation to create or update the extension. :param resource_group_name: The name of the resource group. @@ -138,7 +138,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -164,7 +164,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -183,11 +190,11 @@ def _update_initial( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -239,10 +246,10 @@ def begin_update( resource_group_name, # type: str vm_name, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineExtension"] """The operation to update the extension. :param resource_group_name: The name of the resource group. @@ -265,7 +272,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -291,7 +298,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -399,7 +413,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -421,7 +442,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" + # type: (...) -> "_models.VirtualMachineExtension" """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -437,7 +458,7 @@ def get( :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -488,7 +509,7 @@ def list( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtensionsListResult" + # type: (...) -> "_models.VirtualMachineExtensionsListResult" """The operation to get all extensions of a Virtual Machine. :param resource_group_name: The name of the resource group. @@ -502,7 +523,7 @@ def list( :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineExtensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_images_operations.py index 1c31c270461e..751c14ad1eaa 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_images_operations.py @@ -13,7 +13,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -36,7 +36,7 @@ class VirtualMachineImagesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +53,7 @@ def get( version, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineImage" + # type: (...) -> "_models.VirtualMachineImage" """Gets a virtual machine image. :param location: The name of a supported Azure region. @@ -71,7 +71,7 @@ def get( :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineImage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineImage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineImage"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -126,7 +126,7 @@ def list( orderby=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. @@ -149,7 +149,7 @@ def list( :rtype: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -204,7 +204,7 @@ def list_offers( publisher_name, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image offers for the specified location and publisher. :param location: The name of a supported Azure region. @@ -216,7 +216,7 @@ def list_offers( :rtype: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -262,7 +262,7 @@ def list_publishers( location, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image publishers for the specified Azure location. :param location: The name of a supported Azure region. @@ -272,7 +272,7 @@ def list_publishers( :rtype: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -319,7 +319,7 @@ def list_skus( offer, # type: str **kwargs # type: Any ): - # type: (...) -> List["models.VirtualMachineImageResource"] + # type: (...) -> List["_models.VirtualMachineImageResource"] """Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. :param location: The name of a supported Azure region. @@ -333,7 +333,7 @@ def list_skus( :rtype: list[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineImageResource] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[List["models.VirtualMachineImageResource"]] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VirtualMachineImageResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_run_commands_operations.py index 8acf5a168394..c05ef7b0771b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_run_commands_operations.py @@ -12,13 +12,15 @@ 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 +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + 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]] @@ -37,7 +39,7 @@ class VirtualMachineRunCommandsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +52,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.RunCommandListResult"] + # type: (...) -> Iterable["_models.RunCommandListResult"] """Lists all available run commands for a subscription in a location. :param location: The location upon which run commands is queried. @@ -60,7 +62,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.RunCommandListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,7 +124,7 @@ def get( command_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RunCommandDocument" + # type: (...) -> "_models.RunCommandDocument" """Gets specific run command for a subscription in a location. :param location: The location upon which run commands is queried. @@ -134,7 +136,7 @@ def get( :rtype: ~azure.mgmt.compute.v2020_06_01.models.RunCommandDocument :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandDocument"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandDocument"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -174,3 +176,539 @@ def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + vm_name, # type: str + run_command_name, # type: str + run_command, # type: "_models.VirtualMachineRunCommand" + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualMachineRunCommand" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + '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') + + # 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(run_command, 'VirtualMachineRunCommand') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualMachineRunCommand', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + vm_name, # type: str + run_command_name, # type: str + run_command, # type: "_models.VirtualMachineRunCommand" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualMachineRunCommand"] + """The operation to create or update the run command. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine where the run command should be created or + updated. + :type vm_name: str + :param run_command_name: The name of the virtual machine run command. + :type run_command_name: str + :param run_command: Parameters supplied to the Create Virtual Machine RunCommand operation. + :type run_command: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommand + :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: True for ARMPolling, False for no polling, or a + polling object for 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 VirtualMachineRunCommand or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + 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, + vm_name=vm_name, + run_command_name=run_command_name, + run_command=run_command, + 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('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + vm_name, # type: str + run_command_name, # type: str + run_command, # type: "_models.VirtualMachineRunCommandUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualMachineRunCommand" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + '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') + + # 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(run_command, 'VirtualMachineRunCommandUpdate') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + vm_name, # type: str + run_command_name, # type: str + run_command, # type: "_models.VirtualMachineRunCommandUpdate" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualMachineRunCommand"] + """The operation to update the run command. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine where the run command should be updated. + :type vm_name: str + :param run_command_name: The name of the virtual machine run command. + :type run_command_name: str + :param run_command: Parameters supplied to the Update Virtual Machine RunCommand operation. + :type run_command: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommandUpdate + :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: True for ARMPolling, False for no polling, or a + polling object for 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 VirtualMachineRunCommand or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + 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, + vm_name=vm_name, + run_command_name=run_command_name, + run_command=run_command, + 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('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + vm_name, # type: str + run_command_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-06-01" + accept = "application/json, text/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + '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') + + # 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + vm_name, # type: str + run_command_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """The operation to delete the run command. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine where the run command should be deleted. + :type vm_name: str + :param run_command_name: The name of the virtual machine run command. + :type run_command_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: True for ARMPolling, False for no polling, or a + polling object for 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, + vm_name=vm_name, + run_command_name=run_command_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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}'} # type: ignore + + def get_by_virtual_machine( + self, + resource_group_name, # type: str + vm_name, # type: str + run_command_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualMachineRunCommand" + """The operation to get the run command. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine containing the run command. + :type vm_name: str + :param run_command_name: The name of the virtual machine run command. + :type run_command_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: VirtualMachineRunCommand, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommand + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json, text/json" + + # Construct URL + url = self.get_by_virtual_machine.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_virtual_machine.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}'} # type: ignore + + def list_by_virtual_machine( + self, + resource_group_name, # type: str + vm_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.VirtualMachineRunCommandsListResult"] + """The operation to get all run commands of a Virtual Machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine containing the run command. + :type vm_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 VirtualMachineRunCommandsListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommandsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommandsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json, text/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_virtual_machine.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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('VirtualMachineRunCommandsListResult', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_virtual_machine.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_extensions_operations.py index 5e0ada43ed90..fa6a236b9271 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetExtensionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( resource_group_name, # type: str vm_scale_set_name, # type: str vmss_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineScaleSetExtension" + extension_parameters, # type: "_models.VirtualMachineScaleSetExtension" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + # type: (...) -> "_models.VirtualMachineScaleSetExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -112,10 +112,10 @@ def begin_create_or_update( resource_group_name, # type: str vm_scale_set_name, # type: str vmss_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineScaleSetExtension" + extension_parameters, # type: "_models.VirtualMachineScaleSetExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSetExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSetExtension"] """The operation to create or update an extension. :param resource_group_name: The name of the resource group. @@ -139,7 +139,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -165,7 +165,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -184,11 +191,11 @@ def _update_initial( resource_group_name, # type: str vm_scale_set_name, # type: str vmss_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineScaleSetExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineScaleSetExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + # type: (...) -> "_models.VirtualMachineScaleSetExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -244,10 +251,10 @@ def begin_update( resource_group_name, # type: str vm_scale_set_name, # type: str vmss_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineScaleSetExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineScaleSetExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSetExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSetExtension"] """The operation to update an extension. :param resource_group_name: The name of the resource group. @@ -270,7 +277,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -296,7 +303,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -404,7 +418,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'vmssExtensionName': self._serialize.url("vmss_extension_name", vmss_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -426,7 +447,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetExtension" + # type: (...) -> "_models.VirtualMachineScaleSetExtension" """The operation to get the extension. :param resource_group_name: The name of the resource group. @@ -442,7 +463,7 @@ def get( :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -492,7 +513,7 @@ def list( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetExtensionListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetExtensionListResult"] """Gets a list of all extensions in a VM scale set. :param resource_group_name: The name of the resource group. @@ -504,7 +525,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetExtensionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetExtensionListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetExtensionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 61d959420bc8..5b2246e12adc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VirtualMachineScaleSetRollingUpgradesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -134,7 +134,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -238,7 +244,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -342,7 +354,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -362,7 +380,7 @@ def get_latest( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.RollingUpgradeStatusInfo" + # type: (...) -> "_models.RollingUpgradeStatusInfo" """Gets the status of the latest virtual machine scale set rolling upgrade. :param resource_group_name: The name of the resource group. @@ -374,7 +392,7 @@ def get_latest( :rtype: ~azure.mgmt.compute.v2020_06_01.models.RollingUpgradeStatusInfo :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RollingUpgradeStatusInfo"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RollingUpgradeStatusInfo"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 289855936133..f9c70fc7c75c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -15,7 +15,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,7 +38,7 @@ class VirtualMachineScaleSetVMExtensionsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,11 +52,11 @@ def _create_or_update_initial( vm_scale_set_name, # type: str instance_id, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineScaleSetVMExtension" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineScaleSetVMExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -86,7 +86,7 @@ def _create_or_update_initial( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension') + body_content = self._serialize.body(extension_parameters, 'VirtualMachineScaleSetVMExtension') 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) @@ -97,10 +97,10 @@ def _create_or_update_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('VirtualMachineExtension', pipeline_response) + deserialized = self._deserialize('VirtualMachineScaleSetVMExtension', pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('VirtualMachineExtension', pipeline_response) + deserialized = self._deserialize('VirtualMachineScaleSetVMExtension', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -114,10 +114,10 @@ def begin_create_or_update( vm_scale_set_name, # type: str instance_id, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtension" + extension_parameters, # type: "_models.VirtualMachineScaleSetVMExtension" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSetVMExtension"] """The operation to create or update the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -130,19 +130,19 @@ def begin_create_or_update( :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Create Virtual Machine Extension operation. - :type extension_parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension + :type extension_parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMExtension :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: True for ARMPolling, False for no polling, or a polling object for 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 VirtualMachineExtension or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension] + :return: An instance of LROPoller that returns either VirtualMachineScaleSetVMExtension or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -163,13 +163,21 @@ def begin_create_or_update( kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('VirtualMachineExtension', pipeline_response) + deserialized = self._deserialize('VirtualMachineScaleSetVMExtension', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -189,11 +197,11 @@ def _update_initial( vm_scale_set_name, # type: str instance_id, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineScaleSetVMExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + # type: (...) -> "_models.VirtualMachineScaleSetVMExtension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -223,7 +231,7 @@ def _update_initial( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate') + body_content = self._serialize.body(extension_parameters, 'VirtualMachineScaleSetVMExtensionUpdate') 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) @@ -233,7 +241,7 @@ def _update_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('VirtualMachineExtension', pipeline_response) + deserialized = self._deserialize('VirtualMachineScaleSetVMExtension', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -247,10 +255,10 @@ def begin_update( vm_scale_set_name, # type: str instance_id, # type: str vm_extension_name, # type: str - extension_parameters, # type: "models.VirtualMachineExtensionUpdate" + extension_parameters, # type: "_models.VirtualMachineScaleSetVMExtensionUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineExtension"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSetVMExtension"] """The operation to update the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -263,19 +271,19 @@ def begin_update( :type vm_extension_name: str :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension operation. - :type extension_parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionUpdate + :type extension_parameters: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMExtensionUpdate :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: True for ARMPolling, False for no polling, or a polling object for 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 VirtualMachineExtension or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension] + :return: An instance of LROPoller that returns either VirtualMachineScaleSetVMExtension or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMExtension] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMExtension"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -296,13 +304,21 @@ def begin_update( kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('VirtualMachineExtension', pipeline_response) + deserialized = self._deserialize('VirtualMachineScaleSetVMExtension', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -418,7 +434,15 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'vmExtensionName': self._serialize.url("vm_extension_name", vm_extension_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -441,7 +465,7 @@ def get( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtension" + # type: (...) -> "_models.VirtualMachineScaleSetVMExtension" """The operation to get the VMSS VM extension. :param resource_group_name: The name of the resource group. @@ -455,11 +479,11 @@ def get( :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: VirtualMachineExtension, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtension + :return: VirtualMachineScaleSetVMExtension, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMExtension :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtension"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMExtension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -496,7 +520,7 @@ def get( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('VirtualMachineExtension', pipeline_response) + deserialized = self._deserialize('VirtualMachineScaleSetVMExtension', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -512,7 +536,7 @@ def list( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineExtensionsListResult" + # type: (...) -> "_models.VirtualMachineScaleSetVMExtensionsListResult" """The operation to get all extensions of an instance in Virtual Machine Scaleset. :param resource_group_name: The name of the resource group. @@ -524,11 +548,11 @@ def list( :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: VirtualMachineExtensionsListResult, or the result of cls(response) - :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineExtensionsListResult + :return: VirtualMachineScaleSetVMExtensionsListResult, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMExtensionsListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineExtensionsListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMExtensionsListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -564,7 +588,7 @@ def list( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('VirtualMachineExtensionsListResult', pipeline_response) + deserialized = self._deserialize('VirtualMachineScaleSetVMExtensionsListResult', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py new file mode 100644 index 000000000000..cce7b238e1e9 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -0,0 +1,612 @@ +# 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 VirtualMachineScaleSetVMRunCommandsOperations(object): + """VirtualMachineScaleSetVMRunCommandsOperations 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.mgmt.compute.v2020_06_01.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 + vm_scale_set_name, # type: str + instance_id, # type: str + run_command_name, # type: str + run_command, # type: "_models.VirtualMachineRunCommand" + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualMachineRunCommand" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + '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') + + # 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(run_command, 'VirtualMachineRunCommand') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VirtualMachineRunCommand', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + run_command_name, # type: str + run_command, # type: "_models.VirtualMachineRunCommand" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualMachineRunCommand"] + """The operation to create or update the VMSS VM run command. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param run_command_name: The name of the virtual machine run command. + :type run_command_name: str + :param run_command: Parameters supplied to the Create Virtual Machine RunCommand operation. + :type run_command: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommand + :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: True for ARMPolling, False for no polling, or a + polling object for 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 VirtualMachineRunCommand or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + 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, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + run_command_name=run_command_name, + run_command=run_command, + 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('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + run_command_name, # type: str + run_command, # type: "_models.VirtualMachineRunCommandUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualMachineRunCommand" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json, text/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + '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') + + # 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(run_command, 'VirtualMachineRunCommandUpdate') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + run_command_name, # type: str + run_command, # type: "_models.VirtualMachineRunCommandUpdate" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VirtualMachineRunCommand"] + """The operation to update the VMSS VM run command. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param run_command_name: The name of the virtual machine run command. + :type run_command_name: str + :param run_command: Parameters supplied to the Update Virtual Machine RunCommand operation. + :type run_command: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommandUpdate + :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: True for ARMPolling, False for no polling, or a + polling object for 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 VirtualMachineRunCommand or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommand] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + 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, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + run_command_name=run_command_name, + run_command=run_command, + 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('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + run_command_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-06-01" + accept = "application/json, text/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + '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') + + # 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + run_command_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """The operation to delete the VMSS VM run command. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param run_command_name: The name of the virtual machine run command. + :type run_command_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: True for ARMPolling, False for no polling, or a + polling object for 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, + vm_scale_set_name=vm_scale_set_name, + instance_id=instance_id, + run_command_name=run_command_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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + run_command_name, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.VirtualMachineRunCommand" + """The operation to get the VMSS VM run command. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: str + :param run_command_name: The name of the virtual machine run command. + :type run_command_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: VirtualMachineRunCommand, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommand + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommand"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json, text/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'runCommandName': self._serialize.url("run_command_name", run_command_name, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VirtualMachineRunCommand', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + vm_scale_set_name, # type: str + instance_id, # type: str + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.VirtualMachineRunCommandsListResult"] + """The operation to get all run commands of an instance in Virtual Machine Scaleset. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_scale_set_name: The name of the VM scale set. + :type vm_scale_set_name: str + :param instance_id: The instance ID of the virtual machine. + :type instance_id: 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 VirtualMachineRunCommandsListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineRunCommandsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineRunCommandsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-06-01" + accept = "application/json, text/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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + '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] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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('VirtualMachineRunCommandsListResult', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vms_operations.py index 6ec84f5d9ab2..7b20b5d99822 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetVMsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def _reimage_initial( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - vm_scale_set_vm_reimage_input=None, # type: Optional["models.VirtualMachineReimageParameters"] + vm_scale_set_vm_reimage_input=None, # type: Optional["_models.VirtualMachineReimageParameters"] **kwargs # type: Any ): # type: (...) -> None @@ -106,7 +106,7 @@ def begin_reimage( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - vm_scale_set_vm_reimage_input=None, # type: Optional["models.VirtualMachineReimageParameters"] + vm_scale_set_vm_reimage_input=None, # type: Optional["_models.VirtualMachineReimageParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -154,7 +154,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -263,7 +270,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -373,7 +387,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -392,11 +413,11 @@ def _update_initial( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.VirtualMachineScaleSetVM" + parameters, # type: "_models.VirtualMachineScaleSetVM" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVM" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + # type: (...) -> "_models.VirtualMachineScaleSetVM" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -452,10 +473,10 @@ def begin_update( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.VirtualMachineScaleSetVM" + parameters, # type: "_models.VirtualMachineScaleSetVM" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSetVM"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSetVM"] """Updates a virtual machine of a VM scale set. :param resource_group_name: The name of the resource group. @@ -478,7 +499,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -504,7 +525,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -612,7 +640,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -634,7 +669,7 @@ def get( expand="instanceView", # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVM" + # type: (...) -> "_models.VirtualMachineScaleSetVM" """Gets a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -650,7 +685,7 @@ def get( :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVM :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVM"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVM"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -701,7 +736,7 @@ def get_instance_view( instance_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetVMInstanceView" + # type: (...) -> "_models.VirtualMachineScaleSetVMInstanceView" """Gets the status of a virtual machine from a VM scale set. :param resource_group_name: The name of the resource group. @@ -715,7 +750,7 @@ def get_instance_view( :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -766,7 +801,7 @@ def list( expand=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetVMListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetVMListResult"] """Gets a list of all virtual machines in a VM scale sets. :param resource_group_name: The name of the resource group. @@ -787,7 +822,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetVMListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetVMListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetVMListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -955,7 +990,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1063,7 +1105,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1171,7 +1220,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1280,7 +1336,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1302,7 +1365,7 @@ def retrieve_boot_diagnostics_data( sas_uri_expiration_time_in_minutes=None, # type: Optional[int] **kwargs # type: Any ): - # type: (...) -> "models.RetrieveBootDiagnosticsDataResult" + # type: (...) -> "_models.RetrieveBootDiagnosticsDataResult" """The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. @@ -1321,7 +1384,7 @@ def retrieve_boot_diagnostics_data( :rtype: ~azure.mgmt.compute.v2020_06_01.models.RetrieveBootDiagnosticsDataResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RetrieveBootDiagnosticsDataResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RetrieveBootDiagnosticsDataResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1459,7 +1522,14 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1536,11 +1606,11 @@ def _run_command_initial( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> Optional["models.RunCommandResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + # type: (...) -> Optional["_models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1594,10 +1664,10 @@ def begin_run_command( resource_group_name, # type: str vm_scale_set_name, # type: str instance_id, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RunCommandResult"] + # type: (...) -> LROPoller["_models.RunCommandResult"] """Run command on a virtual machine in a VM scale set. :param resource_group_name: The name of the resource group. @@ -1619,7 +1689,7 @@ def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -1645,7 +1715,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_sets_operations.py index 78de6880d145..bcdecf6d47ee 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachineScaleSetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSet" + parameters, # type: "_models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + # type: (...) -> "_models.VirtualMachineScaleSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSet" + parameters, # type: "_models.VirtualMachineScaleSet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSet"] """Create or update a VM scale set. :param resource_group_name: The name of the resource group. @@ -132,7 +132,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -157,7 +157,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -175,11 +181,11 @@ def _update_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSetUpdate" + parameters, # type: "_models.VirtualMachineScaleSetUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + # type: (...) -> "_models.VirtualMachineScaleSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -229,10 +235,10 @@ def begin_update( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VirtualMachineScaleSetUpdate" + parameters, # type: "_models.VirtualMachineScaleSetUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineScaleSet"] + # type: (...) -> LROPoller["_models.VirtualMachineScaleSet"] """Update a VM scale set. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -379,7 +391,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -399,7 +417,7 @@ def get( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSet" + # type: (...) -> "_models.VirtualMachineScaleSet" """Display information about a virtual machine scale set. :param resource_group_name: The name of the resource group. @@ -411,7 +429,7 @@ def get( :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -456,7 +474,7 @@ def _deallocate_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -508,7 +526,7 @@ def begin_deallocate( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -555,7 +573,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -573,7 +597,7 @@ def _delete_instances_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): # type: (...) -> None @@ -622,7 +646,7 @@ def begin_delete_instances( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -667,7 +691,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -687,7 +717,7 @@ def get_instance_view( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineScaleSetInstanceView" + # type: (...) -> "_models.VirtualMachineScaleSetInstanceView" """Gets the status of a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -699,7 +729,7 @@ def get_instance_view( :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -745,7 +775,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListResult"] """Gets a list of all VM scale sets under a resource group. :param resource_group_name: The name of the resource group. @@ -755,7 +785,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -815,7 +845,7 @@ def list_all( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListWithLinkResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListWithLinkResult"] """Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets. @@ -825,7 +855,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetListWithLinkResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListWithLinkResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListWithLinkResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -886,7 +916,7 @@ def list_skus( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListSkusResult"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListSkusResult"] """Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. @@ -899,7 +929,7 @@ def list_skus( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetListSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListSkusResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -962,7 +992,7 @@ def get_os_upgrade_history( vm_scale_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineScaleSetListOSUpgradeHistory"] + # type: (...) -> Iterable["_models.VirtualMachineScaleSetListOSUpgradeHistory"] """Gets list of OS upgrades on a VM scale set instance. :param resource_group_name: The name of the resource group. @@ -974,7 +1004,7 @@ def get_os_upgrade_history( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineScaleSetListOSUpgradeHistory] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineScaleSetListOSUpgradeHistory"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineScaleSetListOSUpgradeHistory"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1036,7 +1066,7 @@ def _power_off_initial( resource_group_name, # type: str vm_scale_set_name, # type: str skip_shutdown=False, # type: Optional[bool] - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1091,7 +1121,7 @@ def begin_power_off( resource_group_name, # type: str vm_scale_set_name, # type: str skip_shutdown=False, # type: Optional[bool] - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1143,7 +1173,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1161,7 +1197,7 @@ def _restart_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1213,7 +1249,7 @@ def begin_restart( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1258,7 +1294,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1276,7 +1318,7 @@ def _start_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1328,7 +1370,7 @@ def begin_start( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1373,7 +1415,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1391,7 +1439,7 @@ def _redeploy_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1443,7 +1491,7 @@ def begin_redeploy( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1489,7 +1537,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1507,7 +1561,7 @@ def _perform_maintenance_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1559,7 +1613,7 @@ def begin_perform_maintenance( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1607,7 +1661,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1625,7 +1685,7 @@ def _update_instances_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): # type: (...) -> None @@ -1674,7 +1734,7 @@ def begin_update_instances( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds, # type: "models.VirtualMachineScaleSetVMInstanceRequiredIDs" + vm_instance_i_ds, # type: "_models.VirtualMachineScaleSetVMInstanceRequiredIDs" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1719,7 +1779,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1737,7 +1803,7 @@ def _reimage_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_scale_set_reimage_input=None, # type: Optional["models.VirtualMachineScaleSetReimageParameters"] + vm_scale_set_reimage_input=None, # type: Optional["_models.VirtualMachineScaleSetReimageParameters"] **kwargs # type: Any ): # type: (...) -> None @@ -1789,7 +1855,7 @@ def begin_reimage( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_scale_set_reimage_input=None, # type: Optional["models.VirtualMachineScaleSetReimageParameters"] + vm_scale_set_reimage_input=None, # type: Optional["_models.VirtualMachineScaleSetReimageParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1836,7 +1902,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1854,7 +1926,7 @@ def _reimage_all_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> None @@ -1906,7 +1978,7 @@ def begin_reimage_all( self, resource_group_name, # type: str vm_scale_set_name, # type: str - vm_instance_i_ds=None, # type: Optional["models.VirtualMachineScaleSetVMInstanceIDs"] + vm_instance_i_ds=None, # type: Optional["_models.VirtualMachineScaleSetVMInstanceIDs"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1952,7 +2024,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1973,7 +2051,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( platform_update_domain, # type: int **kwargs # type: Any ): - # type: (...) -> "models.RecoveryWalkResponse" + # type: (...) -> "_models.RecoveryWalkResponse" """Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. @@ -1989,7 +2067,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( :rtype: ~azure.mgmt.compute.v2020_06_01.models.RecoveryWalkResponse :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RecoveryWalkResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryWalkResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2035,7 +2113,7 @@ def convert_to_single_placement_group( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.VMScaleSetConvertToSinglePlacementGroupInput" + parameters, # type: "_models.VMScaleSetConvertToSinglePlacementGroupInput" **kwargs # type: Any ): # type: (...) -> None @@ -2097,7 +2175,7 @@ def _set_orchestration_service_state_initial( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.OrchestrationServiceStateInput" + parameters, # type: "_models.OrchestrationServiceStateInput" **kwargs # type: Any ): # type: (...) -> None @@ -2146,7 +2224,7 @@ def begin_set_orchestration_service_state( self, resource_group_name, # type: str vm_scale_set_name, # type: str - parameters, # type: "models.OrchestrationServiceStateInput" + parameters, # type: "_models.OrchestrationServiceStateInput" **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -2191,7 +2269,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_sizes_operations.py index d3b9315e39a5..c3875479bc03 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_sizes_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class VirtualMachineSizesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -50,7 +50,7 @@ def list( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """This API is deprecated. Use `Resources Skus `_. @@ -61,7 +61,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machines_operations.py index 039e0a4b0939..e9d4968ec53d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machines_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class VirtualMachinesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -52,7 +52,7 @@ def list_by_location( location, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Gets all the virtual machines under the specified subscription for the specified location. :param location: The location for which virtual machines under the subscription are queried. @@ -62,7 +62,7 @@ def list_by_location( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -122,11 +122,11 @@ def _capture_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineCaptureParameters" + parameters, # type: "_models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualMachineCaptureResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineCaptureResult"]] + # type: (...) -> Optional["_models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualMachineCaptureResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -178,10 +178,10 @@ def begin_capture( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineCaptureParameters" + parameters, # type: "_models.VirtualMachineCaptureParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineCaptureResult"] + # type: (...) -> LROPoller["_models.VirtualMachineCaptureResult"] """Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. @@ -202,7 +202,7 @@ def begin_capture( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineCaptureResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineCaptureResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -227,7 +227,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -245,11 +251,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachine" + parameters, # type: "_models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + # type: (...) -> "_models.VirtualMachine" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -303,10 +309,10 @@ def begin_create_or_update( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachine" + parameters, # type: "_models.VirtualMachine" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachine"] + # type: (...) -> LROPoller["_models.VirtualMachine"] """The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. @@ -327,7 +333,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -352,7 +358,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -370,11 +382,11 @@ def _update_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineUpdate" + parameters, # type: "_models.VirtualMachineUpdate" **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + # type: (...) -> "_models.VirtualMachine" + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -428,10 +440,10 @@ def begin_update( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.VirtualMachineUpdate" + parameters, # type: "_models.VirtualMachineUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachine"] + # type: (...) -> LROPoller["_models.VirtualMachine"] """The operation to update a virtual machine. :param resource_group_name: The name of the resource group. @@ -451,7 +463,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -476,7 +488,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -494,6 +512,7 @@ def _delete_initial( self, resource_group_name, # type: str vm_name, # type: str + force_deletion=None, # type: Optional[bool] **kwargs # type: Any ): # type: (...) -> None @@ -515,6 +534,8 @@ def _delete_initial( # Construct parameters query_parameters = {} # type: Dict[str, Any] + if force_deletion is not None: + query_parameters['forceDeletion'] = self._serialize.query("force_deletion", force_deletion, 'bool') query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers @@ -537,6 +558,7 @@ def begin_delete( self, resource_group_name, # type: str vm_name, # type: str + force_deletion=None, # type: Optional[bool] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -546,6 +568,8 @@ def begin_delete( :type resource_group_name: str :param vm_name: The name of the virtual machine. :type vm_name: str + :param force_deletion: Optional parameter to force delete virtual machines. + :type force_deletion: 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: True for ARMPolling, False for no polling, or a @@ -567,6 +591,7 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, vm_name=vm_name, + force_deletion=force_deletion, cls=lambda x,y,z: x, **kwargs ) @@ -578,7 +603,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -599,7 +630,7 @@ def get( expand="instanceView", # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachine" + # type: (...) -> "_models.VirtualMachine" """Retrieves information about the model view or the instance view of a virtual machine. :param resource_group_name: The name of the resource group. @@ -613,7 +644,7 @@ def get( :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachine :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachine"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachine"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -662,7 +693,7 @@ def instance_view( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.VirtualMachineInstanceView" + # type: (...) -> "_models.VirtualMachineInstanceView" """Retrieves information about the run-time state of a virtual machine. :param resource_group_name: The name of the resource group. @@ -674,7 +705,7 @@ def instance_view( :rtype: ~azure.mgmt.compute.v2020_06_01.models.VirtualMachineInstanceView :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineInstanceView"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineInstanceView"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -804,7 +835,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -907,7 +944,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -985,7 +1028,7 @@ def list( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines. @@ -996,7 +1039,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1057,7 +1100,7 @@ def list_all( status_only=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineListResult"] + # type: (...) -> Iterable["_models.VirtualMachineListResult"] """Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. @@ -1069,7 +1112,7 @@ def list_all( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1132,7 +1175,7 @@ def list_available_sizes( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.VirtualMachineSizeListResult"] + # type: (...) -> Iterable["_models.VirtualMachineSizeListResult"] """Lists all available virtual machine sizes to which the specified virtual machine can be resized. @@ -1145,7 +1188,7 @@ def list_available_sizes( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_01.models.VirtualMachineSizeListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineSizeListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineSizeListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1300,7 +1343,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1404,7 +1453,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1506,7 +1561,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1608,7 +1669,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1710,7 +1777,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1728,7 +1801,7 @@ def _reimage_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters=None, # type: Optional["models.VirtualMachineReimageParameters"] + parameters=None, # type: Optional["_models.VirtualMachineReimageParameters"] **kwargs # type: Any ): # type: (...) -> None @@ -1780,7 +1853,7 @@ def begin_reimage( self, resource_group_name, # type: str vm_name, # type: str - parameters=None, # type: Optional["models.VirtualMachineReimageParameters"] + parameters=None, # type: Optional["_models.VirtualMachineReimageParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -1825,7 +1898,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -1846,7 +1925,7 @@ def retrieve_boot_diagnostics_data( sas_uri_expiration_time_in_minutes=None, # type: Optional[int] **kwargs # type: Any ): - # type: (...) -> "models.RetrieveBootDiagnosticsDataResult" + # type: (...) -> "_models.RetrieveBootDiagnosticsDataResult" """The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. :param resource_group_name: The name of the resource group. @@ -1862,7 +1941,7 @@ def retrieve_boot_diagnostics_data( :rtype: ~azure.mgmt.compute.v2020_06_01.models.RetrieveBootDiagnosticsDataResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.RetrieveBootDiagnosticsDataResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RetrieveBootDiagnosticsDataResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -1993,7 +2072,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -2067,8 +2152,8 @@ def _assess_patches_initial( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["models.VirtualMachineAssessPatchesResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.VirtualMachineAssessPatchesResult"]] + # type: (...) -> Optional["_models.VirtualMachineAssessPatchesResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualMachineAssessPatchesResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2117,7 +2202,7 @@ def begin_assess_patches( vm_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller["models.VirtualMachineAssessPatchesResult"] + # type: (...) -> LROPoller["_models.VirtualMachineAssessPatchesResult"] """Assess patches on the VM. :param resource_group_name: The name of the resource group. @@ -2135,7 +2220,7 @@ def begin_assess_patches( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.VirtualMachineAssessPatchesResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualMachineAssessPatchesResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2159,7 +2244,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2177,11 +2268,11 @@ def _run_command_initial( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> Optional["models.RunCommandResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.RunCommandResult"]] + # type: (...) -> Optional["_models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -2233,10 +2324,10 @@ def begin_run_command( self, resource_group_name, # type: str vm_name, # type: str - parameters, # type: "models.RunCommandInput" + parameters, # type: "_models.RunCommandInput" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.RunCommandResult"] + # type: (...) -> LROPoller["_models.RunCommandResult"] """Run command on the VM. :param resource_group_name: The name of the resource group. @@ -2256,7 +2347,7 @@ def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -2281,7 +2372,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_compute_management_client.py index 4fd16125d667..bba4e5b777ed 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_compute_management_client.py @@ -59,7 +59,6 @@ def __init__( 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.disks = DisksOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_metadata.json index e8b40122ed40..5a3d45cb2324 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_metadata.json @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", "docstring_type": "str", "required": true diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/_compute_management_client.py index 06ad146f3eb1..2223a7099bf8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/_compute_management_client.py @@ -56,7 +56,6 @@ def __init__( 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.disks = DisksOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_accesses_operations.py index a4069d42171b..6396e461b6da 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_accesses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DiskAccessesOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, disk_access_name: str, - disk_access: "models.DiskAccess", + disk_access: "_models.DiskAccess", **kwargs - ) -> "models.DiskAccess": - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskAccess"] + ) -> "_models.DiskAccess": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, disk_access_name: str, - disk_access: "models.DiskAccess", + disk_access: "_models.DiskAccess", **kwargs - ) -> AsyncLROPoller["models.DiskAccess"]: + ) -> AsyncLROPoller["_models.DiskAccess"]: """Creates or updates a disk access resource. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskAccess"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_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: @@ -171,10 +177,10 @@ async def _update_initial( self, resource_group_name: str, disk_access_name: str, - disk_access: "models.DiskAccessUpdate", + disk_access: "_models.DiskAccessUpdate", **kwargs - ) -> "models.DiskAccess": - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskAccess"] + ) -> "_models.DiskAccess": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,9 +234,9 @@ async def begin_update( self, resource_group_name: str, disk_access_name: str, - disk_access: "models.DiskAccessUpdate", + disk_access: "_models.DiskAccessUpdate", **kwargs - ) -> AsyncLROPoller["models.DiskAccess"]: + ) -> AsyncLROPoller["_models.DiskAccess"]: """Updates (patches) a disk access resource. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskAccess"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_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: @@ -296,7 +308,7 @@ async def get( resource_group_name: str, disk_access_name: str, **kwargs - ) -> "models.DiskAccess": + ) -> "_models.DiskAccess": """Gets information about a disk access resource. :param resource_group_name: The name of the resource group. @@ -310,7 +322,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2020_06_30.models.DiskAccess :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskAccess"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -441,7 +453,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_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: @@ -459,7 +477,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DiskAccessList"]: + ) -> AsyncIterable["_models.DiskAccessList"]: """Lists all the disk access resources under a resource group. :param resource_group_name: The name of the resource group. @@ -469,7 +487,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_30.models.DiskAccessList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskAccessList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccessList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -528,7 +546,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.DiskAccessList"]: + ) -> AsyncIterable["_models.DiskAccessList"]: """Lists all the disk access resources under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -536,7 +554,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_30.models.DiskAccessList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskAccessList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccessList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -596,7 +614,7 @@ async def get_private_link_resources( resource_group_name: str, disk_access_name: str, **kwargs - ) -> "models.PrivateLinkResourceListResult": + ) -> "_models.PrivateLinkResourceListResult": """Gets the private link resources possible under disk access resource. :param resource_group_name: The name of the resource group. @@ -610,7 +628,7 @@ async def get_private_link_resources( :rtype: ~azure.mgmt.compute.v2020_06_30.models.PrivateLinkResourceListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResourceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_encryption_sets_operations.py index 2addc1954dfc..d3e6651ad37a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_encryption_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DiskEncryptionSetsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, disk_encryption_set_name: str, - disk_encryption_set: "models.DiskEncryptionSet", + disk_encryption_set: "_models.DiskEncryptionSet", **kwargs - ) -> "models.DiskEncryptionSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + ) -> "_models.DiskEncryptionSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, disk_encryption_set_name: str, - disk_encryption_set: "models.DiskEncryptionSet", + disk_encryption_set: "_models.DiskEncryptionSet", **kwargs - ) -> AsyncLROPoller["models.DiskEncryptionSet"]: + ) -> AsyncLROPoller["_models.DiskEncryptionSet"]: """Creates or updates a disk encryption set. :param resource_group_name: The name of the resource group. @@ -129,7 +129,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -154,7 +154,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_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: @@ -172,10 +178,10 @@ async def _update_initial( self, resource_group_name: str, disk_encryption_set_name: str, - disk_encryption_set: "models.DiskEncryptionSetUpdate", + disk_encryption_set: "_models.DiskEncryptionSetUpdate", **kwargs - ) -> "models.DiskEncryptionSet": - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + ) -> "_models.DiskEncryptionSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -229,9 +235,9 @@ async def begin_update( self, resource_group_name: str, disk_encryption_set_name: str, - disk_encryption_set: "models.DiskEncryptionSetUpdate", + disk_encryption_set: "_models.DiskEncryptionSetUpdate", **kwargs - ) -> AsyncLROPoller["models.DiskEncryptionSet"]: + ) -> AsyncLROPoller["_models.DiskEncryptionSet"]: """Updates (patches) a disk encryption set. :param resource_group_name: The name of the resource group. @@ -254,7 +260,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -279,7 +285,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_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: @@ -298,7 +310,7 @@ async def get( resource_group_name: str, disk_encryption_set_name: str, **kwargs - ) -> "models.DiskEncryptionSet": + ) -> "_models.DiskEncryptionSet": """Gets information about a disk encryption set. :param resource_group_name: The name of the resource group. @@ -312,7 +324,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2020_06_30.models.DiskEncryptionSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -443,7 +455,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_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: @@ -461,7 +479,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DiskEncryptionSetList"]: + ) -> AsyncIterable["_models.DiskEncryptionSetList"]: """Lists all the disk encryption sets under a resource group. :param resource_group_name: The name of the resource group. @@ -471,7 +489,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_30.models.DiskEncryptionSetList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSetList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSetList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -530,7 +548,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.DiskEncryptionSetList"]: + ) -> AsyncIterable["_models.DiskEncryptionSetList"]: """Lists all the disk encryption sets under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -538,7 +556,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_30.models.DiskEncryptionSetList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSetList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSetList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -598,7 +616,7 @@ def list_associated_resources( resource_group_name: str, disk_encryption_set_name: str, **kwargs - ) -> AsyncIterable["models.ResourceUriList"]: + ) -> AsyncIterable["_models.ResourceUriList"]: """Lists all resources that are encrypted with this disk encryption set. :param resource_group_name: The name of the resource group. @@ -612,7 +630,7 @@ def list_associated_resources( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_30.models.ResourceUriList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceUriList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceUriList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disks_operations.py index 6b09dc2534cf..b1da6bb97c14 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class DisksOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, disk_name: str, - disk: "models.Disk", + disk: "_models.Disk", **kwargs - ) -> "models.Disk": - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + ) -> "_models.Disk": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, disk_name: str, - disk: "models.Disk", + disk: "_models.Disk", **kwargs - ) -> AsyncLROPoller["models.Disk"]: + ) -> AsyncLROPoller["_models.Disk"]: """Creates or updates a disk. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -171,10 +177,10 @@ async def _update_initial( self, resource_group_name: str, disk_name: str, - disk: "models.DiskUpdate", + disk: "_models.DiskUpdate", **kwargs - ) -> "models.Disk": - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + ) -> "_models.Disk": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,9 +234,9 @@ async def begin_update( self, resource_group_name: str, disk_name: str, - disk: "models.DiskUpdate", + disk: "_models.DiskUpdate", **kwargs - ) -> AsyncLROPoller["models.Disk"]: + ) -> AsyncLROPoller["_models.Disk"]: """Updates (patches) a disk. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -296,7 +308,7 @@ async def get( resource_group_name: str, disk_name: str, **kwargs - ) -> "models.Disk": + ) -> "_models.Disk": """Gets information about a disk. :param resource_group_name: The name of the resource group. @@ -310,7 +322,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2020_06_30.models.Disk :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -457,7 +475,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.DiskList"]: + ) -> AsyncIterable["_models.DiskList"]: """Lists all the disks under a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_30.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -526,7 +544,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.DiskList"]: + ) -> AsyncIterable["_models.DiskList"]: """Lists all the disks under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -534,7 +552,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_30.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -593,10 +611,10 @@ async def _grant_access_initial( self, resource_group_name: str, disk_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> Optional["models.AccessUri"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + ) -> Optional["_models.AccessUri"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -648,9 +666,9 @@ async def begin_grant_access( self, resource_group_name: str, disk_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> AsyncLROPoller["models.AccessUri"]: + ) -> AsyncLROPoller["_models.AccessUri"]: """Grants access to a disk. :param resource_group_name: The name of the resource group. @@ -673,7 +691,7 @@ async def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -698,7 +716,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -800,7 +824,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_snapshots_operations.py index cae8ec003a67..9a4463df0016 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_snapshots_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class SnapshotsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -47,10 +47,10 @@ async def _create_or_update_initial( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.Snapshot", + snapshot: "_models.Snapshot", **kwargs - ) -> "models.Snapshot": - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + ) -> "_models.Snapshot": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -104,9 +104,9 @@ async def begin_create_or_update( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.Snapshot", + snapshot: "_models.Snapshot", **kwargs - ) -> AsyncLROPoller["models.Snapshot"]: + ) -> AsyncLROPoller["_models.Snapshot"]: """Creates or updates a snapshot. :param resource_group_name: The name of the resource group. @@ -128,7 +128,7 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -153,7 +153,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -171,10 +177,10 @@ async def _update_initial( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.SnapshotUpdate", + snapshot: "_models.SnapshotUpdate", **kwargs - ) -> "models.Snapshot": - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + ) -> "_models.Snapshot": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -228,9 +234,9 @@ async def begin_update( self, resource_group_name: str, snapshot_name: str, - snapshot: "models.SnapshotUpdate", + snapshot: "_models.SnapshotUpdate", **kwargs - ) -> AsyncLROPoller["models.Snapshot"]: + ) -> AsyncLROPoller["_models.Snapshot"]: """Updates (patches) a snapshot. :param resource_group_name: The name of the resource group. @@ -252,7 +258,7 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -277,7 +283,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -296,7 +308,7 @@ async def get( resource_group_name: str, snapshot_name: str, **kwargs - ) -> "models.Snapshot": + ) -> "_models.Snapshot": """Gets information about a snapshot. :param resource_group_name: The name of the resource group. @@ -310,7 +322,7 @@ async def get( :rtype: ~azure.mgmt.compute.v2020_06_30.models.Snapshot :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -439,7 +451,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -457,7 +475,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.SnapshotList"]: + ) -> AsyncIterable["_models.SnapshotList"]: """Lists snapshots under a resource group. :param resource_group_name: The name of the resource group. @@ -467,7 +485,7 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_30.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -526,7 +544,7 @@ async def get_next(next_link=None): def list( self, **kwargs - ) -> AsyncIterable["models.SnapshotList"]: + ) -> AsyncIterable["_models.SnapshotList"]: """Lists snapshots under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -534,7 +552,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_06_30.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -593,10 +611,10 @@ async def _grant_access_initial( self, resource_group_name: str, snapshot_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> Optional["models.AccessUri"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + ) -> Optional["_models.AccessUri"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -648,9 +666,9 @@ async def begin_grant_access( self, resource_group_name: str, snapshot_name: str, - grant_access_data: "models.GrantAccessData", + grant_access_data: "_models.GrantAccessData", **kwargs - ) -> AsyncLROPoller["models.AccessUri"]: + ) -> AsyncLROPoller["_models.AccessUri"]: """Grants access to a snapshot. :param resource_group_name: The name of the resource group. @@ -673,7 +691,7 @@ async def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -698,7 +716,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -800,7 +824,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_accesses_operations.py index f16acba79993..e3e9594ee264 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_accesses_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DiskAccessesOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str disk_access_name, # type: str - disk_access, # type: "models.DiskAccess" + disk_access, # type: "_models.DiskAccess" **kwargs # type: Any ): - # type: (...) -> "models.DiskAccess" - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskAccess"] + # type: (...) -> "_models.DiskAccess" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str disk_access_name, # type: str - disk_access, # type: "models.DiskAccess" + disk_access, # type: "_models.DiskAccess" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DiskAccess"] + # type: (...) -> LROPoller["_models.DiskAccess"] """Creates or updates a disk access resource. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskAccess"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_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: @@ -177,11 +183,11 @@ def _update_initial( self, resource_group_name, # type: str disk_access_name, # type: str - disk_access, # type: "models.DiskAccessUpdate" + disk_access, # type: "_models.DiskAccessUpdate" **kwargs # type: Any ): - # type: (...) -> "models.DiskAccess" - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskAccess"] + # type: (...) -> "_models.DiskAccess" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,10 +241,10 @@ def begin_update( self, resource_group_name, # type: str disk_access_name, # type: str - disk_access, # type: "models.DiskAccessUpdate" + disk_access, # type: "_models.DiskAccessUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DiskAccess"] + # type: (...) -> LROPoller["_models.DiskAccess"] """Updates (patches) a disk access resource. :param resource_group_name: The name of the resource group. @@ -260,7 +266,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskAccess"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -285,7 +291,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_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: @@ -305,7 +317,7 @@ def get( disk_access_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DiskAccess" + # type: (...) -> "_models.DiskAccess" """Gets information about a disk access resource. :param resource_group_name: The name of the resource group. @@ -319,7 +331,7 @@ def get( :rtype: ~azure.mgmt.compute.v2020_06_30.models.DiskAccess :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskAccess"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -452,7 +464,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_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: @@ -471,7 +489,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskAccessList"] + # type: (...) -> Iterable["_models.DiskAccessList"] """Lists all the disk access resources under a resource group. :param resource_group_name: The name of the resource group. @@ -481,7 +499,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_30.models.DiskAccessList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskAccessList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccessList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -541,7 +559,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskAccessList"] + # type: (...) -> Iterable["_models.DiskAccessList"] """Lists all the disk access resources under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -549,7 +567,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_30.models.DiskAccessList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskAccessList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccessList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -610,7 +628,7 @@ def get_private_link_resources( disk_access_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.PrivateLinkResourceListResult" + # type: (...) -> "_models.PrivateLinkResourceListResult" """Gets the private link resources possible under disk access resource. :param resource_group_name: The name of the resource group. @@ -624,7 +642,7 @@ def get_private_link_resources( :rtype: ~azure.mgmt.compute.v2020_06_30.models.PrivateLinkResourceListResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResourceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_encryption_sets_operations.py index e98d04b473be..92be48882d0c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_encryption_sets_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DiskEncryptionSetsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str disk_encryption_set_name, # type: str - disk_encryption_set, # type: "models.DiskEncryptionSet" + disk_encryption_set, # type: "_models.DiskEncryptionSet" **kwargs # type: Any ): - # type: (...) -> "models.DiskEncryptionSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + # type: (...) -> "_models.DiskEncryptionSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str disk_encryption_set_name, # type: str - disk_encryption_set, # type: "models.DiskEncryptionSet" + disk_encryption_set, # type: "_models.DiskEncryptionSet" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DiskEncryptionSet"] + # type: (...) -> LROPoller["_models.DiskEncryptionSet"] """Creates or updates a disk encryption set. :param resource_group_name: The name of the resource group. @@ -135,7 +135,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -160,7 +160,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_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: @@ -178,11 +184,11 @@ def _update_initial( self, resource_group_name, # type: str disk_encryption_set_name, # type: str - disk_encryption_set, # type: "models.DiskEncryptionSetUpdate" + disk_encryption_set, # type: "_models.DiskEncryptionSetUpdate" **kwargs # type: Any ): - # type: (...) -> "models.DiskEncryptionSet" - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + # type: (...) -> "_models.DiskEncryptionSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -236,10 +242,10 @@ def begin_update( self, resource_group_name, # type: str disk_encryption_set_name, # type: str - disk_encryption_set, # type: "models.DiskEncryptionSetUpdate" + disk_encryption_set, # type: "_models.DiskEncryptionSetUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.DiskEncryptionSet"] + # type: (...) -> LROPoller["_models.DiskEncryptionSet"] """Updates (patches) a disk encryption set. :param resource_group_name: The name of the resource group. @@ -262,7 +268,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -287,7 +293,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_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: @@ -307,7 +319,7 @@ def get( disk_encryption_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.DiskEncryptionSet" + # type: (...) -> "_models.DiskEncryptionSet" """Gets information about a disk encryption set. :param resource_group_name: The name of the resource group. @@ -321,7 +333,7 @@ def get( :rtype: ~azure.mgmt.compute.v2020_06_30.models.DiskEncryptionSet :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSet"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -454,7 +466,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_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: @@ -473,7 +491,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskEncryptionSetList"] + # type: (...) -> Iterable["_models.DiskEncryptionSetList"] """Lists all the disk encryption sets under a resource group. :param resource_group_name: The name of the resource group. @@ -483,7 +501,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_30.models.DiskEncryptionSetList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSetList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSetList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -543,7 +561,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskEncryptionSetList"] + # type: (...) -> Iterable["_models.DiskEncryptionSetList"] """Lists all the disk encryption sets under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -551,7 +569,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_30.models.DiskEncryptionSetList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskEncryptionSetList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSetList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -612,7 +630,7 @@ def list_associated_resources( disk_encryption_set_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.ResourceUriList"] + # type: (...) -> Iterable["_models.ResourceUriList"] """Lists all resources that are encrypted with this disk encryption set. :param resource_group_name: The name of the resource group. @@ -626,7 +644,7 @@ def list_associated_resources( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_30.models.ResourceUriList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceUriList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceUriList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disks_operations.py index a1e62b7afa55..c149e297ae33 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disks_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class DisksOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.Disk" + disk, # type: "_models.Disk" **kwargs # type: Any ): - # type: (...) -> "models.Disk" - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + # type: (...) -> "_models.Disk" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.Disk" + disk, # type: "_models.Disk" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Disk"] + # type: (...) -> LROPoller["_models.Disk"] """Creates or updates a disk. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -177,11 +183,11 @@ def _update_initial( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.DiskUpdate" + disk, # type: "_models.DiskUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Disk" - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + # type: (...) -> "_models.Disk" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,10 +241,10 @@ def begin_update( self, resource_group_name, # type: str disk_name, # type: str - disk, # type: "models.DiskUpdate" + disk, # type: "_models.DiskUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Disk"] + # type: (...) -> LROPoller["_models.Disk"] """Updates (patches) a disk. :param resource_group_name: The name of the resource group. @@ -260,7 +266,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -285,7 +291,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -305,7 +317,7 @@ def get( disk_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Disk" + # type: (...) -> "_models.Disk" """Gets information about a disk. :param resource_group_name: The name of the resource group. @@ -319,7 +331,7 @@ def get( :rtype: ~azure.mgmt.compute.v2020_06_30.models.Disk :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Disk"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -450,7 +462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_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: @@ -469,7 +487,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskList"] + # type: (...) -> Iterable["_models.DiskList"] """Lists all the disks under a resource group. :param resource_group_name: The name of the resource group. @@ -479,7 +497,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_30.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -539,7 +557,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.DiskList"] + # type: (...) -> Iterable["_models.DiskList"] """Lists all the disks under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -547,7 +565,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_30.models.DiskList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.DiskList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -606,11 +624,11 @@ def _grant_access_initial( self, resource_group_name, # type: str disk_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> Optional["models.AccessUri"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + # type: (...) -> Optional["_models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -662,10 +680,10 @@ def begin_grant_access( self, resource_group_name, # type: str disk_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AccessUri"] + # type: (...) -> LROPoller["_models.AccessUri"] """Grants access to a disk. :param resource_group_name: The name of the resource group. @@ -688,7 +706,7 @@ def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -713,7 +731,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -817,7 +841,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_snapshots_operations.py index f34000502562..e2070da1a37d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_snapshots_operations.py @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class SnapshotsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,11 +51,11 @@ def _create_or_update_initial( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.Snapshot" + snapshot, # type: "_models.Snapshot" **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + # type: (...) -> "_models.Snapshot" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -109,10 +109,10 @@ def begin_create_or_update( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.Snapshot" + snapshot, # type: "_models.Snapshot" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Snapshot"] + # type: (...) -> LROPoller["_models.Snapshot"] """Creates or updates a snapshot. :param resource_group_name: The name of the resource group. @@ -134,7 +134,7 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -159,7 +159,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -177,11 +183,11 @@ def _update_initial( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.SnapshotUpdate" + snapshot, # type: "_models.SnapshotUpdate" **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + # type: (...) -> "_models.Snapshot" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -235,10 +241,10 @@ def begin_update( self, resource_group_name, # type: str snapshot_name, # type: str - snapshot, # type: "models.SnapshotUpdate" + snapshot, # type: "_models.SnapshotUpdate" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.Snapshot"] + # type: (...) -> LROPoller["_models.Snapshot"] """Updates (patches) a snapshot. :param resource_group_name: The name of the resource group. @@ -260,7 +266,7 @@ def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -285,7 +291,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -305,7 +317,7 @@ def get( snapshot_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.Snapshot" + # type: (...) -> "_models.Snapshot" """Gets information about a snapshot. :param resource_group_name: The name of the resource group. @@ -319,7 +331,7 @@ def get( :rtype: ~azure.mgmt.compute.v2020_06_30.models.Snapshot :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.Snapshot"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -450,7 +462,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_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: @@ -469,7 +487,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.SnapshotList"] + # type: (...) -> Iterable["_models.SnapshotList"] """Lists snapshots under a resource group. :param resource_group_name: The name of the resource group. @@ -479,7 +497,7 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_30.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -539,7 +557,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.SnapshotList"] + # type: (...) -> Iterable["_models.SnapshotList"] """Lists snapshots under a subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -547,7 +565,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_06_30.models.SnapshotList] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SnapshotList"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -606,11 +624,11 @@ def _grant_access_initial( self, resource_group_name, # type: str snapshot_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> Optional["models.AccessUri"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.AccessUri"]] + # type: (...) -> Optional["_models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -662,10 +680,10 @@ def begin_grant_access( self, resource_group_name, # type: str snapshot_name, # type: str - grant_access_data, # type: "models.GrantAccessData" + grant_access_data, # type: "_models.GrantAccessData" **kwargs # type: Any ): - # type: (...) -> LROPoller["models.AccessUri"] + # type: (...) -> LROPoller["_models.AccessUri"] """Grants access to a snapshot. :param resource_group_name: The name of the resource group. @@ -688,7 +706,7 @@ def begin_grant_access( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -713,7 +731,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -817,7 +841,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/__init__.py new file mode 100644 index 000000000000..cdc7f7a1709a --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/__init__.py @@ -0,0 +1,16 @@ +# 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 ._compute_management_client import ComputeManagementClient +__all__ = ['ComputeManagementClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_compute_management_client.py new file mode 100644 index 000000000000..0af3a3432463 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_compute_management_client.py @@ -0,0 +1,109 @@ +# 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 ._configuration import ComputeManagementClientConfiguration +from .operations import GalleriesOperations +from .operations import GalleryImagesOperations +from .operations import GalleryImageVersionsOperations +from .operations import GalleryApplicationsOperations +from .operations import GalleryApplicationVersionsOperations +from .operations import GallerySharingProfileOperations +from .operations import SharedGalleriesOperations +from .operations import SharedGalleryImagesOperations +from .operations import SharedGalleryImageVersionsOperations +from . import models + + +class ComputeManagementClient(object): + """Compute Client. + + :ivar galleries: GalleriesOperations operations + :vartype galleries: azure.mgmt.compute.v2020_09_30.operations.GalleriesOperations + :ivar gallery_images: GalleryImagesOperations operations + :vartype gallery_images: azure.mgmt.compute.v2020_09_30.operations.GalleryImagesOperations + :ivar gallery_image_versions: GalleryImageVersionsOperations operations + :vartype gallery_image_versions: azure.mgmt.compute.v2020_09_30.operations.GalleryImageVersionsOperations + :ivar gallery_applications: GalleryApplicationsOperations operations + :vartype gallery_applications: azure.mgmt.compute.v2020_09_30.operations.GalleryApplicationsOperations + :ivar gallery_application_versions: GalleryApplicationVersionsOperations operations + :vartype gallery_application_versions: azure.mgmt.compute.v2020_09_30.operations.GalleryApplicationVersionsOperations + :ivar gallery_sharing_profile: GallerySharingProfileOperations operations + :vartype gallery_sharing_profile: azure.mgmt.compute.v2020_09_30.operations.GallerySharingProfileOperations + :ivar shared_galleries: SharedGalleriesOperations operations + :vartype shared_galleries: azure.mgmt.compute.v2020_09_30.operations.SharedGalleriesOperations + :ivar shared_gallery_images: SharedGalleryImagesOperations operations + :vartype shared_gallery_images: azure.mgmt.compute.v2020_09_30.operations.SharedGalleryImagesOperations + :ivar shared_gallery_image_versions: SharedGalleryImageVersionsOperations operations + :vartype shared_gallery_image_versions: azure.mgmt.compute.v2020_09_30.operations.SharedGalleryImageVersionsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :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 = ComputeManagementClientConfiguration(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._deserialize = Deserializer(client_models) + + self.galleries = GalleriesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.gallery_images = GalleryImagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.gallery_image_versions = GalleryImageVersionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.gallery_applications = GalleryApplicationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.gallery_application_versions = GalleryApplicationVersionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.gallery_sharing_profile = GallerySharingProfileOperations( + self._client, self._config, self._serialize, self._deserialize) + self.shared_galleries = SharedGalleriesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.shared_gallery_images = SharedGalleryImagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.shared_gallery_image_versions = SharedGalleryImageVersionsOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> ComputeManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_configuration.py new file mode 100644 index 000000000000..370a3d084192 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_configuration.py @@ -0,0 +1,70 @@ +# 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 + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class ComputeManagementClientConfiguration(Configuration): + """Configuration for ComputeManagementClient. + + 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: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :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(ComputeManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-09-30" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.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/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_metadata.json new file mode 100644 index 000000000000..14e5d07746c0 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_metadata.json @@ -0,0 +1,69 @@ +{ + "chosen_version": "2020-09-30", + "total_api_version_list": ["2020-09-30"], + "client": { + "name": "ComputeManagementClient", + "filename": "_compute_management_client", + "description": "Compute Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": true + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null + }, + "operation_groups": { + "galleries": "GalleriesOperations", + "gallery_images": "GalleryImagesOperations", + "gallery_image_versions": "GalleryImageVersionsOperations", + "gallery_applications": "GalleryApplicationsOperations", + "gallery_application_versions": "GalleryApplicationVersionsOperations", + "gallery_sharing_profile": "GallerySharingProfileOperations", + "shared_galleries": "SharedGalleriesOperations", + "shared_gallery_images": "SharedGalleryImagesOperations", + "shared_gallery_image_versions": "SharedGalleryImageVersionsOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/__init__.py new file mode 100644 index 000000000000..9e9459635989 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/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 ._compute_management_client import ComputeManagementClient +__all__ = ['ComputeManagementClient'] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/_compute_management_client.py new file mode 100644 index 000000000000..3c930176bb4e --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/_compute_management_client.py @@ -0,0 +1,103 @@ +# 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.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 ComputeManagementClientConfiguration +from .operations import GalleriesOperations +from .operations import GalleryImagesOperations +from .operations import GalleryImageVersionsOperations +from .operations import GalleryApplicationsOperations +from .operations import GalleryApplicationVersionsOperations +from .operations import GallerySharingProfileOperations +from .operations import SharedGalleriesOperations +from .operations import SharedGalleryImagesOperations +from .operations import SharedGalleryImageVersionsOperations +from .. import models + + +class ComputeManagementClient(object): + """Compute Client. + + :ivar galleries: GalleriesOperations operations + :vartype galleries: azure.mgmt.compute.v2020_09_30.aio.operations.GalleriesOperations + :ivar gallery_images: GalleryImagesOperations operations + :vartype gallery_images: azure.mgmt.compute.v2020_09_30.aio.operations.GalleryImagesOperations + :ivar gallery_image_versions: GalleryImageVersionsOperations operations + :vartype gallery_image_versions: azure.mgmt.compute.v2020_09_30.aio.operations.GalleryImageVersionsOperations + :ivar gallery_applications: GalleryApplicationsOperations operations + :vartype gallery_applications: azure.mgmt.compute.v2020_09_30.aio.operations.GalleryApplicationsOperations + :ivar gallery_application_versions: GalleryApplicationVersionsOperations operations + :vartype gallery_application_versions: azure.mgmt.compute.v2020_09_30.aio.operations.GalleryApplicationVersionsOperations + :ivar gallery_sharing_profile: GallerySharingProfileOperations operations + :vartype gallery_sharing_profile: azure.mgmt.compute.v2020_09_30.aio.operations.GallerySharingProfileOperations + :ivar shared_galleries: SharedGalleriesOperations operations + :vartype shared_galleries: azure.mgmt.compute.v2020_09_30.aio.operations.SharedGalleriesOperations + :ivar shared_gallery_images: SharedGalleryImagesOperations operations + :vartype shared_gallery_images: azure.mgmt.compute.v2020_09_30.aio.operations.SharedGalleryImagesOperations + :ivar shared_gallery_image_versions: SharedGalleryImageVersionsOperations operations + :vartype shared_gallery_image_versions: azure.mgmt.compute.v2020_09_30.aio.operations.SharedGalleryImageVersionsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :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 = ComputeManagementClientConfiguration(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._deserialize = Deserializer(client_models) + + self.galleries = GalleriesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.gallery_images = GalleryImagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.gallery_image_versions = GalleryImageVersionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.gallery_applications = GalleryApplicationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.gallery_application_versions = GalleryApplicationVersionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.gallery_sharing_profile = GallerySharingProfileOperations( + self._client, self._config, self._serialize, self._deserialize) + self.shared_galleries = SharedGalleriesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.shared_gallery_images = SharedGalleryImagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.shared_gallery_image_versions = SharedGalleryImageVersionsOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "ComputeManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/_configuration.py new file mode 100644 index 000000000000..27f722aaa4df --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/_configuration.py @@ -0,0 +1,66 @@ +# 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 + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class ComputeManagementClientConfiguration(Configuration): + """Configuration for ComputeManagementClient. + + 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: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :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(ComputeManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-09-30" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-compute/{}'.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/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/__init__.py new file mode 100644 index 000000000000..2999cc9432ab --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/__init__.py @@ -0,0 +1,29 @@ +# 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 ._galleries_operations import GalleriesOperations +from ._gallery_images_operations import GalleryImagesOperations +from ._gallery_image_versions_operations import GalleryImageVersionsOperations +from ._gallery_applications_operations import GalleryApplicationsOperations +from ._gallery_application_versions_operations import GalleryApplicationVersionsOperations +from ._gallery_sharing_profile_operations import GallerySharingProfileOperations +from ._shared_galleries_operations import SharedGalleriesOperations +from ._shared_gallery_images_operations import SharedGalleryImagesOperations +from ._shared_gallery_image_versions_operations import SharedGalleryImageVersionsOperations + +__all__ = [ + 'GalleriesOperations', + 'GalleryImagesOperations', + 'GalleryImageVersionsOperations', + 'GalleryApplicationsOperations', + 'GalleryApplicationVersionsOperations', + 'GallerySharingProfileOperations', + 'SharedGalleriesOperations', + 'SharedGalleryImagesOperations', + 'SharedGalleryImageVersionsOperations', +] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_galleries_operations.py new file mode 100644 index 000000000000..a7501063e15e --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_galleries_operations.py @@ -0,0 +1,608 @@ +# 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 GalleriesOperations: + """GalleriesOperations 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.mgmt.compute.v2020_09_30.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, + gallery_name: str, + gallery: "_models.Gallery", + **kwargs + ) -> "_models.Gallery": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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(gallery, 'Gallery') + 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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Gallery', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Gallery', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Gallery', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + gallery_name: str, + gallery: "_models.Gallery", + **kwargs + ) -> AsyncLROPoller["_models.Gallery"]: + """Create or update a Shared Image Gallery. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery. The allowed characters are alphabets + and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. + :type gallery_name: str + :param gallery: Parameters supplied to the create or update Shared Image Gallery operation. + :type gallery: ~azure.mgmt.compute.v2020_09_30.models.Gallery + :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: True for ARMPolling, False for no polling, or a + polling object for 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 Gallery or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_09_30.models.Gallery] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] + 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, + gallery_name=gallery_name, + gallery=gallery, + 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('Gallery', 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + gallery_name: str, + gallery: "_models.GalleryUpdate", + **kwargs + ) -> "_models.Gallery": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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(gallery, 'GalleryUpdate') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Gallery', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + gallery_name: str, + gallery: "_models.GalleryUpdate", + **kwargs + ) -> AsyncLROPoller["_models.Gallery"]: + """Update a Shared Image Gallery. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery. The allowed characters are alphabets + and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. + :type gallery_name: str + :param gallery: Parameters supplied to the update Shared Image Gallery operation. + :type gallery: ~azure.mgmt.compute.v2020_09_30.models.GalleryUpdate + :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: True for ARMPolling, False for no polling, or a + polling object for 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 Gallery or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_09_30.models.Gallery] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] + 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, + gallery_name=gallery_name, + gallery=gallery, + 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('Gallery', 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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.Compute/galleries/{galleryName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + gallery_name: str, + select: Optional[Union[str, "_models.SelectPermissions"]] = None, + **kwargs + ) -> "_models.Gallery": + """Retrieves information about a Shared Image Gallery. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery. + :type gallery_name: str + :param select: The select expression to apply on the operation. + :type select: str or ~azure.mgmt.compute.v2020_09_30.models.SelectPermissions + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Gallery, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.Gallery + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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 select is not None: + query_parameters['$select'] = self._serialize.query("select", select, '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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Gallery', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + gallery_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-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + gallery_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Delete a Shared Image Gallery. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery to be deleted. + :type gallery_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: True for ARMPolling, False for no polling, or a + polling object for 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, + gallery_name=gallery_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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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.Compute/galleries/{galleryName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.GalleryList"]: + """List galleries under a resource group. + + :param resource_group_name: The name of the resource group. + :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 GalleryList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_09_30.models.GalleryList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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('GalleryList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.GalleryList"]: + """List galleries under a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GalleryList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_09_30.models.GalleryList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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('GalleryList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/galleries'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_application_versions_operations.py new file mode 100644 index 000000000000..e9ef1e3ce031 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_application_versions_operations.py @@ -0,0 +1,618 @@ +# 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 GalleryApplicationVersionsOperations: + """GalleryApplicationVersionsOperations 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.mgmt.compute.v2020_09_30.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, + gallery_name: str, + gallery_application_name: str, + gallery_application_version_name: str, + gallery_application_version: "_models.GalleryApplicationVersion", + **kwargs + ) -> "_models.GalleryApplicationVersion": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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(gallery_application_version, 'GalleryApplicationVersion') + 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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('GalleryApplicationVersion', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('GalleryApplicationVersion', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('GalleryApplicationVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + gallery_name: str, + gallery_application_name: str, + gallery_application_version_name: str, + gallery_application_version: "_models.GalleryApplicationVersion", + **kwargs + ) -> AsyncLROPoller["_models.GalleryApplicationVersion"]: + """Create or update a gallery Application Version. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Application Gallery in which the Application + Definition resides. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application Definition in which the + Application Version is to be created. + :type gallery_application_name: str + :param gallery_application_version_name: The name of the gallery Application Version to be + created. Needs to follow semantic version name pattern: The allowed characters are digit and + period. Digits must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. + :type gallery_application_version_name: str + :param gallery_application_version: Parameters supplied to the create or update gallery + Application Version operation. + :type gallery_application_version: ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersion + :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: True for ARMPolling, False for no polling, or a + polling object for 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 GalleryApplicationVersion or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] + 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, + gallery_name=gallery_name, + gallery_application_name=gallery_application_name, + gallery_application_version_name=gallery_application_version_name, + gallery_application_version=gallery_application_version, + 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('GalleryApplicationVersion', 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + gallery_name: str, + gallery_application_name: str, + gallery_application_version_name: str, + gallery_application_version: "_models.GalleryApplicationVersionUpdate", + **kwargs + ) -> "_models.GalleryApplicationVersion": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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(gallery_application_version, 'GalleryApplicationVersionUpdate') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GalleryApplicationVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + gallery_name: str, + gallery_application_name: str, + gallery_application_version_name: str, + gallery_application_version: "_models.GalleryApplicationVersionUpdate", + **kwargs + ) -> AsyncLROPoller["_models.GalleryApplicationVersion"]: + """Update a gallery Application Version. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Application Gallery in which the Application + Definition resides. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application Definition in which the + Application Version is to be updated. + :type gallery_application_name: str + :param gallery_application_version_name: The name of the gallery Application Version to be + updated. Needs to follow semantic version name pattern: The allowed characters are digit and + period. Digits must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. + :type gallery_application_version_name: str + :param gallery_application_version: Parameters supplied to the update gallery Application + Version operation. + :type gallery_application_version: ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersionUpdate + :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: True for ARMPolling, False for no polling, or a + polling object for 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 GalleryApplicationVersion or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] + 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, + gallery_name=gallery_name, + gallery_application_name=gallery_application_name, + gallery_application_version_name=gallery_application_version_name, + gallery_application_version=gallery_application_version, + 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('GalleryApplicationVersion', 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + gallery_name: str, + gallery_application_name: str, + gallery_application_version_name: str, + expand: Optional[Union[str, "_models.ReplicationStatusTypes"]] = None, + **kwargs + ) -> "_models.GalleryApplicationVersion": + """Retrieves information about a gallery Application Version. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Application Gallery in which the Application + Definition resides. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application Definition in which the + Application Version resides. + :type gallery_application_name: str + :param gallery_application_version_name: The name of the gallery Application Version to be + retrieved. + :type gallery_application_version_name: str + :param expand: The expand expression to apply on the operation. + :type expand: str or ~azure.mgmt.compute.v2020_09_30.models.ReplicationStatusTypes + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GalleryApplicationVersion, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GalleryApplicationVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + gallery_name: str, + gallery_application_name: str, + gallery_application_version_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-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + gallery_name: str, + gallery_application_name: str, + gallery_application_version_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Delete a gallery Application Version. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Application Gallery in which the Application + Definition resides. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application Definition in which the + Application Version resides. + :type gallery_application_name: str + :param gallery_application_version_name: The name of the gallery Application Version to be + deleted. + :type gallery_application_version_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: True for ARMPolling, False for no polling, or a + polling object for 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, + gallery_name=gallery_name, + gallery_application_name=gallery_application_name, + gallery_application_version_name=gallery_application_version_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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} # type: ignore + + def list_by_gallery_application( + self, + resource_group_name: str, + gallery_name: str, + gallery_application_name: str, + **kwargs + ) -> AsyncIterable["_models.GalleryApplicationVersionList"]: + """List gallery Application Versions in a gallery Application Definition. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Application Gallery in which the Application + Definition resides. + :type gallery_name: str + :param gallery_application_name: The name of the Shared Application Gallery Application + Definition from which the Application Versions are to be listed. + :type gallery_application_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GalleryApplicationVersionList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersionList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersionList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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_gallery_application.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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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('GalleryApplicationVersionList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_gallery_application.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_applications_operations.py new file mode 100644 index 000000000000..2d6f33d258ce --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_applications_operations.py @@ -0,0 +1,575 @@ +# 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 GalleryApplicationsOperations: + """GalleryApplicationsOperations 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.mgmt.compute.v2020_09_30.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, + gallery_name: str, + gallery_application_name: str, + gallery_application: "_models.GalleryApplication", + **kwargs + ) -> "_models.GalleryApplication": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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(gallery_application, 'GalleryApplication') + 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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('GalleryApplication', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('GalleryApplication', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('GalleryApplication', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + gallery_name: str, + gallery_application_name: str, + gallery_application: "_models.GalleryApplication", + **kwargs + ) -> AsyncLROPoller["_models.GalleryApplication"]: + """Create or update a gallery Application Definition. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Application Gallery in which the Application + Definition is to be created. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application Definition to be created + or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods + allowed in the middle. The maximum length is 80 characters. + :type gallery_application_name: str + :param gallery_application: Parameters supplied to the create or update gallery Application + operation. + :type gallery_application: ~azure.mgmt.compute.v2020_09_30.models.GalleryApplication + :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: True for ARMPolling, False for no polling, or a + polling object for 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 GalleryApplication or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_09_30.models.GalleryApplication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] + 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, + gallery_name=gallery_name, + gallery_application_name=gallery_application_name, + gallery_application=gallery_application, + 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('GalleryApplication', 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + gallery_name: str, + gallery_application_name: str, + gallery_application: "_models.GalleryApplicationUpdate", + **kwargs + ) -> "_models.GalleryApplication": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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(gallery_application, 'GalleryApplicationUpdate') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GalleryApplication', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + gallery_name: str, + gallery_application_name: str, + gallery_application: "_models.GalleryApplicationUpdate", + **kwargs + ) -> AsyncLROPoller["_models.GalleryApplication"]: + """Update a gallery Application Definition. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Application Gallery in which the Application + Definition is to be updated. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application Definition to be updated. + The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the + middle. The maximum length is 80 characters. + :type gallery_application_name: str + :param gallery_application: Parameters supplied to the update gallery Application operation. + :type gallery_application: ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationUpdate + :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: True for ARMPolling, False for no polling, or a + polling object for 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 GalleryApplication or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_09_30.models.GalleryApplication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] + 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, + gallery_name=gallery_name, + gallery_application_name=gallery_application_name, + gallery_application=gallery_application, + 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('GalleryApplication', 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + gallery_name: str, + gallery_application_name: str, + **kwargs + ) -> "_models.GalleryApplication": + """Retrieves information about a gallery Application Definition. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Application Gallery from which the Application + Definitions are to be retrieved. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application Definition to be + retrieved. + :type gallery_application_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GalleryApplication, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.GalleryApplication + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GalleryApplication', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + gallery_name: str, + gallery_application_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-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + gallery_name: str, + gallery_application_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Delete a gallery Application. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Application Gallery in which the Application + Definition is to be deleted. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application Definition to be deleted. + :type gallery_application_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: True for ARMPolling, False for no polling, or a + polling object for 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, + gallery_name=gallery_name, + gallery_application_name=gallery_application_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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} # type: ignore + + def list_by_gallery( + self, + resource_group_name: str, + gallery_name: str, + **kwargs + ) -> AsyncIterable["_models.GalleryApplicationList"]: + """List gallery Application Definitions in a gallery. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Application Gallery from which Application + Definitions are to be listed. + :type gallery_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GalleryApplicationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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_gallery.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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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('GalleryApplicationList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_gallery.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_image_versions_operations.py new file mode 100644 index 000000000000..7dc656c96662 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_image_versions_operations.py @@ -0,0 +1,616 @@ +# 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 GalleryImageVersionsOperations: + """GalleryImageVersionsOperations 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.mgmt.compute.v2020_09_30.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, + gallery_name: str, + gallery_image_name: str, + gallery_image_version_name: str, + gallery_image_version: "_models.GalleryImageVersion", + **kwargs + ) -> "_models.GalleryImageVersion": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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(gallery_image_version, 'GalleryImageVersion') + 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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('GalleryImageVersion', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('GalleryImageVersion', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('GalleryImageVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + gallery_name: str, + gallery_image_name: str, + gallery_image_version_name: str, + gallery_image_version: "_models.GalleryImageVersion", + **kwargs + ) -> AsyncLROPoller["_models.GalleryImageVersion"]: + """Create or update a gallery image version. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery in which the Image Definition + resides. + :type gallery_name: str + :param gallery_image_name: The name of the gallery image definition in which the Image Version + is to be created. + :type gallery_image_name: str + :param gallery_image_version_name: The name of the gallery image version to be created. Needs + to follow semantic version name pattern: The allowed characters are digit and period. Digits + must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. + :type gallery_image_version_name: str + :param gallery_image_version: Parameters supplied to the create or update gallery image version + operation. + :type gallery_image_version: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersion + :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: True for ARMPolling, False for no polling, or a + polling object for 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 GalleryImageVersion or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] + 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, + gallery_name=gallery_name, + gallery_image_name=gallery_image_name, + gallery_image_version_name=gallery_image_version_name, + gallery_image_version=gallery_image_version, + 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('GalleryImageVersion', 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + gallery_name: str, + gallery_image_name: str, + gallery_image_version_name: str, + gallery_image_version: "_models.GalleryImageVersionUpdate", + **kwargs + ) -> "_models.GalleryImageVersion": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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(gallery_image_version, 'GalleryImageVersionUpdate') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GalleryImageVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + gallery_name: str, + gallery_image_name: str, + gallery_image_version_name: str, + gallery_image_version: "_models.GalleryImageVersionUpdate", + **kwargs + ) -> AsyncLROPoller["_models.GalleryImageVersion"]: + """Update a gallery image version. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery in which the Image Definition + resides. + :type gallery_name: str + :param gallery_image_name: The name of the gallery image definition in which the Image Version + is to be updated. + :type gallery_image_name: str + :param gallery_image_version_name: The name of the gallery image version to be updated. Needs + to follow semantic version name pattern: The allowed characters are digit and period. Digits + must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. + :type gallery_image_version_name: str + :param gallery_image_version: Parameters supplied to the update gallery image version + operation. + :type gallery_image_version: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersionUpdate + :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: True for ARMPolling, False for no polling, or a + polling object for 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 GalleryImageVersion or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] + 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, + gallery_name=gallery_name, + gallery_image_name=gallery_image_name, + gallery_image_version_name=gallery_image_version_name, + gallery_image_version=gallery_image_version, + 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('GalleryImageVersion', 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + gallery_name: str, + gallery_image_name: str, + gallery_image_version_name: str, + expand: Optional[Union[str, "_models.ReplicationStatusTypes"]] = None, + **kwargs + ) -> "_models.GalleryImageVersion": + """Retrieves information about a gallery image version. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery in which the Image Definition + resides. + :type gallery_name: str + :param gallery_image_name: The name of the gallery image definition in which the Image Version + resides. + :type gallery_image_name: str + :param gallery_image_version_name: The name of the gallery image version to be retrieved. + :type gallery_image_version_name: str + :param expand: The expand expression to apply on the operation. + :type expand: str or ~azure.mgmt.compute.v2020_09_30.models.ReplicationStatusTypes + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GalleryImageVersion, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GalleryImageVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + gallery_name: str, + gallery_image_name: str, + gallery_image_version_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-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + gallery_name: str, + gallery_image_name: str, + gallery_image_version_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Delete a gallery image version. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery in which the Image Definition + resides. + :type gallery_name: str + :param gallery_image_name: The name of the gallery image definition in which the Image Version + resides. + :type gallery_image_name: str + :param gallery_image_version_name: The name of the gallery image version to be deleted. + :type gallery_image_version_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: True for ARMPolling, False for no polling, or a + polling object for 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, + gallery_name=gallery_name, + gallery_image_name=gallery_image_name, + gallery_image_version_name=gallery_image_version_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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore + + def list_by_gallery_image( + self, + resource_group_name: str, + gallery_name: str, + gallery_image_name: str, + **kwargs + ) -> AsyncIterable["_models.GalleryImageVersionList"]: + """List gallery image versions in a gallery image definition. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery in which the Image Definition + resides. + :type gallery_name: str + :param gallery_image_name: The name of the Shared Image Gallery Image Definition from which the + Image Versions are to be listed. + :type gallery_image_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GalleryImageVersionList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersionList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersionList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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_gallery_image.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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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('GalleryImageVersionList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_gallery_image.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_images_operations.py new file mode 100644 index 000000000000..e1cb3714a6c5 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_images_operations.py @@ -0,0 +1,573 @@ +# 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 GalleryImagesOperations: + """GalleryImagesOperations 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.mgmt.compute.v2020_09_30.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, + gallery_name: str, + gallery_image_name: str, + gallery_image: "_models.GalleryImage", + **kwargs + ) -> "_models.GalleryImage": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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(gallery_image, 'GalleryImage') + 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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('GalleryImage', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('GalleryImage', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('GalleryImage', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + gallery_name: str, + gallery_image_name: str, + gallery_image: "_models.GalleryImage", + **kwargs + ) -> AsyncLROPoller["_models.GalleryImage"]: + """Create or update a gallery image definition. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to + be created. + :type gallery_name: str + :param gallery_image_name: The name of the gallery image definition to be created or updated. + The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the + middle. The maximum length is 80 characters. + :type gallery_image_name: str + :param gallery_image: Parameters supplied to the create or update gallery image operation. + :type gallery_image: ~azure.mgmt.compute.v2020_09_30.models.GalleryImage + :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: True for ARMPolling, False for no polling, or a + polling object for 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 GalleryImage or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_09_30.models.GalleryImage] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] + 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, + gallery_name=gallery_name, + gallery_image_name=gallery_image_name, + gallery_image=gallery_image, + 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('GalleryImage', 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + gallery_name: str, + gallery_image_name: str, + gallery_image: "_models.GalleryImageUpdate", + **kwargs + ) -> "_models.GalleryImage": + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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(gallery_image, 'GalleryImageUpdate') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GalleryImage', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + gallery_name: str, + gallery_image_name: str, + gallery_image: "_models.GalleryImageUpdate", + **kwargs + ) -> AsyncLROPoller["_models.GalleryImage"]: + """Update a gallery image definition. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to + be updated. + :type gallery_name: str + :param gallery_image_name: The name of the gallery image definition to be updated. The allowed + characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The + maximum length is 80 characters. + :type gallery_image_name: str + :param gallery_image: Parameters supplied to the update gallery image operation. + :type gallery_image: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageUpdate + :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: True for ARMPolling, False for no polling, or a + polling object for 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 GalleryImage or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_09_30.models.GalleryImage] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] + 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, + gallery_name=gallery_name, + gallery_image_name=gallery_image_name, + gallery_image=gallery_image, + 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('GalleryImage', 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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.Compute/galleries/{galleryName}/images/{galleryImageName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + gallery_name: str, + gallery_image_name: str, + **kwargs + ) -> "_models.GalleryImage": + """Retrieves information about a gallery image definition. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery from which the Image Definitions are + to be retrieved. + :type gallery_name: str + :param gallery_image_name: The name of the gallery image definition to be retrieved. + :type gallery_image_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GalleryImage, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.GalleryImage + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GalleryImage', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + gallery_name: str, + gallery_image_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-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + gallery_name: str, + gallery_image_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Delete a gallery image. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to + be deleted. + :type gallery_name: str + :param gallery_image_name: The name of the gallery image definition to be deleted. + :type gallery_image_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: True for ARMPolling, False for no polling, or a + polling object for 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, + gallery_name=gallery_name, + gallery_image_name=gallery_image_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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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.Compute/galleries/{galleryName}/images/{galleryImageName}'} # type: ignore + + def list_by_gallery( + self, + resource_group_name: str, + gallery_name: str, + **kwargs + ) -> AsyncIterable["_models.GalleryImageList"]: + """List gallery image definitions in a gallery. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery from which Image Definitions are to + be listed. + :type gallery_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GalleryImageList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_09_30.models.GalleryImageList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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_gallery.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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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('GalleryImageList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_gallery.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_sharing_profile_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_sharing_profile_operations.py new file mode 100644 index 000000000000..132be50e2a9f --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_sharing_profile_operations.py @@ -0,0 +1,171 @@ +# 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, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +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 GallerySharingProfileOperations: + """GallerySharingProfileOperations 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.mgmt.compute.v2020_09_30.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 _update_initial( + self, + resource_group_name: str, + gallery_name: str, + sharing_update: "_models.SharingUpdate", + **kwargs + ) -> "_models.SharingUpdate": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharingUpdate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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(sharing_update, 'SharingUpdate') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SharingUpdate', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SharingUpdate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/share'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + gallery_name: str, + sharing_update: "_models.SharingUpdate", + **kwargs + ) -> AsyncLROPoller["_models.SharingUpdate"]: + """Update sharing profile of a gallery. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery. + :type gallery_name: str + :param sharing_update: Parameters supplied to the update gallery sharing profile. + :type sharing_update: ~azure.mgmt.compute.v2020_09_30.models.SharingUpdate + :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: True for ARMPolling, False for no polling, or a + polling object for 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 SharingUpdate or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_09_30.models.SharingUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharingUpdate"] + 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, + gallery_name=gallery_name, + sharing_update=sharing_update, + 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('SharingUpdate', 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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.Compute/galleries/{galleryName}/share'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_galleries_operations.py new file mode 100644 index 000000000000..bfa53e08c12b --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_galleries_operations.py @@ -0,0 +1,176 @@ +# 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.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 SharedGalleriesOperations: + """SharedGalleriesOperations 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.mgmt.compute.v2020_09_30.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, + location: str, + shared_to: Optional[Union[str, "_models.SharedToValues"]] = None, + **kwargs + ) -> AsyncIterable["_models.SharedGalleryList"]: + """List shared galleries by subscription id or tenant id. + + :param location: Resource location. + :type location: str + :param shared_to: The query parameter to decide what shared galleries to fetch when doing + listing operations. + :type shared_to: str or ~azure.mgmt.compute.v2020_09_30.models.SharedToValues + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SharedGalleryList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_09_30.models.SharedGalleryList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedGalleryList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'location': self._serialize.url("location", location, '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 shared_to is not None: + query_parameters['sharedTo'] = self._serialize.query("shared_to", shared_to, '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('SharedGalleryList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries'} # type: ignore + + async def get( + self, + location: str, + gallery_unique_name: str, + **kwargs + ) -> "_models.PirSharedGalleryResource": + """Get a shared gallery by subscription id or tenant id. + + :param location: Resource location. + :type location: str + :param gallery_unique_name: The unique name of the Shared Gallery. + :type gallery_unique_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PirSharedGalleryResource, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.PirSharedGalleryResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PirSharedGalleryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'location': self._serialize.url("location", location, 'str'), + 'galleryUniqueName': self._serialize.url("gallery_unique_name", gallery_unique_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PirSharedGalleryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_gallery_image_versions_operations.py new file mode 100644 index 000000000000..54dcf72895ad --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_gallery_image_versions_operations.py @@ -0,0 +1,197 @@ +# 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.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 SharedGalleryImageVersionsOperations: + """SharedGalleryImageVersionsOperations 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.mgmt.compute.v2020_09_30.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, + location: str, + gallery_unique_name: str, + gallery_image_name: str, + shared_to: Optional[Union[str, "_models.SharedToValues"]] = None, + **kwargs + ) -> AsyncIterable["_models.SharedGalleryImageVersionList"]: + """List shared gallery image versions by subscription id or tenant id. + + :param location: Resource location. + :type location: str + :param gallery_unique_name: The unique name of the Shared Gallery. + :type gallery_unique_name: str + :param gallery_image_name: The name of the Shared Gallery Image Definition from which the Image + Versions are to be listed. + :type gallery_image_name: str + :param shared_to: The query parameter to decide what shared galleries to fetch when doing + listing operations. + :type shared_to: str or ~azure.mgmt.compute.v2020_09_30.models.SharedToValues + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SharedGalleryImageVersionList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_09_30.models.SharedGalleryImageVersionList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedGalleryImageVersionList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'location': self._serialize.url("location", location, 'str'), + 'galleryUniqueName': self._serialize.url("gallery_unique_name", gallery_unique_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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 shared_to is not None: + query_parameters['sharedTo'] = self._serialize.query("shared_to", shared_to, '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('SharedGalleryImageVersionList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions'} # type: ignore + + async def get( + self, + location: str, + gallery_unique_name: str, + gallery_image_name: str, + gallery_image_version_name: str, + **kwargs + ) -> "_models.SharedGalleryImageVersion": + """Get a shared gallery image version by subscription id or tenant id. + + :param location: Resource location. + :type location: str + :param gallery_unique_name: The unique name of the Shared Gallery. + :type gallery_unique_name: str + :param gallery_image_name: The name of the Shared Gallery Image Definition from which the Image + Versions are to be listed. + :type gallery_image_name: str + :param gallery_image_version_name: The name of the gallery image version to be created. Needs + to follow semantic version name pattern: The allowed characters are digit and period. Digits + must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. + :type gallery_image_version_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SharedGalleryImageVersion, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.SharedGalleryImageVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedGalleryImageVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'location': self._serialize.url("location", location, 'str'), + 'galleryUniqueName': self._serialize.url("gallery_unique_name", gallery_unique_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SharedGalleryImageVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_gallery_images_operations.py new file mode 100644 index 000000000000..93e1f25b6e77 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_gallery_images_operations.py @@ -0,0 +1,185 @@ +# 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.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 SharedGalleryImagesOperations: + """SharedGalleryImagesOperations 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.mgmt.compute.v2020_09_30.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, + location: str, + gallery_unique_name: str, + shared_to: Optional[Union[str, "_models.SharedToValues"]] = None, + **kwargs + ) -> AsyncIterable["_models.SharedGalleryImageList"]: + """List shared gallery images by subscription id or tenant id. + + :param location: Resource location. + :type location: str + :param gallery_unique_name: The unique name of the Shared Gallery. + :type gallery_unique_name: str + :param shared_to: The query parameter to decide what shared galleries to fetch when doing + listing operations. + :type shared_to: str or ~azure.mgmt.compute.v2020_09_30.models.SharedToValues + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SharedGalleryImageList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_09_30.models.SharedGalleryImageList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedGalleryImageList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'location': self._serialize.url("location", location, 'str'), + 'galleryUniqueName': self._serialize.url("gallery_unique_name", gallery_unique_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 shared_to is not None: + query_parameters['sharedTo'] = self._serialize.query("shared_to", shared_to, '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('SharedGalleryImageList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images'} # type: ignore + + async def get( + self, + location: str, + gallery_unique_name: str, + gallery_image_name: str, + **kwargs + ) -> "_models.SharedGalleryImage": + """Get a shared gallery image by subscription id or tenant id. + + :param location: Resource location. + :type location: str + :param gallery_unique_name: The unique name of the Shared Gallery. + :type gallery_unique_name: str + :param gallery_image_name: The name of the Shared Gallery Image Definition from which the Image + Versions are to be listed. + :type gallery_image_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SharedGalleryImage, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.SharedGalleryImage + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedGalleryImage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'location': self._serialize.url("location", location, 'str'), + 'galleryUniqueName': self._serialize.url("gallery_unique_name", gallery_unique_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SharedGalleryImage', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/__init__.py new file mode 100644 index 000000000000..a4ea97750b5b --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/__init__.py @@ -0,0 +1,221 @@ +# 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 ApiError + from ._models_py3 import ApiErrorBase + from ._models_py3 import DataDiskImageEncryption + from ._models_py3 import Disallowed + from ._models_py3 import DiskImageEncryption + from ._models_py3 import EncryptionImages + from ._models_py3 import Gallery + from ._models_py3 import GalleryApplication + from ._models_py3 import GalleryApplicationList + from ._models_py3 import GalleryApplicationUpdate + from ._models_py3 import GalleryApplicationVersion + from ._models_py3 import GalleryApplicationVersionList + from ._models_py3 import GalleryApplicationVersionPublishingProfile + from ._models_py3 import GalleryApplicationVersionUpdate + from ._models_py3 import GalleryArtifactPublishingProfileBase + from ._models_py3 import GalleryArtifactSource + from ._models_py3 import GalleryArtifactVersionSource + from ._models_py3 import GalleryDataDiskImage + from ._models_py3 import GalleryDiskImage + from ._models_py3 import GalleryIdentifier + from ._models_py3 import GalleryImage + from ._models_py3 import GalleryImageFeature + from ._models_py3 import GalleryImageIdentifier + from ._models_py3 import GalleryImageList + from ._models_py3 import GalleryImageUpdate + from ._models_py3 import GalleryImageVersion + from ._models_py3 import GalleryImageVersionList + from ._models_py3 import GalleryImageVersionPublishingProfile + from ._models_py3 import GalleryImageVersionStorageProfile + from ._models_py3 import GalleryImageVersionUpdate + from ._models_py3 import GalleryList + from ._models_py3 import GalleryOSDiskImage + from ._models_py3 import GalleryUpdate + from ._models_py3 import ImagePurchasePlan + from ._models_py3 import InnerError + from ._models_py3 import ManagedArtifact + from ._models_py3 import OSDiskImageEncryption + from ._models_py3 import PirResource + from ._models_py3 import PirSharedGalleryResource + from ._models_py3 import RecommendedMachineConfiguration + from ._models_py3 import RegionalReplicationStatus + from ._models_py3 import ReplicationStatus + from ._models_py3 import Resource + from ._models_py3 import ResourceRange + from ._models_py3 import SharedGallery + from ._models_py3 import SharedGalleryImage + from ._models_py3 import SharedGalleryImageList + from ._models_py3 import SharedGalleryImageVersion + from ._models_py3 import SharedGalleryImageVersionList + from ._models_py3 import SharedGalleryList + from ._models_py3 import SharingProfile + from ._models_py3 import SharingProfileGroup + from ._models_py3 import SharingUpdate + from ._models_py3 import TargetRegion + from ._models_py3 import UpdateResourceDefinition + from ._models_py3 import UserArtifactManage + from ._models_py3 import UserArtifactSource +except (SyntaxError, ImportError): + from ._models import ApiError # type: ignore + from ._models import ApiErrorBase # type: ignore + from ._models import DataDiskImageEncryption # type: ignore + from ._models import Disallowed # type: ignore + from ._models import DiskImageEncryption # type: ignore + from ._models import EncryptionImages # type: ignore + from ._models import Gallery # type: ignore + from ._models import GalleryApplication # type: ignore + from ._models import GalleryApplicationList # type: ignore + from ._models import GalleryApplicationUpdate # type: ignore + from ._models import GalleryApplicationVersion # type: ignore + from ._models import GalleryApplicationVersionList # type: ignore + from ._models import GalleryApplicationVersionPublishingProfile # type: ignore + from ._models import GalleryApplicationVersionUpdate # type: ignore + from ._models import GalleryArtifactPublishingProfileBase # type: ignore + from ._models import GalleryArtifactSource # type: ignore + from ._models import GalleryArtifactVersionSource # type: ignore + from ._models import GalleryDataDiskImage # type: ignore + from ._models import GalleryDiskImage # type: ignore + from ._models import GalleryIdentifier # type: ignore + from ._models import GalleryImage # type: ignore + from ._models import GalleryImageFeature # type: ignore + from ._models import GalleryImageIdentifier # type: ignore + from ._models import GalleryImageList # type: ignore + from ._models import GalleryImageUpdate # type: ignore + from ._models import GalleryImageVersion # type: ignore + from ._models import GalleryImageVersionList # type: ignore + from ._models import GalleryImageVersionPublishingProfile # type: ignore + from ._models import GalleryImageVersionStorageProfile # type: ignore + from ._models import GalleryImageVersionUpdate # type: ignore + from ._models import GalleryList # type: ignore + from ._models import GalleryOSDiskImage # type: ignore + from ._models import GalleryUpdate # type: ignore + from ._models import ImagePurchasePlan # type: ignore + from ._models import InnerError # type: ignore + from ._models import ManagedArtifact # type: ignore + from ._models import OSDiskImageEncryption # type: ignore + from ._models import PirResource # type: ignore + from ._models import PirSharedGalleryResource # type: ignore + from ._models import RecommendedMachineConfiguration # type: ignore + from ._models import RegionalReplicationStatus # type: ignore + from ._models import ReplicationStatus # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourceRange # type: ignore + from ._models import SharedGallery # type: ignore + from ._models import SharedGalleryImage # type: ignore + from ._models import SharedGalleryImageList # type: ignore + from ._models import SharedGalleryImageVersion # type: ignore + from ._models import SharedGalleryImageVersionList # type: ignore + from ._models import SharedGalleryList # type: ignore + from ._models import SharingProfile # type: ignore + from ._models import SharingProfileGroup # type: ignore + from ._models import SharingUpdate # type: ignore + from ._models import TargetRegion # type: ignore + from ._models import UpdateResourceDefinition # type: ignore + from ._models import UserArtifactManage # type: ignore + from ._models import UserArtifactSource # type: ignore + +from ._compute_management_client_enums import ( + AggregatedReplicationState, + GalleryApplicationVersionPropertiesProvisioningState, + GalleryImagePropertiesProvisioningState, + GalleryImageVersionPropertiesProvisioningState, + GalleryPropertiesProvisioningState, + GallerySharingPermissionTypes, + HostCaching, + HyperVGeneration, + OperatingSystemStateTypes, + OperatingSystemTypes, + ReplicationState, + ReplicationStatusTypes, + SelectPermissions, + SharedToValues, + SharingProfileGroupTypes, + SharingUpdateOperationTypes, + StorageAccountType, +) + +__all__ = [ + 'ApiError', + 'ApiErrorBase', + 'DataDiskImageEncryption', + 'Disallowed', + 'DiskImageEncryption', + 'EncryptionImages', + 'Gallery', + 'GalleryApplication', + 'GalleryApplicationList', + 'GalleryApplicationUpdate', + 'GalleryApplicationVersion', + 'GalleryApplicationVersionList', + 'GalleryApplicationVersionPublishingProfile', + 'GalleryApplicationVersionUpdate', + 'GalleryArtifactPublishingProfileBase', + 'GalleryArtifactSource', + 'GalleryArtifactVersionSource', + 'GalleryDataDiskImage', + 'GalleryDiskImage', + 'GalleryIdentifier', + 'GalleryImage', + 'GalleryImageFeature', + 'GalleryImageIdentifier', + 'GalleryImageList', + 'GalleryImageUpdate', + 'GalleryImageVersion', + 'GalleryImageVersionList', + 'GalleryImageVersionPublishingProfile', + 'GalleryImageVersionStorageProfile', + 'GalleryImageVersionUpdate', + 'GalleryList', + 'GalleryOSDiskImage', + 'GalleryUpdate', + 'ImagePurchasePlan', + 'InnerError', + 'ManagedArtifact', + 'OSDiskImageEncryption', + 'PirResource', + 'PirSharedGalleryResource', + 'RecommendedMachineConfiguration', + 'RegionalReplicationStatus', + 'ReplicationStatus', + 'Resource', + 'ResourceRange', + 'SharedGallery', + 'SharedGalleryImage', + 'SharedGalleryImageList', + 'SharedGalleryImageVersion', + 'SharedGalleryImageVersionList', + 'SharedGalleryList', + 'SharingProfile', + 'SharingProfileGroup', + 'SharingUpdate', + 'TargetRegion', + 'UpdateResourceDefinition', + 'UserArtifactManage', + 'UserArtifactSource', + 'AggregatedReplicationState', + 'GalleryApplicationVersionPropertiesProvisioningState', + 'GalleryImagePropertiesProvisioningState', + 'GalleryImageVersionPropertiesProvisioningState', + 'GalleryPropertiesProvisioningState', + 'GallerySharingPermissionTypes', + 'HostCaching', + 'HyperVGeneration', + 'OperatingSystemStateTypes', + 'OperatingSystemTypes', + 'ReplicationState', + 'ReplicationStatusTypes', + 'SelectPermissions', + 'SharedToValues', + 'SharingProfileGroupTypes', + 'SharingUpdateOperationTypes', + 'StorageAccountType', +] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/_compute_management_client_enums.py new file mode 100644 index 000000000000..03c24ad074a1 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/_compute_management_client_enums.py @@ -0,0 +1,169 @@ +# 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 AggregatedReplicationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """This is the aggregated replication status based on all the regional replication status flags. + """ + + UNKNOWN = "Unknown" + IN_PROGRESS = "InProgress" + COMPLETED = "Completed" + FAILED = "Failed" + +class GalleryApplicationVersionPropertiesProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The provisioning state, which only appears in the response. + """ + + CREATING = "Creating" + UPDATING = "Updating" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + DELETING = "Deleting" + MIGRATING = "Migrating" + +class GalleryImagePropertiesProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The provisioning state, which only appears in the response. + """ + + CREATING = "Creating" + UPDATING = "Updating" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + DELETING = "Deleting" + MIGRATING = "Migrating" + +class GalleryImageVersionPropertiesProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The provisioning state, which only appears in the response. + """ + + CREATING = "Creating" + UPDATING = "Updating" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + DELETING = "Deleting" + MIGRATING = "Migrating" + +class GalleryPropertiesProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The provisioning state, which only appears in the response. + """ + + CREATING = "Creating" + UPDATING = "Updating" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + DELETING = "Deleting" + MIGRATING = "Migrating" + +class GallerySharingPermissionTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """This property allows you to specify the permission of sharing gallery. :code:`
`:code:`
` + Possible values are: :code:`
`:code:`
` **Private** :code:`
`:code:`
` **Groups** + """ + + PRIVATE = "Private" + GROUPS = "Groups" + +class HostCaching(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' + """ + + NONE = "None" + READ_ONLY = "ReadOnly" + READ_WRITE = "ReadWrite" + +class HyperVGeneration(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The hypervisor generation of the Virtual Machine. Applicable to OS disks only. + """ + + V1 = "V1" + V2 = "V2" + +class OperatingSystemStateTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """This property allows the user to specify whether the virtual machines created under this image + are 'Generalized' or 'Specialized'. + """ + + GENERALIZED = "Generalized" + SPECIALIZED = "Specialized" + +class OperatingSystemTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """This property allows you to specify the supported type of the OS that application is built for. + :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **Windows** + :code:`
`:code:`
` **Linux** + """ + + WINDOWS = "Windows" + LINUX = "Linux" + +class ReplicationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """This is the regional replication state. + """ + + UNKNOWN = "Unknown" + REPLICATING = "Replicating" + COMPLETED = "Completed" + FAILED = "Failed" + +class ReplicationStatusTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + REPLICATION_STATUS = "ReplicationStatus" + +class SelectPermissions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + PERMISSIONS = "Permissions" + +class SharedToValues(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + TENANT = "tenant" + +class SharingProfileGroupTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """This property allows you to specify the type of sharing group. :code:`
`:code:`
` + Possible values are: :code:`
`:code:`
` **Subscriptions** :code:`
`:code:`
` + **AADTenants** + """ + + SUBSCRIPTIONS = "Subscriptions" + AAD_TENANTS = "AADTenants" + +class SharingUpdateOperationTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """This property allows you to specify the operation type of gallery sharing update. + :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **Add** + :code:`
`:code:`
` **Remove** :code:`
`:code:`
` **Reset** + """ + + ADD = "Add" + REMOVE = "Remove" + RESET = "Reset" + +class StorageAccountType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the storage account type to be used to store the image. This property is not + updatable. + """ + + STANDARD_LRS = "Standard_LRS" + STANDARD_ZRS = "Standard_ZRS" + PREMIUM_LRS = "Premium_LRS" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/_models.py new file mode 100644 index 000000000000..b54f40aa446b --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/_models.py @@ -0,0 +1,2229 @@ +# 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 msrest.serialization + + +class ApiError(msrest.serialization.Model): + """Api error. + + :param details: The Api error details. + :type details: list[~azure.mgmt.compute.v2020_09_30.models.ApiErrorBase] + :param innererror: The Api inner error. + :type innererror: ~azure.mgmt.compute.v2020_09_30.models.InnerError + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'details': {'key': 'details', 'type': '[ApiErrorBase]'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiError, self).__init__(**kwargs) + self.details = kwargs.get('details', None) + self.innererror = kwargs.get('innererror', None) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) + + +class ApiErrorBase(msrest.serialization.Model): + """Api error base. + + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiErrorBase, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) + + +class DiskImageEncryption(msrest.serialization.Model): + """This is the disk image encryption base class. + + :param disk_encryption_set_id: A relative URI containing the resource ID of the disk encryption + set. + :type disk_encryption_set_id: str + """ + + _attribute_map = { + 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DiskImageEncryption, self).__init__(**kwargs) + self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) + + +class DataDiskImageEncryption(DiskImageEncryption): + """Contains encryption settings for a data disk image. + + All required parameters must be populated in order to send to Azure. + + :param disk_encryption_set_id: A relative URI containing the resource ID of the disk encryption + set. + :type disk_encryption_set_id: str + :param lun: Required. This property specifies the logical unit number of the data disk. This + value is used to identify data disks within the Virtual Machine and therefore must be unique + for each data disk attached to the Virtual Machine. + :type lun: int + """ + + _validation = { + 'lun': {'required': True}, + } + + _attribute_map = { + 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, + 'lun': {'key': 'lun', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(DataDiskImageEncryption, self).__init__(**kwargs) + self.lun = kwargs['lun'] + + +class Disallowed(msrest.serialization.Model): + """Describes the disallowed disk types. + + :param disk_types: A list of disk types. + :type disk_types: list[str] + """ + + _attribute_map = { + 'disk_types': {'key': 'diskTypes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(Disallowed, self).__init__(**kwargs) + self.disk_types = kwargs.get('disk_types', None) + + +class EncryptionImages(msrest.serialization.Model): + """Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. + + :param os_disk_image: This is the disk image encryption base class. + :type os_disk_image: ~azure.mgmt.compute.v2020_09_30.models.DiskImageEncryption + :param data_disk_images: A list of encryption specifications for data disk images. + :type data_disk_images: list[~azure.mgmt.compute.v2020_09_30.models.DataDiskImageEncryption] + """ + + _attribute_map = { + 'os_disk_image': {'key': 'osDiskImage', 'type': 'DiskImageEncryption'}, + 'data_disk_images': {'key': 'dataDiskImages', 'type': '[DataDiskImageEncryption]'}, + } + + def __init__( + self, + **kwargs + ): + super(EncryptionImages, self).__init__(**kwargs) + self.os_disk_image = kwargs.get('os_disk_image', None) + self.data_disk_images = kwargs.get('data_disk_images', None) + + +class Resource(msrest.serialization.Model): + """The Resource model definition. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, 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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs['location'] + self.tags = kwargs.get('tags', None) + + +class Gallery(Resource): + """Specifies information about the Shared Image Gallery that you want to create or update. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this Shared Image Gallery resource. This property is + updatable. + :type description: str + :param identifier: Describes the gallery unique name. + :type identifier: ~azure.mgmt.compute.v2020_09_30.models.GalleryIdentifier + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryPropertiesProvisioningState + :param sharing_profile: Profile for gallery sharing to subscription or tenant. + :type sharing_profile: ~azure.mgmt.compute.v2020_09_30.models.SharingProfile + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryIdentifier'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'sharing_profile': {'key': 'properties.sharingProfile', 'type': 'SharingProfile'}, + } + + def __init__( + self, + **kwargs + ): + super(Gallery, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.identifier = kwargs.get('identifier', None) + self.provisioning_state = None + self.sharing_profile = kwargs.get('sharing_profile', None) + + +class GalleryApplication(Resource): + """Specifies information about the gallery Application Definition that you want to create or update. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this gallery Application Definition resource. This + property is updatable. + :type description: str + :param eula: The Eula agreement for the gallery Application Definition. + :type eula: str + :param privacy_statement_uri: The privacy statement uri. + :type privacy_statement_uri: str + :param release_note_uri: The release note uri. + :type release_note_uri: str + :param end_of_life_date: The end of life date of the gallery Application Definition. This + property can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param supported_os_type: This property allows you to specify the supported type of the OS that + application is built for. :code:`
`:code:`
` Possible values are: + :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values + include: "Windows", "Linux". + :type supported_os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + """ + + _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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'eula': {'key': 'properties.eula', 'type': 'str'}, + 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, + 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'supported_os_type': {'key': 'properties.supportedOSType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryApplication, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.eula = kwargs.get('eula', None) + self.privacy_statement_uri = kwargs.get('privacy_statement_uri', None) + self.release_note_uri = kwargs.get('release_note_uri', None) + self.end_of_life_date = kwargs.get('end_of_life_date', None) + self.supported_os_type = kwargs.get('supported_os_type', None) + + +class GalleryApplicationList(msrest.serialization.Model): + """The List Gallery Applications operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of Gallery Applications. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.GalleryApplication] + :param next_link: The uri to fetch the next page of Application Definitions in the Application + Gallery. Call ListNext() with this to fetch the next page of gallery Application Definitions. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GalleryApplication]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryApplicationList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class UpdateResourceDefinition(msrest.serialization.Model): + """The Update Resource model definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, 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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(UpdateResourceDefinition, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.tags = kwargs.get('tags', None) + + +class GalleryApplicationUpdate(UpdateResourceDefinition): + """Specifies information about the gallery Application Definition that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this gallery Application Definition resource. This + property is updatable. + :type description: str + :param eula: The Eula agreement for the gallery Application Definition. + :type eula: str + :param privacy_statement_uri: The privacy statement uri. + :type privacy_statement_uri: str + :param release_note_uri: The release note uri. + :type release_note_uri: str + :param end_of_life_date: The end of life date of the gallery Application Definition. This + property can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param supported_os_type: This property allows you to specify the supported type of the OS that + application is built for. :code:`
`:code:`
` Possible values are: + :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values + include: "Windows", "Linux". + :type supported_os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'eula': {'key': 'properties.eula', 'type': 'str'}, + 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, + 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'supported_os_type': {'key': 'properties.supportedOSType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryApplicationUpdate, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.eula = kwargs.get('eula', None) + self.privacy_statement_uri = kwargs.get('privacy_statement_uri', None) + self.release_note_uri = kwargs.get('release_note_uri', None) + self.end_of_life_date = kwargs.get('end_of_life_date', None) + self.supported_os_type = kwargs.get('supported_os_type', None) + + +class GalleryApplicationVersion(Resource): + """Specifies information about the gallery Application Version that you want to create or update. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param publishing_profile: The publishing profile of a gallery image version. + :type publishing_profile: + ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersionPublishingProfile + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersionPropertiesProvisioningState + :ivar replication_status: This is the replication status of the gallery image version. + :vartype replication_status: ~azure.mgmt.compute.v2020_09_30.models.ReplicationStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'replication_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryApplicationVersionPublishingProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryApplicationVersion, self).__init__(**kwargs) + self.publishing_profile = kwargs.get('publishing_profile', None) + self.provisioning_state = None + self.replication_status = None + + +class GalleryApplicationVersionList(msrest.serialization.Model): + """The List Gallery Application version operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of gallery Application Versions. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersion] + :param next_link: The uri to fetch the next page of gallery Application Versions. Call + ListNext() with this to fetch the next page of gallery Application Versions. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GalleryApplicationVersion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryApplicationVersionList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class GalleryArtifactPublishingProfileBase(msrest.serialization.Model): + """Describes the basic gallery artifact publishing profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param target_regions: The target regions where the Image Version is going to be replicated to. + This property is updatable. + :type target_regions: list[~azure.mgmt.compute.v2020_09_30.models.TargetRegion] + :param replica_count: The number of replicas of the Image Version to be created per region. + This property would take effect for a region when regionalReplicaCount is not specified. This + property is updatable. + :type replica_count: int + :param exclude_from_latest: If set to true, Virtual Machines deployed from the latest version + of the Image Definition won't use this Image Version. + :type exclude_from_latest: bool + :ivar published_date: The timestamp for when the gallery image version is published. + :vartype published_date: ~datetime.datetime + :param end_of_life_date: The end of life date of the gallery image version. This property can + be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param storage_account_type: Specifies the storage account type to be used to store the image. + This property is not updatable. Possible values include: "Standard_LRS", "Standard_ZRS", + "Premium_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2020_09_30.models.StorageAccountType + """ + + _validation = { + 'published_date': {'readonly': True}, + } + + _attribute_map = { + 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, + 'replica_count': {'key': 'replicaCount', 'type': 'int'}, + 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, + 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryArtifactPublishingProfileBase, self).__init__(**kwargs) + self.target_regions = kwargs.get('target_regions', None) + self.replica_count = kwargs.get('replica_count', None) + self.exclude_from_latest = kwargs.get('exclude_from_latest', None) + self.published_date = None + self.end_of_life_date = kwargs.get('end_of_life_date', None) + self.storage_account_type = kwargs.get('storage_account_type', None) + + +class GalleryApplicationVersionPublishingProfile(GalleryArtifactPublishingProfileBase): + """The publishing profile of a gallery image version. + + 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 target_regions: The target regions where the Image Version is going to be replicated to. + This property is updatable. + :type target_regions: list[~azure.mgmt.compute.v2020_09_30.models.TargetRegion] + :param replica_count: The number of replicas of the Image Version to be created per region. + This property would take effect for a region when regionalReplicaCount is not specified. This + property is updatable. + :type replica_count: int + :param exclude_from_latest: If set to true, Virtual Machines deployed from the latest version + of the Image Definition won't use this Image Version. + :type exclude_from_latest: bool + :ivar published_date: The timestamp for when the gallery image version is published. + :vartype published_date: ~datetime.datetime + :param end_of_life_date: The end of life date of the gallery image version. This property can + be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param storage_account_type: Specifies the storage account type to be used to store the image. + This property is not updatable. Possible values include: "Standard_LRS", "Standard_ZRS", + "Premium_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2020_09_30.models.StorageAccountType + :param source: Required. The source image from which the Image Version is going to be created. + :type source: ~azure.mgmt.compute.v2020_09_30.models.UserArtifactSource + :param manage_actions: + :type manage_actions: ~azure.mgmt.compute.v2020_09_30.models.UserArtifactManage + :param enable_health_check: Optional. Whether or not this application reports health. + :type enable_health_check: bool + """ + + _validation = { + 'published_date': {'readonly': True}, + 'source': {'required': True}, + } + + _attribute_map = { + 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, + 'replica_count': {'key': 'replicaCount', 'type': 'int'}, + 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, + 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'UserArtifactSource'}, + 'manage_actions': {'key': 'manageActions', 'type': 'UserArtifactManage'}, + 'enable_health_check': {'key': 'enableHealthCheck', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryApplicationVersionPublishingProfile, self).__init__(**kwargs) + self.source = kwargs['source'] + self.manage_actions = kwargs.get('manage_actions', None) + self.enable_health_check = kwargs.get('enable_health_check', None) + + +class GalleryApplicationVersionUpdate(UpdateResourceDefinition): + """Specifies information about the gallery Application Version that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param publishing_profile: The publishing profile of a gallery image version. + :type publishing_profile: + ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersionPublishingProfile + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersionPropertiesProvisioningState + :ivar replication_status: This is the replication status of the gallery image version. + :vartype replication_status: ~azure.mgmt.compute.v2020_09_30.models.ReplicationStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'replication_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryApplicationVersionPublishingProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryApplicationVersionUpdate, self).__init__(**kwargs) + self.publishing_profile = kwargs.get('publishing_profile', None) + self.provisioning_state = None + self.replication_status = None + + +class GalleryArtifactSource(msrest.serialization.Model): + """The source image from which the Image Version is going to be created. + + All required parameters must be populated in order to send to Azure. + + :param managed_image: Required. The managed artifact. + :type managed_image: ~azure.mgmt.compute.v2020_09_30.models.ManagedArtifact + """ + + _validation = { + 'managed_image': {'required': True}, + } + + _attribute_map = { + 'managed_image': {'key': 'managedImage', 'type': 'ManagedArtifact'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryArtifactSource, self).__init__(**kwargs) + self.managed_image = kwargs['managed_image'] + + +class GalleryArtifactVersionSource(msrest.serialization.Model): + """The gallery artifact version source. + + :param id: The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, + user image or storage account resource. + :type id: str + :param uri: The uri of the gallery artifact version source. Currently used to specify vhd/blob + source. + :type uri: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'uri': {'key': 'uri', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryArtifactVersionSource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.uri = kwargs.get('uri', None) + + +class GalleryDiskImage(msrest.serialization.Model): + """This is the disk image base class. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar size_in_gb: This property indicates the size of the VHD to be created. + :vartype size_in_gb: int + :param host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and + 'ReadWrite'. Possible values include: "None", "ReadOnly", "ReadWrite". + :type host_caching: str or ~azure.mgmt.compute.v2020_09_30.models.HostCaching + :param source: The gallery artifact version source. + :type source: ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactVersionSource + """ + + _validation = { + 'size_in_gb': {'readonly': True}, + } + + _attribute_map = { + 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, + 'host_caching': {'key': 'hostCaching', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryDiskImage, self).__init__(**kwargs) + self.size_in_gb = None + self.host_caching = kwargs.get('host_caching', None) + self.source = kwargs.get('source', None) + + +class GalleryDataDiskImage(GalleryDiskImage): + """This is the data disk image. + + 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 size_in_gb: This property indicates the size of the VHD to be created. + :vartype size_in_gb: int + :param host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and + 'ReadWrite'. Possible values include: "None", "ReadOnly", "ReadWrite". + :type host_caching: str or ~azure.mgmt.compute.v2020_09_30.models.HostCaching + :param source: The gallery artifact version source. + :type source: ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactVersionSource + :param lun: Required. This property specifies the logical unit number of the data disk. This + value is used to identify data disks within the Virtual Machine and therefore must be unique + for each data disk attached to the Virtual Machine. + :type lun: int + """ + + _validation = { + 'size_in_gb': {'readonly': True}, + 'lun': {'required': True}, + } + + _attribute_map = { + 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, + 'host_caching': {'key': 'hostCaching', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, + 'lun': {'key': 'lun', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryDataDiskImage, self).__init__(**kwargs) + self.lun = kwargs['lun'] + + +class GalleryIdentifier(msrest.serialization.Model): + """Describes the gallery unique name. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar unique_name: The unique name of the Shared Image Gallery. This name is generated + automatically by Azure. + :vartype unique_name: str + """ + + _validation = { + 'unique_name': {'readonly': True}, + } + + _attribute_map = { + 'unique_name': {'key': 'uniqueName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryIdentifier, self).__init__(**kwargs) + self.unique_name = None + + +class GalleryImage(Resource): + """Specifies information about the gallery image definition that you want to create or update. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this gallery image definition resource. This property is + updatable. + :type description: str + :param eula: The Eula agreement for the gallery image definition. + :type eula: str + :param privacy_statement_uri: The privacy statement uri. + :type privacy_statement_uri: str + :param release_note_uri: The release note uri. + :type release_note_uri: str + :param os_type: This property allows you to specify the type of the OS that is included in the + disk when creating a VM from a managed image. :code:`
`:code:`
` Possible values are: + :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values + include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + :param os_state: This property allows the user to specify whether the virtual machines created + under this image are 'Generalized' or 'Specialized'. Possible values include: "Generalized", + "Specialized". + :type os_state: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemStateTypes + :param hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS + disks only. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2020_09_30.models.HyperVGeneration + :param features: A list of gallery image features. + :type features: list[~azure.mgmt.compute.v2020_09_30.models.GalleryImageFeature] + :param end_of_life_date: The end of life date of the gallery image definition. This property + can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param identifier: This is the gallery image definition identifier. + :type identifier: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageIdentifier + :param recommended: The properties describe the recommended machine configuration for this + Image Definition. These properties are updatable. + :type recommended: ~azure.mgmt.compute.v2020_09_30.models.RecommendedMachineConfiguration + :param disallowed: Describes the disallowed disk types. + :type disallowed: ~azure.mgmt.compute.v2020_09_30.models.Disallowed + :param purchase_plan: Describes the gallery image definition purchase plan. This is used by + marketplace images. + :type purchase_plan: ~azure.mgmt.compute.v2020_09_30.models.ImagePurchasePlan + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryImagePropertiesProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'eula': {'key': 'properties.eula', 'type': 'str'}, + 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, + 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'os_state': {'key': 'properties.osState', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + 'features': {'key': 'properties.features', 'type': '[GalleryImageFeature]'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryImageIdentifier'}, + 'recommended': {'key': 'properties.recommended', 'type': 'RecommendedMachineConfiguration'}, + 'disallowed': {'key': 'properties.disallowed', 'type': 'Disallowed'}, + 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'ImagePurchasePlan'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImage, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.eula = kwargs.get('eula', None) + self.privacy_statement_uri = kwargs.get('privacy_statement_uri', None) + self.release_note_uri = kwargs.get('release_note_uri', None) + self.os_type = kwargs.get('os_type', None) + self.os_state = kwargs.get('os_state', None) + self.hyper_v_generation = kwargs.get('hyper_v_generation', None) + self.features = kwargs.get('features', None) + self.end_of_life_date = kwargs.get('end_of_life_date', None) + self.identifier = kwargs.get('identifier', None) + self.recommended = kwargs.get('recommended', None) + self.disallowed = kwargs.get('disallowed', None) + self.purchase_plan = kwargs.get('purchase_plan', None) + self.provisioning_state = None + + +class GalleryImageFeature(msrest.serialization.Model): + """A feature for gallery image. + + :param name: The name of the gallery image feature. + :type name: str + :param value: The value of the gallery image feature. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImageFeature, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + +class GalleryImageIdentifier(msrest.serialization.Model): + """This is the gallery image definition identifier. + + All required parameters must be populated in order to send to Azure. + + :param publisher: Required. The name of the gallery image definition publisher. + :type publisher: str + :param offer: Required. The name of the gallery image definition offer. + :type offer: str + :param sku: Required. The name of the gallery image definition SKU. + :type sku: str + """ + + _validation = { + 'publisher': {'required': True}, + 'offer': {'required': True}, + 'sku': {'required': True}, + } + + _attribute_map = { + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'offer': {'key': 'offer', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImageIdentifier, self).__init__(**kwargs) + self.publisher = kwargs['publisher'] + self.offer = kwargs['offer'] + self.sku = kwargs['sku'] + + +class GalleryImageList(msrest.serialization.Model): + """The List Gallery Images operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of Shared Image Gallery images. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.GalleryImage] + :param next_link: The uri to fetch the next page of Image Definitions in the Shared Image + Gallery. Call ListNext() with this to fetch the next page of gallery image definitions. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GalleryImage]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImageList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class GalleryImageUpdate(UpdateResourceDefinition): + """Specifies information about the gallery image definition that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this gallery image definition resource. This property is + updatable. + :type description: str + :param eula: The Eula agreement for the gallery image definition. + :type eula: str + :param privacy_statement_uri: The privacy statement uri. + :type privacy_statement_uri: str + :param release_note_uri: The release note uri. + :type release_note_uri: str + :param os_type: This property allows you to specify the type of the OS that is included in the + disk when creating a VM from a managed image. :code:`
`:code:`
` Possible values are: + :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values + include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + :param os_state: This property allows the user to specify whether the virtual machines created + under this image are 'Generalized' or 'Specialized'. Possible values include: "Generalized", + "Specialized". + :type os_state: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemStateTypes + :param hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS + disks only. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2020_09_30.models.HyperVGeneration + :param features: A list of gallery image features. + :type features: list[~azure.mgmt.compute.v2020_09_30.models.GalleryImageFeature] + :param end_of_life_date: The end of life date of the gallery image definition. This property + can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param identifier: This is the gallery image definition identifier. + :type identifier: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageIdentifier + :param recommended: The properties describe the recommended machine configuration for this + Image Definition. These properties are updatable. + :type recommended: ~azure.mgmt.compute.v2020_09_30.models.RecommendedMachineConfiguration + :param disallowed: Describes the disallowed disk types. + :type disallowed: ~azure.mgmt.compute.v2020_09_30.models.Disallowed + :param purchase_plan: Describes the gallery image definition purchase plan. This is used by + marketplace images. + :type purchase_plan: ~azure.mgmt.compute.v2020_09_30.models.ImagePurchasePlan + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryImagePropertiesProvisioningState + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'eula': {'key': 'properties.eula', 'type': 'str'}, + 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, + 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'os_state': {'key': 'properties.osState', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + 'features': {'key': 'properties.features', 'type': '[GalleryImageFeature]'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryImageIdentifier'}, + 'recommended': {'key': 'properties.recommended', 'type': 'RecommendedMachineConfiguration'}, + 'disallowed': {'key': 'properties.disallowed', 'type': 'Disallowed'}, + 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'ImagePurchasePlan'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImageUpdate, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.eula = kwargs.get('eula', None) + self.privacy_statement_uri = kwargs.get('privacy_statement_uri', None) + self.release_note_uri = kwargs.get('release_note_uri', None) + self.os_type = kwargs.get('os_type', None) + self.os_state = kwargs.get('os_state', None) + self.hyper_v_generation = kwargs.get('hyper_v_generation', None) + self.features = kwargs.get('features', None) + self.end_of_life_date = kwargs.get('end_of_life_date', None) + self.identifier = kwargs.get('identifier', None) + self.recommended = kwargs.get('recommended', None) + self.disallowed = kwargs.get('disallowed', None) + self.purchase_plan = kwargs.get('purchase_plan', None) + self.provisioning_state = None + + +class GalleryImageVersion(Resource): + """Specifies information about the gallery image version that you want to create or update. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param publishing_profile: Describes the basic gallery artifact publishing profile. + :type publishing_profile: + ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactPublishingProfileBase + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersionPropertiesProvisioningState + :param storage_profile: This is the storage profile of a Gallery Image Version. + :type storage_profile: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersionStorageProfile + :ivar replication_status: This is the replication status of the gallery image version. + :vartype replication_status: ~azure.mgmt.compute.v2020_09_30.models.ReplicationStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'replication_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryArtifactPublishingProfileBase'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'GalleryImageVersionStorageProfile'}, + 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImageVersion, self).__init__(**kwargs) + self.publishing_profile = kwargs.get('publishing_profile', None) + self.provisioning_state = None + self.storage_profile = kwargs.get('storage_profile', None) + self.replication_status = None + + +class GalleryImageVersionList(msrest.serialization.Model): + """The List Gallery Image version operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of gallery image versions. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersion] + :param next_link: The uri to fetch the next page of gallery image versions. Call ListNext() + with this to fetch the next page of gallery image versions. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GalleryImageVersion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImageVersionList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class GalleryImageVersionPublishingProfile(GalleryArtifactPublishingProfileBase): + """The publishing profile of a gallery image Version. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param target_regions: The target regions where the Image Version is going to be replicated to. + This property is updatable. + :type target_regions: list[~azure.mgmt.compute.v2020_09_30.models.TargetRegion] + :param replica_count: The number of replicas of the Image Version to be created per region. + This property would take effect for a region when regionalReplicaCount is not specified. This + property is updatable. + :type replica_count: int + :param exclude_from_latest: If set to true, Virtual Machines deployed from the latest version + of the Image Definition won't use this Image Version. + :type exclude_from_latest: bool + :ivar published_date: The timestamp for when the gallery image version is published. + :vartype published_date: ~datetime.datetime + :param end_of_life_date: The end of life date of the gallery image version. This property can + be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param storage_account_type: Specifies the storage account type to be used to store the image. + This property is not updatable. Possible values include: "Standard_LRS", "Standard_ZRS", + "Premium_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2020_09_30.models.StorageAccountType + """ + + _validation = { + 'published_date': {'readonly': True}, + } + + _attribute_map = { + 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, + 'replica_count': {'key': 'replicaCount', 'type': 'int'}, + 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, + 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImageVersionPublishingProfile, self).__init__(**kwargs) + + +class GalleryImageVersionStorageProfile(msrest.serialization.Model): + """This is the storage profile of a Gallery Image Version. + + :param source: The gallery artifact version source. + :type source: ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactVersionSource + :param os_disk_image: This is the disk image base class. + :type os_disk_image: ~azure.mgmt.compute.v2020_09_30.models.GalleryDiskImage + :param data_disk_images: A list of data disk images. + :type data_disk_images: list[~azure.mgmt.compute.v2020_09_30.models.GalleryDataDiskImage] + """ + + _attribute_map = { + 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, + 'os_disk_image': {'key': 'osDiskImage', 'type': 'GalleryDiskImage'}, + 'data_disk_images': {'key': 'dataDiskImages', 'type': '[GalleryDataDiskImage]'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImageVersionStorageProfile, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.os_disk_image = kwargs.get('os_disk_image', None) + self.data_disk_images = kwargs.get('data_disk_images', None) + + +class GalleryImageVersionUpdate(UpdateResourceDefinition): + """Specifies information about the gallery image version that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param publishing_profile: Describes the basic gallery artifact publishing profile. + :type publishing_profile: + ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactPublishingProfileBase + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersionPropertiesProvisioningState + :param storage_profile: This is the storage profile of a Gallery Image Version. + :type storage_profile: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersionStorageProfile + :ivar replication_status: This is the replication status of the gallery image version. + :vartype replication_status: ~azure.mgmt.compute.v2020_09_30.models.ReplicationStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'replication_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryArtifactPublishingProfileBase'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'GalleryImageVersionStorageProfile'}, + 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImageVersionUpdate, self).__init__(**kwargs) + self.publishing_profile = kwargs.get('publishing_profile', None) + self.provisioning_state = None + self.storage_profile = kwargs.get('storage_profile', None) + self.replication_status = None + + +class GalleryList(msrest.serialization.Model): + """The List Galleries operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of galleries. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.Gallery] + :param next_link: The uri to fetch the next page of galleries. Call ListNext() with this to + fetch the next page of galleries. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Gallery]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class GalleryOSDiskImage(GalleryDiskImage): + """This is the OS disk image. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar size_in_gb: This property indicates the size of the VHD to be created. + :vartype size_in_gb: int + :param host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and + 'ReadWrite'. Possible values include: "None", "ReadOnly", "ReadWrite". + :type host_caching: str or ~azure.mgmt.compute.v2020_09_30.models.HostCaching + :param source: The gallery artifact version source. + :type source: ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactVersionSource + """ + + _validation = { + 'size_in_gb': {'readonly': True}, + } + + _attribute_map = { + 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, + 'host_caching': {'key': 'hostCaching', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryOSDiskImage, self).__init__(**kwargs) + + +class GalleryUpdate(UpdateResourceDefinition): + """Specifies information about the Shared Image Gallery that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this Shared Image Gallery resource. This property is + updatable. + :type description: str + :param identifier: Describes the gallery unique name. + :type identifier: ~azure.mgmt.compute.v2020_09_30.models.GalleryIdentifier + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryPropertiesProvisioningState + :param sharing_profile: Profile for gallery sharing to subscription or tenant. + :type sharing_profile: ~azure.mgmt.compute.v2020_09_30.models.SharingProfile + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryIdentifier'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'sharing_profile': {'key': 'properties.sharingProfile', 'type': 'SharingProfile'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryUpdate, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.identifier = kwargs.get('identifier', None) + self.provisioning_state = None + self.sharing_profile = kwargs.get('sharing_profile', None) + + +class ImagePurchasePlan(msrest.serialization.Model): + """Describes the gallery image definition purchase plan. This is used by marketplace images. + + :param name: The plan ID. + :type name: str + :param publisher: The publisher ID. + :type publisher: str + :param product: The product ID. + :type product: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ImagePurchasePlan, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.publisher = kwargs.get('publisher', None) + self.product = kwargs.get('product', None) + + +class InnerError(msrest.serialization.Model): + """Inner error details. + + :param exceptiontype: The exception type. + :type exceptiontype: str + :param errordetail: The internal error message or exception dump. + :type errordetail: str + """ + + _attribute_map = { + 'exceptiontype': {'key': 'exceptiontype', 'type': 'str'}, + 'errordetail': {'key': 'errordetail', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(InnerError, self).__init__(**kwargs) + self.exceptiontype = kwargs.get('exceptiontype', None) + self.errordetail = kwargs.get('errordetail', None) + + +class ManagedArtifact(msrest.serialization.Model): + """The managed artifact. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The managed artifact id. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedArtifact, self).__init__(**kwargs) + self.id = kwargs['id'] + + +class OSDiskImageEncryption(DiskImageEncryption): + """Contains encryption settings for an OS disk image. + + :param disk_encryption_set_id: A relative URI containing the resource ID of the disk encryption + set. + :type disk_encryption_set_id: str + """ + + _attribute_map = { + 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OSDiskImageEncryption, self).__init__(**kwargs) + + +class PirResource(msrest.serialization.Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PirResource, self).__init__(**kwargs) + self.name = None + self.location = None + + +class PirSharedGalleryResource(PirResource): + """Base information about the shared gallery resource in pir. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + :param unique_id: The unique id of this shared gallery. + :type unique_id: str + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'unique_id': {'key': 'identifier.uniqueId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PirSharedGalleryResource, self).__init__(**kwargs) + self.unique_id = kwargs.get('unique_id', None) + + +class RecommendedMachineConfiguration(msrest.serialization.Model): + """The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. + + :param v_cp_us: Describes the resource range. + :type v_cp_us: ~azure.mgmt.compute.v2020_09_30.models.ResourceRange + :param memory: Describes the resource range. + :type memory: ~azure.mgmt.compute.v2020_09_30.models.ResourceRange + """ + + _attribute_map = { + 'v_cp_us': {'key': 'vCPUs', 'type': 'ResourceRange'}, + 'memory': {'key': 'memory', 'type': 'ResourceRange'}, + } + + def __init__( + self, + **kwargs + ): + super(RecommendedMachineConfiguration, self).__init__(**kwargs) + self.v_cp_us = kwargs.get('v_cp_us', None) + self.memory = kwargs.get('memory', None) + + +class RegionalReplicationStatus(msrest.serialization.Model): + """This is the regional replication status. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar region: The region to which the gallery image version is being replicated to. + :vartype region: str + :ivar state: This is the regional replication state. Possible values include: "Unknown", + "Replicating", "Completed", "Failed". + :vartype state: str or ~azure.mgmt.compute.v2020_09_30.models.ReplicationState + :ivar details: The details of the replication status. + :vartype details: str + :ivar progress: It indicates progress of the replication job. + :vartype progress: int + """ + + _validation = { + 'region': {'readonly': True}, + 'state': {'readonly': True}, + 'details': {'readonly': True}, + 'progress': {'readonly': True}, + } + + _attribute_map = { + 'region': {'key': 'region', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'details': {'key': 'details', 'type': 'str'}, + 'progress': {'key': 'progress', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(RegionalReplicationStatus, self).__init__(**kwargs) + self.region = None + self.state = None + self.details = None + self.progress = None + + +class ReplicationStatus(msrest.serialization.Model): + """This is the replication status of the gallery image version. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar aggregated_state: This is the aggregated replication status based on all the regional + replication status flags. Possible values include: "Unknown", "InProgress", "Completed", + "Failed". + :vartype aggregated_state: str or + ~azure.mgmt.compute.v2020_09_30.models.AggregatedReplicationState + :ivar summary: This is a summary of replication status for each region. + :vartype summary: list[~azure.mgmt.compute.v2020_09_30.models.RegionalReplicationStatus] + """ + + _validation = { + 'aggregated_state': {'readonly': True}, + 'summary': {'readonly': True}, + } + + _attribute_map = { + 'aggregated_state': {'key': 'aggregatedState', 'type': 'str'}, + 'summary': {'key': 'summary', 'type': '[RegionalReplicationStatus]'}, + } + + def __init__( + self, + **kwargs + ): + super(ReplicationStatus, self).__init__(**kwargs) + self.aggregated_state = None + self.summary = None + + +class ResourceRange(msrest.serialization.Model): + """Describes the resource range. + + :param min: The minimum number of the resource. + :type min: int + :param max: The maximum number of the resource. + :type max: int + """ + + _attribute_map = { + 'min': {'key': 'min', 'type': 'int'}, + 'max': {'key': 'max', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceRange, self).__init__(**kwargs) + self.min = kwargs.get('min', None) + self.max = kwargs.get('max', None) + + +class SharedGallery(PirSharedGalleryResource): + """Specifies information about the Shared Gallery that you want to create or update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + :param unique_id: The unique id of this shared gallery. + :type unique_id: str + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'unique_id': {'key': 'identifier.uniqueId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SharedGallery, self).__init__(**kwargs) + + +class SharedGalleryImage(PirSharedGalleryResource): + """Specifies information about the gallery image definition that you want to create or update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + :param unique_id: The unique id of this shared gallery. + :type unique_id: str + :param os_type: This property allows you to specify the type of the OS that is included in the + disk when creating a VM from a managed image. :code:`
`:code:`
` Possible values are: + :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values + include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + :param os_state: This property allows the user to specify whether the virtual machines created + under this image are 'Generalized' or 'Specialized'. Possible values include: "Generalized", + "Specialized". + :type os_state: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemStateTypes + :param end_of_life_date: The end of life date of the gallery image definition. This property + can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param identifier: This is the gallery image definition identifier. + :type identifier: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageIdentifier + :param recommended: The properties describe the recommended machine configuration for this + Image Definition. These properties are updatable. + :type recommended: ~azure.mgmt.compute.v2020_09_30.models.RecommendedMachineConfiguration + :param disallowed: Describes the disallowed disk types. + :type disallowed: ~azure.mgmt.compute.v2020_09_30.models.Disallowed + :param hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS + disks only. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2020_09_30.models.HyperVGeneration + :param features: A list of gallery image features. + :type features: list[~azure.mgmt.compute.v2020_09_30.models.GalleryImageFeature] + :param purchase_plan: Describes the gallery image definition purchase plan. This is used by + marketplace images. + :type purchase_plan: ~azure.mgmt.compute.v2020_09_30.models.ImagePurchasePlan + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'unique_id': {'key': 'identifier.uniqueId', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'os_state': {'key': 'properties.osState', 'type': 'str'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryImageIdentifier'}, + 'recommended': {'key': 'properties.recommended', 'type': 'RecommendedMachineConfiguration'}, + 'disallowed': {'key': 'properties.disallowed', 'type': 'Disallowed'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + 'features': {'key': 'properties.features', 'type': '[GalleryImageFeature]'}, + 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'ImagePurchasePlan'}, + } + + def __init__( + self, + **kwargs + ): + super(SharedGalleryImage, self).__init__(**kwargs) + self.os_type = kwargs.get('os_type', None) + self.os_state = kwargs.get('os_state', None) + self.end_of_life_date = kwargs.get('end_of_life_date', None) + self.identifier = kwargs.get('identifier', None) + self.recommended = kwargs.get('recommended', None) + self.disallowed = kwargs.get('disallowed', None) + self.hyper_v_generation = kwargs.get('hyper_v_generation', None) + self.features = kwargs.get('features', None) + self.purchase_plan = kwargs.get('purchase_plan', None) + + +class SharedGalleryImageList(msrest.serialization.Model): + """The List Shared Gallery Images operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of shared gallery images. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.SharedGalleryImage] + :param next_link: The uri to fetch the next page of shared gallery images. Call ListNext() with + this to fetch the next page of shared gallery images. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SharedGalleryImage]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SharedGalleryImageList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class SharedGalleryImageVersion(PirSharedGalleryResource): + """Specifies information about the gallery image version that you want to create or update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + :param unique_id: The unique id of this shared gallery. + :type unique_id: str + :param published_date: The published date of the gallery image version Definition. This + property can be used for decommissioning purposes. This property is updatable. + :type published_date: ~datetime.datetime + :param end_of_life_date: The end of life date of the gallery image version Definition. This + property can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'unique_id': {'key': 'identifier.uniqueId', 'type': 'str'}, + 'published_date': {'key': 'properties.publishedDate', 'type': 'iso-8601'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SharedGalleryImageVersion, self).__init__(**kwargs) + self.published_date = kwargs.get('published_date', None) + self.end_of_life_date = kwargs.get('end_of_life_date', None) + + +class SharedGalleryImageVersionList(msrest.serialization.Model): + """The List Shared Gallery Image versions operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of shared gallery images versions. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.SharedGalleryImageVersion] + :param next_link: The uri to fetch the next page of shared gallery image versions. Call + ListNext() with this to fetch the next page of shared gallery image versions. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SharedGalleryImageVersion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SharedGalleryImageVersionList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class SharedGalleryList(msrest.serialization.Model): + """The List Shared Galleries operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of shared galleries. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.PirSharedGalleryResource] + :param next_link: The uri to fetch the next page of shared galleries. Call ListNext() with this + to fetch the next page of shared galleries. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PirSharedGalleryResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SharedGalleryList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class SharingProfile(msrest.serialization.Model): + """Profile for gallery sharing to subscription or tenant. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param permissions: This property allows you to specify the permission of sharing gallery. + :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **Private** + :code:`
`:code:`
` **Groups**. Possible values include: "Private", "Groups". + :type permissions: str or ~azure.mgmt.compute.v2020_09_30.models.GallerySharingPermissionTypes + :ivar groups: A list of sharing profile groups. + :vartype groups: list[~azure.mgmt.compute.v2020_09_30.models.SharingProfileGroup] + """ + + _validation = { + 'groups': {'readonly': True}, + } + + _attribute_map = { + 'permissions': {'key': 'permissions', 'type': 'str'}, + 'groups': {'key': 'groups', 'type': '[SharingProfileGroup]'}, + } + + def __init__( + self, + **kwargs + ): + super(SharingProfile, self).__init__(**kwargs) + self.permissions = kwargs.get('permissions', None) + self.groups = None + + +class SharingProfileGroup(msrest.serialization.Model): + """Group of the gallery sharing profile. + + :param type: This property allows you to specify the type of sharing group. + :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **Subscriptions** + :code:`
`:code:`
` **AADTenants**. Possible values include: "Subscriptions", + "AADTenants". + :type type: str or ~azure.mgmt.compute.v2020_09_30.models.SharingProfileGroupTypes + :param ids: A list of subscription/tenant ids the gallery is aimed to be shared to. + :type ids: list[str] + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'ids': {'key': 'ids', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SharingProfileGroup, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.ids = kwargs.get('ids', None) + + +class SharingUpdate(msrest.serialization.Model): + """Specifies information about the gallery sharing profile update. + + All required parameters must be populated in order to send to Azure. + + :param operation_type: Required. This property allows you to specify the operation type of + gallery sharing update. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` + **Add** :code:`
`:code:`
` **Remove** :code:`
`:code:`
` **Reset**. Possible values + include: "Add", "Remove", "Reset". + :type operation_type: str or ~azure.mgmt.compute.v2020_09_30.models.SharingUpdateOperationTypes + :param groups: A list of sharing profile groups. + :type groups: list[~azure.mgmt.compute.v2020_09_30.models.SharingProfileGroup] + """ + + _validation = { + 'operation_type': {'required': True}, + } + + _attribute_map = { + 'operation_type': {'key': 'operationType', 'type': 'str'}, + 'groups': {'key': 'groups', 'type': '[SharingProfileGroup]'}, + } + + def __init__( + self, + **kwargs + ): + super(SharingUpdate, self).__init__(**kwargs) + self.operation_type = kwargs['operation_type'] + self.groups = kwargs.get('groups', None) + + +class TargetRegion(msrest.serialization.Model): + """Describes the target region information. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the region. + :type name: str + :param regional_replica_count: The number of replicas of the Image Version to be created per + region. This property is updatable. + :type regional_replica_count: int + :param storage_account_type: Specifies the storage account type to be used to store the image. + This property is not updatable. Possible values include: "Standard_LRS", "Standard_ZRS", + "Premium_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2020_09_30.models.StorageAccountType + :param encryption: Optional. Allows users to provide customer managed keys for encrypting the + OS and data disks in the gallery artifact. + :type encryption: ~azure.mgmt.compute.v2020_09_30.models.EncryptionImages + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'regional_replica_count': {'key': 'regionalReplicaCount', 'type': 'int'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'encryption': {'key': 'encryption', 'type': 'EncryptionImages'}, + } + + def __init__( + self, + **kwargs + ): + super(TargetRegion, self).__init__(**kwargs) + self.name = kwargs['name'] + self.regional_replica_count = kwargs.get('regional_replica_count', None) + self.storage_account_type = kwargs.get('storage_account_type', None) + self.encryption = kwargs.get('encryption', None) + + +class UserArtifactManage(msrest.serialization.Model): + """UserArtifactManage. + + All required parameters must be populated in order to send to Azure. + + :param install: Required. Required. The path and arguments to install the gallery application. + This is limited to 4096 characters. + :type install: str + :param remove: Required. Required. The path and arguments to remove the gallery application. + This is limited to 4096 characters. + :type remove: str + :param update: Optional. The path and arguments to update the gallery application. If not + present, then update operation will invoke remove command on the previous version and install + command on the current version of the gallery application. This is limited to 4096 characters. + :type update: str + """ + + _validation = { + 'install': {'required': True}, + 'remove': {'required': True}, + } + + _attribute_map = { + 'install': {'key': 'install', 'type': 'str'}, + 'remove': {'key': 'remove', 'type': 'str'}, + 'update': {'key': 'update', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserArtifactManage, self).__init__(**kwargs) + self.install = kwargs['install'] + self.remove = kwargs['remove'] + self.update = kwargs.get('update', None) + + +class UserArtifactSource(msrest.serialization.Model): + """The source image from which the Image Version is going to be created. + + All required parameters must be populated in order to send to Azure. + + :param media_link: Required. Required. The mediaLink of the artifact, must be a readable + storage page blob. + :type media_link: str + :param default_configuration_link: Optional. The defaultConfigurationLink of the artifact, must + be a readable storage page blob. + :type default_configuration_link: str + """ + + _validation = { + 'media_link': {'required': True}, + } + + _attribute_map = { + 'media_link': {'key': 'mediaLink', 'type': 'str'}, + 'default_configuration_link': {'key': 'defaultConfigurationLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserArtifactSource, self).__init__(**kwargs) + self.media_link = kwargs['media_link'] + self.default_configuration_link = kwargs.get('default_configuration_link', None) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/_models_py3.py new file mode 100644 index 000000000000..b07b455530c1 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/_models_py3.py @@ -0,0 +1,2461 @@ +# 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 + +import msrest.serialization + +from ._compute_management_client_enums import * + + +class ApiError(msrest.serialization.Model): + """Api error. + + :param details: The Api error details. + :type details: list[~azure.mgmt.compute.v2020_09_30.models.ApiErrorBase] + :param innererror: The Api inner error. + :type innererror: ~azure.mgmt.compute.v2020_09_30.models.InnerError + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'details': {'key': 'details', 'type': '[ApiErrorBase]'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + details: Optional[List["ApiErrorBase"]] = None, + innererror: Optional["InnerError"] = None, + code: Optional[str] = None, + target: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ApiError, self).__init__(**kwargs) + self.details = details + self.innererror = innererror + self.code = code + self.target = target + self.message = message + + +class ApiErrorBase(msrest.serialization.Model): + """Api error base. + + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + target: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ApiErrorBase, self).__init__(**kwargs) + self.code = code + self.target = target + self.message = message + + +class DiskImageEncryption(msrest.serialization.Model): + """This is the disk image encryption base class. + + :param disk_encryption_set_id: A relative URI containing the resource ID of the disk encryption + set. + :type disk_encryption_set_id: str + """ + + _attribute_map = { + 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, + } + + def __init__( + self, + *, + disk_encryption_set_id: Optional[str] = None, + **kwargs + ): + super(DiskImageEncryption, self).__init__(**kwargs) + self.disk_encryption_set_id = disk_encryption_set_id + + +class DataDiskImageEncryption(DiskImageEncryption): + """Contains encryption settings for a data disk image. + + All required parameters must be populated in order to send to Azure. + + :param disk_encryption_set_id: A relative URI containing the resource ID of the disk encryption + set. + :type disk_encryption_set_id: str + :param lun: Required. This property specifies the logical unit number of the data disk. This + value is used to identify data disks within the Virtual Machine and therefore must be unique + for each data disk attached to the Virtual Machine. + :type lun: int + """ + + _validation = { + 'lun': {'required': True}, + } + + _attribute_map = { + 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, + 'lun': {'key': 'lun', 'type': 'int'}, + } + + def __init__( + self, + *, + lun: int, + disk_encryption_set_id: Optional[str] = None, + **kwargs + ): + super(DataDiskImageEncryption, self).__init__(disk_encryption_set_id=disk_encryption_set_id, **kwargs) + self.lun = lun + + +class Disallowed(msrest.serialization.Model): + """Describes the disallowed disk types. + + :param disk_types: A list of disk types. + :type disk_types: list[str] + """ + + _attribute_map = { + 'disk_types': {'key': 'diskTypes', 'type': '[str]'}, + } + + def __init__( + self, + *, + disk_types: Optional[List[str]] = None, + **kwargs + ): + super(Disallowed, self).__init__(**kwargs) + self.disk_types = disk_types + + +class EncryptionImages(msrest.serialization.Model): + """Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. + + :param os_disk_image: This is the disk image encryption base class. + :type os_disk_image: ~azure.mgmt.compute.v2020_09_30.models.DiskImageEncryption + :param data_disk_images: A list of encryption specifications for data disk images. + :type data_disk_images: list[~azure.mgmt.compute.v2020_09_30.models.DataDiskImageEncryption] + """ + + _attribute_map = { + 'os_disk_image': {'key': 'osDiskImage', 'type': 'DiskImageEncryption'}, + 'data_disk_images': {'key': 'dataDiskImages', 'type': '[DataDiskImageEncryption]'}, + } + + def __init__( + self, + *, + os_disk_image: Optional["DiskImageEncryption"] = None, + data_disk_images: Optional[List["DataDiskImageEncryption"]] = None, + **kwargs + ): + super(EncryptionImages, self).__init__(**kwargs) + self.os_disk_image = os_disk_image + self.data_disk_images = data_disk_images + + +class Resource(msrest.serialization.Model): + """The Resource model definition. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, 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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class Gallery(Resource): + """Specifies information about the Shared Image Gallery that you want to create or update. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this Shared Image Gallery resource. This property is + updatable. + :type description: str + :param identifier: Describes the gallery unique name. + :type identifier: ~azure.mgmt.compute.v2020_09_30.models.GalleryIdentifier + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryPropertiesProvisioningState + :param sharing_profile: Profile for gallery sharing to subscription or tenant. + :type sharing_profile: ~azure.mgmt.compute.v2020_09_30.models.SharingProfile + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryIdentifier'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'sharing_profile': {'key': 'properties.sharingProfile', 'type': 'SharingProfile'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + identifier: Optional["GalleryIdentifier"] = None, + sharing_profile: Optional["SharingProfile"] = None, + **kwargs + ): + super(Gallery, self).__init__(location=location, tags=tags, **kwargs) + self.description = description + self.identifier = identifier + self.provisioning_state = None + self.sharing_profile = sharing_profile + + +class GalleryApplication(Resource): + """Specifies information about the gallery Application Definition that you want to create or update. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this gallery Application Definition resource. This + property is updatable. + :type description: str + :param eula: The Eula agreement for the gallery Application Definition. + :type eula: str + :param privacy_statement_uri: The privacy statement uri. + :type privacy_statement_uri: str + :param release_note_uri: The release note uri. + :type release_note_uri: str + :param end_of_life_date: The end of life date of the gallery Application Definition. This + property can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param supported_os_type: This property allows you to specify the supported type of the OS that + application is built for. :code:`
`:code:`
` Possible values are: + :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values + include: "Windows", "Linux". + :type supported_os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + """ + + _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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'eula': {'key': 'properties.eula', 'type': 'str'}, + 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, + 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'supported_os_type': {'key': 'properties.supportedOSType', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + eula: Optional[str] = None, + privacy_statement_uri: Optional[str] = None, + release_note_uri: Optional[str] = None, + end_of_life_date: Optional[datetime.datetime] = None, + supported_os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, + **kwargs + ): + super(GalleryApplication, self).__init__(location=location, tags=tags, **kwargs) + self.description = description + self.eula = eula + self.privacy_statement_uri = privacy_statement_uri + self.release_note_uri = release_note_uri + self.end_of_life_date = end_of_life_date + self.supported_os_type = supported_os_type + + +class GalleryApplicationList(msrest.serialization.Model): + """The List Gallery Applications operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of Gallery Applications. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.GalleryApplication] + :param next_link: The uri to fetch the next page of Application Definitions in the Application + Gallery. Call ListNext() with this to fetch the next page of gallery Application Definitions. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GalleryApplication]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["GalleryApplication"], + next_link: Optional[str] = None, + **kwargs + ): + super(GalleryApplicationList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class UpdateResourceDefinition(msrest.serialization.Model): + """The Update Resource model definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, 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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(UpdateResourceDefinition, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.tags = tags + + +class GalleryApplicationUpdate(UpdateResourceDefinition): + """Specifies information about the gallery Application Definition that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this gallery Application Definition resource. This + property is updatable. + :type description: str + :param eula: The Eula agreement for the gallery Application Definition. + :type eula: str + :param privacy_statement_uri: The privacy statement uri. + :type privacy_statement_uri: str + :param release_note_uri: The release note uri. + :type release_note_uri: str + :param end_of_life_date: The end of life date of the gallery Application Definition. This + property can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param supported_os_type: This property allows you to specify the supported type of the OS that + application is built for. :code:`
`:code:`
` Possible values are: + :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values + include: "Windows", "Linux". + :type supported_os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'eula': {'key': 'properties.eula', 'type': 'str'}, + 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, + 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'supported_os_type': {'key': 'properties.supportedOSType', 'type': 'str'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + eula: Optional[str] = None, + privacy_statement_uri: Optional[str] = None, + release_note_uri: Optional[str] = None, + end_of_life_date: Optional[datetime.datetime] = None, + supported_os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, + **kwargs + ): + super(GalleryApplicationUpdate, self).__init__(tags=tags, **kwargs) + self.description = description + self.eula = eula + self.privacy_statement_uri = privacy_statement_uri + self.release_note_uri = release_note_uri + self.end_of_life_date = end_of_life_date + self.supported_os_type = supported_os_type + + +class GalleryApplicationVersion(Resource): + """Specifies information about the gallery Application Version that you want to create or update. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param publishing_profile: The publishing profile of a gallery image version. + :type publishing_profile: + ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersionPublishingProfile + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersionPropertiesProvisioningState + :ivar replication_status: This is the replication status of the gallery image version. + :vartype replication_status: ~azure.mgmt.compute.v2020_09_30.models.ReplicationStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'replication_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryApplicationVersionPublishingProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + publishing_profile: Optional["GalleryApplicationVersionPublishingProfile"] = None, + **kwargs + ): + super(GalleryApplicationVersion, self).__init__(location=location, tags=tags, **kwargs) + self.publishing_profile = publishing_profile + self.provisioning_state = None + self.replication_status = None + + +class GalleryApplicationVersionList(msrest.serialization.Model): + """The List Gallery Application version operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of gallery Application Versions. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersion] + :param next_link: The uri to fetch the next page of gallery Application Versions. Call + ListNext() with this to fetch the next page of gallery Application Versions. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GalleryApplicationVersion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["GalleryApplicationVersion"], + next_link: Optional[str] = None, + **kwargs + ): + super(GalleryApplicationVersionList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class GalleryArtifactPublishingProfileBase(msrest.serialization.Model): + """Describes the basic gallery artifact publishing profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param target_regions: The target regions where the Image Version is going to be replicated to. + This property is updatable. + :type target_regions: list[~azure.mgmt.compute.v2020_09_30.models.TargetRegion] + :param replica_count: The number of replicas of the Image Version to be created per region. + This property would take effect for a region when regionalReplicaCount is not specified. This + property is updatable. + :type replica_count: int + :param exclude_from_latest: If set to true, Virtual Machines deployed from the latest version + of the Image Definition won't use this Image Version. + :type exclude_from_latest: bool + :ivar published_date: The timestamp for when the gallery image version is published. + :vartype published_date: ~datetime.datetime + :param end_of_life_date: The end of life date of the gallery image version. This property can + be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param storage_account_type: Specifies the storage account type to be used to store the image. + This property is not updatable. Possible values include: "Standard_LRS", "Standard_ZRS", + "Premium_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2020_09_30.models.StorageAccountType + """ + + _validation = { + 'published_date': {'readonly': True}, + } + + _attribute_map = { + 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, + 'replica_count': {'key': 'replicaCount', 'type': 'int'}, + 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, + 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + } + + def __init__( + self, + *, + target_regions: Optional[List["TargetRegion"]] = None, + replica_count: Optional[int] = None, + exclude_from_latest: Optional[bool] = None, + end_of_life_date: Optional[datetime.datetime] = None, + storage_account_type: Optional[Union[str, "StorageAccountType"]] = None, + **kwargs + ): + super(GalleryArtifactPublishingProfileBase, self).__init__(**kwargs) + self.target_regions = target_regions + self.replica_count = replica_count + self.exclude_from_latest = exclude_from_latest + self.published_date = None + self.end_of_life_date = end_of_life_date + self.storage_account_type = storage_account_type + + +class GalleryApplicationVersionPublishingProfile(GalleryArtifactPublishingProfileBase): + """The publishing profile of a gallery image version. + + 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 target_regions: The target regions where the Image Version is going to be replicated to. + This property is updatable. + :type target_regions: list[~azure.mgmt.compute.v2020_09_30.models.TargetRegion] + :param replica_count: The number of replicas of the Image Version to be created per region. + This property would take effect for a region when regionalReplicaCount is not specified. This + property is updatable. + :type replica_count: int + :param exclude_from_latest: If set to true, Virtual Machines deployed from the latest version + of the Image Definition won't use this Image Version. + :type exclude_from_latest: bool + :ivar published_date: The timestamp for when the gallery image version is published. + :vartype published_date: ~datetime.datetime + :param end_of_life_date: The end of life date of the gallery image version. This property can + be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param storage_account_type: Specifies the storage account type to be used to store the image. + This property is not updatable. Possible values include: "Standard_LRS", "Standard_ZRS", + "Premium_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2020_09_30.models.StorageAccountType + :param source: Required. The source image from which the Image Version is going to be created. + :type source: ~azure.mgmt.compute.v2020_09_30.models.UserArtifactSource + :param manage_actions: + :type manage_actions: ~azure.mgmt.compute.v2020_09_30.models.UserArtifactManage + :param enable_health_check: Optional. Whether or not this application reports health. + :type enable_health_check: bool + """ + + _validation = { + 'published_date': {'readonly': True}, + 'source': {'required': True}, + } + + _attribute_map = { + 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, + 'replica_count': {'key': 'replicaCount', 'type': 'int'}, + 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, + 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'UserArtifactSource'}, + 'manage_actions': {'key': 'manageActions', 'type': 'UserArtifactManage'}, + 'enable_health_check': {'key': 'enableHealthCheck', 'type': 'bool'}, + } + + def __init__( + self, + *, + source: "UserArtifactSource", + target_regions: Optional[List["TargetRegion"]] = None, + replica_count: Optional[int] = None, + exclude_from_latest: Optional[bool] = None, + end_of_life_date: Optional[datetime.datetime] = None, + storage_account_type: Optional[Union[str, "StorageAccountType"]] = None, + manage_actions: Optional["UserArtifactManage"] = None, + enable_health_check: Optional[bool] = None, + **kwargs + ): + super(GalleryApplicationVersionPublishingProfile, self).__init__(target_regions=target_regions, replica_count=replica_count, exclude_from_latest=exclude_from_latest, end_of_life_date=end_of_life_date, storage_account_type=storage_account_type, **kwargs) + self.source = source + self.manage_actions = manage_actions + self.enable_health_check = enable_health_check + + +class GalleryApplicationVersionUpdate(UpdateResourceDefinition): + """Specifies information about the gallery Application Version that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param publishing_profile: The publishing profile of a gallery image version. + :type publishing_profile: + ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersionPublishingProfile + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersionPropertiesProvisioningState + :ivar replication_status: This is the replication status of the gallery image version. + :vartype replication_status: ~azure.mgmt.compute.v2020_09_30.models.ReplicationStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'replication_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryApplicationVersionPublishingProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + publishing_profile: Optional["GalleryApplicationVersionPublishingProfile"] = None, + **kwargs + ): + super(GalleryApplicationVersionUpdate, self).__init__(tags=tags, **kwargs) + self.publishing_profile = publishing_profile + self.provisioning_state = None + self.replication_status = None + + +class GalleryArtifactSource(msrest.serialization.Model): + """The source image from which the Image Version is going to be created. + + All required parameters must be populated in order to send to Azure. + + :param managed_image: Required. The managed artifact. + :type managed_image: ~azure.mgmt.compute.v2020_09_30.models.ManagedArtifact + """ + + _validation = { + 'managed_image': {'required': True}, + } + + _attribute_map = { + 'managed_image': {'key': 'managedImage', 'type': 'ManagedArtifact'}, + } + + def __init__( + self, + *, + managed_image: "ManagedArtifact", + **kwargs + ): + super(GalleryArtifactSource, self).__init__(**kwargs) + self.managed_image = managed_image + + +class GalleryArtifactVersionSource(msrest.serialization.Model): + """The gallery artifact version source. + + :param id: The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, + user image or storage account resource. + :type id: str + :param uri: The uri of the gallery artifact version source. Currently used to specify vhd/blob + source. + :type uri: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'uri': {'key': 'uri', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + uri: Optional[str] = None, + **kwargs + ): + super(GalleryArtifactVersionSource, self).__init__(**kwargs) + self.id = id + self.uri = uri + + +class GalleryDiskImage(msrest.serialization.Model): + """This is the disk image base class. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar size_in_gb: This property indicates the size of the VHD to be created. + :vartype size_in_gb: int + :param host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and + 'ReadWrite'. Possible values include: "None", "ReadOnly", "ReadWrite". + :type host_caching: str or ~azure.mgmt.compute.v2020_09_30.models.HostCaching + :param source: The gallery artifact version source. + :type source: ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactVersionSource + """ + + _validation = { + 'size_in_gb': {'readonly': True}, + } + + _attribute_map = { + 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, + 'host_caching': {'key': 'hostCaching', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, + } + + def __init__( + self, + *, + host_caching: Optional[Union[str, "HostCaching"]] = None, + source: Optional["GalleryArtifactVersionSource"] = None, + **kwargs + ): + super(GalleryDiskImage, self).__init__(**kwargs) + self.size_in_gb = None + self.host_caching = host_caching + self.source = source + + +class GalleryDataDiskImage(GalleryDiskImage): + """This is the data disk image. + + 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 size_in_gb: This property indicates the size of the VHD to be created. + :vartype size_in_gb: int + :param host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and + 'ReadWrite'. Possible values include: "None", "ReadOnly", "ReadWrite". + :type host_caching: str or ~azure.mgmt.compute.v2020_09_30.models.HostCaching + :param source: The gallery artifact version source. + :type source: ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactVersionSource + :param lun: Required. This property specifies the logical unit number of the data disk. This + value is used to identify data disks within the Virtual Machine and therefore must be unique + for each data disk attached to the Virtual Machine. + :type lun: int + """ + + _validation = { + 'size_in_gb': {'readonly': True}, + 'lun': {'required': True}, + } + + _attribute_map = { + 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, + 'host_caching': {'key': 'hostCaching', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, + 'lun': {'key': 'lun', 'type': 'int'}, + } + + def __init__( + self, + *, + lun: int, + host_caching: Optional[Union[str, "HostCaching"]] = None, + source: Optional["GalleryArtifactVersionSource"] = None, + **kwargs + ): + super(GalleryDataDiskImage, self).__init__(host_caching=host_caching, source=source, **kwargs) + self.lun = lun + + +class GalleryIdentifier(msrest.serialization.Model): + """Describes the gallery unique name. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar unique_name: The unique name of the Shared Image Gallery. This name is generated + automatically by Azure. + :vartype unique_name: str + """ + + _validation = { + 'unique_name': {'readonly': True}, + } + + _attribute_map = { + 'unique_name': {'key': 'uniqueName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryIdentifier, self).__init__(**kwargs) + self.unique_name = None + + +class GalleryImage(Resource): + """Specifies information about the gallery image definition that you want to create or update. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this gallery image definition resource. This property is + updatable. + :type description: str + :param eula: The Eula agreement for the gallery image definition. + :type eula: str + :param privacy_statement_uri: The privacy statement uri. + :type privacy_statement_uri: str + :param release_note_uri: The release note uri. + :type release_note_uri: str + :param os_type: This property allows you to specify the type of the OS that is included in the + disk when creating a VM from a managed image. :code:`
`:code:`
` Possible values are: + :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values + include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + :param os_state: This property allows the user to specify whether the virtual machines created + under this image are 'Generalized' or 'Specialized'. Possible values include: "Generalized", + "Specialized". + :type os_state: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemStateTypes + :param hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS + disks only. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2020_09_30.models.HyperVGeneration + :param features: A list of gallery image features. + :type features: list[~azure.mgmt.compute.v2020_09_30.models.GalleryImageFeature] + :param end_of_life_date: The end of life date of the gallery image definition. This property + can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param identifier: This is the gallery image definition identifier. + :type identifier: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageIdentifier + :param recommended: The properties describe the recommended machine configuration for this + Image Definition. These properties are updatable. + :type recommended: ~azure.mgmt.compute.v2020_09_30.models.RecommendedMachineConfiguration + :param disallowed: Describes the disallowed disk types. + :type disallowed: ~azure.mgmt.compute.v2020_09_30.models.Disallowed + :param purchase_plan: Describes the gallery image definition purchase plan. This is used by + marketplace images. + :type purchase_plan: ~azure.mgmt.compute.v2020_09_30.models.ImagePurchasePlan + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryImagePropertiesProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'eula': {'key': 'properties.eula', 'type': 'str'}, + 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, + 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'os_state': {'key': 'properties.osState', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + 'features': {'key': 'properties.features', 'type': '[GalleryImageFeature]'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryImageIdentifier'}, + 'recommended': {'key': 'properties.recommended', 'type': 'RecommendedMachineConfiguration'}, + 'disallowed': {'key': 'properties.disallowed', 'type': 'Disallowed'}, + 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'ImagePurchasePlan'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + eula: Optional[str] = None, + privacy_statement_uri: Optional[str] = None, + release_note_uri: Optional[str] = None, + os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, + os_state: Optional[Union[str, "OperatingSystemStateTypes"]] = None, + hyper_v_generation: Optional[Union[str, "HyperVGeneration"]] = None, + features: Optional[List["GalleryImageFeature"]] = None, + end_of_life_date: Optional[datetime.datetime] = None, + identifier: Optional["GalleryImageIdentifier"] = None, + recommended: Optional["RecommendedMachineConfiguration"] = None, + disallowed: Optional["Disallowed"] = None, + purchase_plan: Optional["ImagePurchasePlan"] = None, + **kwargs + ): + super(GalleryImage, self).__init__(location=location, tags=tags, **kwargs) + self.description = description + self.eula = eula + self.privacy_statement_uri = privacy_statement_uri + self.release_note_uri = release_note_uri + self.os_type = os_type + self.os_state = os_state + self.hyper_v_generation = hyper_v_generation + self.features = features + self.end_of_life_date = end_of_life_date + self.identifier = identifier + self.recommended = recommended + self.disallowed = disallowed + self.purchase_plan = purchase_plan + self.provisioning_state = None + + +class GalleryImageFeature(msrest.serialization.Model): + """A feature for gallery image. + + :param name: The name of the gallery image feature. + :type name: str + :param value: The value of the gallery image feature. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + value: Optional[str] = None, + **kwargs + ): + super(GalleryImageFeature, self).__init__(**kwargs) + self.name = name + self.value = value + + +class GalleryImageIdentifier(msrest.serialization.Model): + """This is the gallery image definition identifier. + + All required parameters must be populated in order to send to Azure. + + :param publisher: Required. The name of the gallery image definition publisher. + :type publisher: str + :param offer: Required. The name of the gallery image definition offer. + :type offer: str + :param sku: Required. The name of the gallery image definition SKU. + :type sku: str + """ + + _validation = { + 'publisher': {'required': True}, + 'offer': {'required': True}, + 'sku': {'required': True}, + } + + _attribute_map = { + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'offer': {'key': 'offer', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + } + + def __init__( + self, + *, + publisher: str, + offer: str, + sku: str, + **kwargs + ): + super(GalleryImageIdentifier, self).__init__(**kwargs) + self.publisher = publisher + self.offer = offer + self.sku = sku + + +class GalleryImageList(msrest.serialization.Model): + """The List Gallery Images operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of Shared Image Gallery images. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.GalleryImage] + :param next_link: The uri to fetch the next page of Image Definitions in the Shared Image + Gallery. Call ListNext() with this to fetch the next page of gallery image definitions. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GalleryImage]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["GalleryImage"], + next_link: Optional[str] = None, + **kwargs + ): + super(GalleryImageList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class GalleryImageUpdate(UpdateResourceDefinition): + """Specifies information about the gallery image definition that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this gallery image definition resource. This property is + updatable. + :type description: str + :param eula: The Eula agreement for the gallery image definition. + :type eula: str + :param privacy_statement_uri: The privacy statement uri. + :type privacy_statement_uri: str + :param release_note_uri: The release note uri. + :type release_note_uri: str + :param os_type: This property allows you to specify the type of the OS that is included in the + disk when creating a VM from a managed image. :code:`
`:code:`
` Possible values are: + :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values + include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + :param os_state: This property allows the user to specify whether the virtual machines created + under this image are 'Generalized' or 'Specialized'. Possible values include: "Generalized", + "Specialized". + :type os_state: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemStateTypes + :param hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS + disks only. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2020_09_30.models.HyperVGeneration + :param features: A list of gallery image features. + :type features: list[~azure.mgmt.compute.v2020_09_30.models.GalleryImageFeature] + :param end_of_life_date: The end of life date of the gallery image definition. This property + can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param identifier: This is the gallery image definition identifier. + :type identifier: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageIdentifier + :param recommended: The properties describe the recommended machine configuration for this + Image Definition. These properties are updatable. + :type recommended: ~azure.mgmt.compute.v2020_09_30.models.RecommendedMachineConfiguration + :param disallowed: Describes the disallowed disk types. + :type disallowed: ~azure.mgmt.compute.v2020_09_30.models.Disallowed + :param purchase_plan: Describes the gallery image definition purchase plan. This is used by + marketplace images. + :type purchase_plan: ~azure.mgmt.compute.v2020_09_30.models.ImagePurchasePlan + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryImagePropertiesProvisioningState + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'eula': {'key': 'properties.eula', 'type': 'str'}, + 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, + 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'os_state': {'key': 'properties.osState', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + 'features': {'key': 'properties.features', 'type': '[GalleryImageFeature]'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryImageIdentifier'}, + 'recommended': {'key': 'properties.recommended', 'type': 'RecommendedMachineConfiguration'}, + 'disallowed': {'key': 'properties.disallowed', 'type': 'Disallowed'}, + 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'ImagePurchasePlan'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + eula: Optional[str] = None, + privacy_statement_uri: Optional[str] = None, + release_note_uri: Optional[str] = None, + os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, + os_state: Optional[Union[str, "OperatingSystemStateTypes"]] = None, + hyper_v_generation: Optional[Union[str, "HyperVGeneration"]] = None, + features: Optional[List["GalleryImageFeature"]] = None, + end_of_life_date: Optional[datetime.datetime] = None, + identifier: Optional["GalleryImageIdentifier"] = None, + recommended: Optional["RecommendedMachineConfiguration"] = None, + disallowed: Optional["Disallowed"] = None, + purchase_plan: Optional["ImagePurchasePlan"] = None, + **kwargs + ): + super(GalleryImageUpdate, self).__init__(tags=tags, **kwargs) + self.description = description + self.eula = eula + self.privacy_statement_uri = privacy_statement_uri + self.release_note_uri = release_note_uri + self.os_type = os_type + self.os_state = os_state + self.hyper_v_generation = hyper_v_generation + self.features = features + self.end_of_life_date = end_of_life_date + self.identifier = identifier + self.recommended = recommended + self.disallowed = disallowed + self.purchase_plan = purchase_plan + self.provisioning_state = None + + +class GalleryImageVersion(Resource): + """Specifies information about the gallery image version that you want to create or update. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param publishing_profile: Describes the basic gallery artifact publishing profile. + :type publishing_profile: + ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactPublishingProfileBase + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersionPropertiesProvisioningState + :param storage_profile: This is the storage profile of a Gallery Image Version. + :type storage_profile: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersionStorageProfile + :ivar replication_status: This is the replication status of the gallery image version. + :vartype replication_status: ~azure.mgmt.compute.v2020_09_30.models.ReplicationStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'replication_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryArtifactPublishingProfileBase'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'GalleryImageVersionStorageProfile'}, + 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + publishing_profile: Optional["GalleryArtifactPublishingProfileBase"] = None, + storage_profile: Optional["GalleryImageVersionStorageProfile"] = None, + **kwargs + ): + super(GalleryImageVersion, self).__init__(location=location, tags=tags, **kwargs) + self.publishing_profile = publishing_profile + self.provisioning_state = None + self.storage_profile = storage_profile + self.replication_status = None + + +class GalleryImageVersionList(msrest.serialization.Model): + """The List Gallery Image version operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of gallery image versions. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersion] + :param next_link: The uri to fetch the next page of gallery image versions. Call ListNext() + with this to fetch the next page of gallery image versions. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GalleryImageVersion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["GalleryImageVersion"], + next_link: Optional[str] = None, + **kwargs + ): + super(GalleryImageVersionList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class GalleryImageVersionPublishingProfile(GalleryArtifactPublishingProfileBase): + """The publishing profile of a gallery image Version. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param target_regions: The target regions where the Image Version is going to be replicated to. + This property is updatable. + :type target_regions: list[~azure.mgmt.compute.v2020_09_30.models.TargetRegion] + :param replica_count: The number of replicas of the Image Version to be created per region. + This property would take effect for a region when regionalReplicaCount is not specified. This + property is updatable. + :type replica_count: int + :param exclude_from_latest: If set to true, Virtual Machines deployed from the latest version + of the Image Definition won't use this Image Version. + :type exclude_from_latest: bool + :ivar published_date: The timestamp for when the gallery image version is published. + :vartype published_date: ~datetime.datetime + :param end_of_life_date: The end of life date of the gallery image version. This property can + be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param storage_account_type: Specifies the storage account type to be used to store the image. + This property is not updatable. Possible values include: "Standard_LRS", "Standard_ZRS", + "Premium_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2020_09_30.models.StorageAccountType + """ + + _validation = { + 'published_date': {'readonly': True}, + } + + _attribute_map = { + 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, + 'replica_count': {'key': 'replicaCount', 'type': 'int'}, + 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, + 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + } + + def __init__( + self, + *, + target_regions: Optional[List["TargetRegion"]] = None, + replica_count: Optional[int] = None, + exclude_from_latest: Optional[bool] = None, + end_of_life_date: Optional[datetime.datetime] = None, + storage_account_type: Optional[Union[str, "StorageAccountType"]] = None, + **kwargs + ): + super(GalleryImageVersionPublishingProfile, self).__init__(target_regions=target_regions, replica_count=replica_count, exclude_from_latest=exclude_from_latest, end_of_life_date=end_of_life_date, storage_account_type=storage_account_type, **kwargs) + + +class GalleryImageVersionStorageProfile(msrest.serialization.Model): + """This is the storage profile of a Gallery Image Version. + + :param source: The gallery artifact version source. + :type source: ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactVersionSource + :param os_disk_image: This is the disk image base class. + :type os_disk_image: ~azure.mgmt.compute.v2020_09_30.models.GalleryDiskImage + :param data_disk_images: A list of data disk images. + :type data_disk_images: list[~azure.mgmt.compute.v2020_09_30.models.GalleryDataDiskImage] + """ + + _attribute_map = { + 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, + 'os_disk_image': {'key': 'osDiskImage', 'type': 'GalleryDiskImage'}, + 'data_disk_images': {'key': 'dataDiskImages', 'type': '[GalleryDataDiskImage]'}, + } + + def __init__( + self, + *, + source: Optional["GalleryArtifactVersionSource"] = None, + os_disk_image: Optional["GalleryDiskImage"] = None, + data_disk_images: Optional[List["GalleryDataDiskImage"]] = None, + **kwargs + ): + super(GalleryImageVersionStorageProfile, self).__init__(**kwargs) + self.source = source + self.os_disk_image = os_disk_image + self.data_disk_images = data_disk_images + + +class GalleryImageVersionUpdate(UpdateResourceDefinition): + """Specifies information about the gallery image version that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param publishing_profile: Describes the basic gallery artifact publishing profile. + :type publishing_profile: + ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactPublishingProfileBase + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersionPropertiesProvisioningState + :param storage_profile: This is the storage profile of a Gallery Image Version. + :type storage_profile: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersionStorageProfile + :ivar replication_status: This is the replication status of the gallery image version. + :vartype replication_status: ~azure.mgmt.compute.v2020_09_30.models.ReplicationStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'replication_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryArtifactPublishingProfileBase'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'GalleryImageVersionStorageProfile'}, + 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + publishing_profile: Optional["GalleryArtifactPublishingProfileBase"] = None, + storage_profile: Optional["GalleryImageVersionStorageProfile"] = None, + **kwargs + ): + super(GalleryImageVersionUpdate, self).__init__(tags=tags, **kwargs) + self.publishing_profile = publishing_profile + self.provisioning_state = None + self.storage_profile = storage_profile + self.replication_status = None + + +class GalleryList(msrest.serialization.Model): + """The List Galleries operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of galleries. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.Gallery] + :param next_link: The uri to fetch the next page of galleries. Call ListNext() with this to + fetch the next page of galleries. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Gallery]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Gallery"], + next_link: Optional[str] = None, + **kwargs + ): + super(GalleryList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class GalleryOSDiskImage(GalleryDiskImage): + """This is the OS disk image. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar size_in_gb: This property indicates the size of the VHD to be created. + :vartype size_in_gb: int + :param host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and + 'ReadWrite'. Possible values include: "None", "ReadOnly", "ReadWrite". + :type host_caching: str or ~azure.mgmt.compute.v2020_09_30.models.HostCaching + :param source: The gallery artifact version source. + :type source: ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactVersionSource + """ + + _validation = { + 'size_in_gb': {'readonly': True}, + } + + _attribute_map = { + 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, + 'host_caching': {'key': 'hostCaching', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, + } + + def __init__( + self, + *, + host_caching: Optional[Union[str, "HostCaching"]] = None, + source: Optional["GalleryArtifactVersionSource"] = None, + **kwargs + ): + super(GalleryOSDiskImage, self).__init__(host_caching=host_caching, source=source, **kwargs) + + +class GalleryUpdate(UpdateResourceDefinition): + """Specifies information about the Shared Image Gallery that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this Shared Image Gallery resource. This property is + updatable. + :type description: str + :param identifier: Describes the gallery unique name. + :type identifier: ~azure.mgmt.compute.v2020_09_30.models.GalleryIdentifier + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryPropertiesProvisioningState + :param sharing_profile: Profile for gallery sharing to subscription or tenant. + :type sharing_profile: ~azure.mgmt.compute.v2020_09_30.models.SharingProfile + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryIdentifier'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'sharing_profile': {'key': 'properties.sharingProfile', 'type': 'SharingProfile'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + identifier: Optional["GalleryIdentifier"] = None, + sharing_profile: Optional["SharingProfile"] = None, + **kwargs + ): + super(GalleryUpdate, self).__init__(tags=tags, **kwargs) + self.description = description + self.identifier = identifier + self.provisioning_state = None + self.sharing_profile = sharing_profile + + +class ImagePurchasePlan(msrest.serialization.Model): + """Describes the gallery image definition purchase plan. This is used by marketplace images. + + :param name: The plan ID. + :type name: str + :param publisher: The publisher ID. + :type publisher: str + :param product: The product ID. + :type product: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + publisher: Optional[str] = None, + product: Optional[str] = None, + **kwargs + ): + super(ImagePurchasePlan, self).__init__(**kwargs) + self.name = name + self.publisher = publisher + self.product = product + + +class InnerError(msrest.serialization.Model): + """Inner error details. + + :param exceptiontype: The exception type. + :type exceptiontype: str + :param errordetail: The internal error message or exception dump. + :type errordetail: str + """ + + _attribute_map = { + 'exceptiontype': {'key': 'exceptiontype', 'type': 'str'}, + 'errordetail': {'key': 'errordetail', 'type': 'str'}, + } + + def __init__( + self, + *, + exceptiontype: Optional[str] = None, + errordetail: Optional[str] = None, + **kwargs + ): + super(InnerError, self).__init__(**kwargs) + self.exceptiontype = exceptiontype + self.errordetail = errordetail + + +class ManagedArtifact(msrest.serialization.Model): + """The managed artifact. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The managed artifact id. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: str, + **kwargs + ): + super(ManagedArtifact, self).__init__(**kwargs) + self.id = id + + +class OSDiskImageEncryption(DiskImageEncryption): + """Contains encryption settings for an OS disk image. + + :param disk_encryption_set_id: A relative URI containing the resource ID of the disk encryption + set. + :type disk_encryption_set_id: str + """ + + _attribute_map = { + 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, + } + + def __init__( + self, + *, + disk_encryption_set_id: Optional[str] = None, + **kwargs + ): + super(OSDiskImageEncryption, self).__init__(disk_encryption_set_id=disk_encryption_set_id, **kwargs) + + +class PirResource(msrest.serialization.Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PirResource, self).__init__(**kwargs) + self.name = None + self.location = None + + +class PirSharedGalleryResource(PirResource): + """Base information about the shared gallery resource in pir. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + :param unique_id: The unique id of this shared gallery. + :type unique_id: str + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'unique_id': {'key': 'identifier.uniqueId', 'type': 'str'}, + } + + def __init__( + self, + *, + unique_id: Optional[str] = None, + **kwargs + ): + super(PirSharedGalleryResource, self).__init__(**kwargs) + self.unique_id = unique_id + + +class RecommendedMachineConfiguration(msrest.serialization.Model): + """The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. + + :param v_cp_us: Describes the resource range. + :type v_cp_us: ~azure.mgmt.compute.v2020_09_30.models.ResourceRange + :param memory: Describes the resource range. + :type memory: ~azure.mgmt.compute.v2020_09_30.models.ResourceRange + """ + + _attribute_map = { + 'v_cp_us': {'key': 'vCPUs', 'type': 'ResourceRange'}, + 'memory': {'key': 'memory', 'type': 'ResourceRange'}, + } + + def __init__( + self, + *, + v_cp_us: Optional["ResourceRange"] = None, + memory: Optional["ResourceRange"] = None, + **kwargs + ): + super(RecommendedMachineConfiguration, self).__init__(**kwargs) + self.v_cp_us = v_cp_us + self.memory = memory + + +class RegionalReplicationStatus(msrest.serialization.Model): + """This is the regional replication status. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar region: The region to which the gallery image version is being replicated to. + :vartype region: str + :ivar state: This is the regional replication state. Possible values include: "Unknown", + "Replicating", "Completed", "Failed". + :vartype state: str or ~azure.mgmt.compute.v2020_09_30.models.ReplicationState + :ivar details: The details of the replication status. + :vartype details: str + :ivar progress: It indicates progress of the replication job. + :vartype progress: int + """ + + _validation = { + 'region': {'readonly': True}, + 'state': {'readonly': True}, + 'details': {'readonly': True}, + 'progress': {'readonly': True}, + } + + _attribute_map = { + 'region': {'key': 'region', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'details': {'key': 'details', 'type': 'str'}, + 'progress': {'key': 'progress', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(RegionalReplicationStatus, self).__init__(**kwargs) + self.region = None + self.state = None + self.details = None + self.progress = None + + +class ReplicationStatus(msrest.serialization.Model): + """This is the replication status of the gallery image version. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar aggregated_state: This is the aggregated replication status based on all the regional + replication status flags. Possible values include: "Unknown", "InProgress", "Completed", + "Failed". + :vartype aggregated_state: str or + ~azure.mgmt.compute.v2020_09_30.models.AggregatedReplicationState + :ivar summary: This is a summary of replication status for each region. + :vartype summary: list[~azure.mgmt.compute.v2020_09_30.models.RegionalReplicationStatus] + """ + + _validation = { + 'aggregated_state': {'readonly': True}, + 'summary': {'readonly': True}, + } + + _attribute_map = { + 'aggregated_state': {'key': 'aggregatedState', 'type': 'str'}, + 'summary': {'key': 'summary', 'type': '[RegionalReplicationStatus]'}, + } + + def __init__( + self, + **kwargs + ): + super(ReplicationStatus, self).__init__(**kwargs) + self.aggregated_state = None + self.summary = None + + +class ResourceRange(msrest.serialization.Model): + """Describes the resource range. + + :param min: The minimum number of the resource. + :type min: int + :param max: The maximum number of the resource. + :type max: int + """ + + _attribute_map = { + 'min': {'key': 'min', 'type': 'int'}, + 'max': {'key': 'max', 'type': 'int'}, + } + + def __init__( + self, + *, + min: Optional[int] = None, + max: Optional[int] = None, + **kwargs + ): + super(ResourceRange, self).__init__(**kwargs) + self.min = min + self.max = max + + +class SharedGallery(PirSharedGalleryResource): + """Specifies information about the Shared Gallery that you want to create or update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + :param unique_id: The unique id of this shared gallery. + :type unique_id: str + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'unique_id': {'key': 'identifier.uniqueId', 'type': 'str'}, + } + + def __init__( + self, + *, + unique_id: Optional[str] = None, + **kwargs + ): + super(SharedGallery, self).__init__(unique_id=unique_id, **kwargs) + + +class SharedGalleryImage(PirSharedGalleryResource): + """Specifies information about the gallery image definition that you want to create or update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + :param unique_id: The unique id of this shared gallery. + :type unique_id: str + :param os_type: This property allows you to specify the type of the OS that is included in the + disk when creating a VM from a managed image. :code:`
`:code:`
` Possible values are: + :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values + include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + :param os_state: This property allows the user to specify whether the virtual machines created + under this image are 'Generalized' or 'Specialized'. Possible values include: "Generalized", + "Specialized". + :type os_state: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemStateTypes + :param end_of_life_date: The end of life date of the gallery image definition. This property + can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param identifier: This is the gallery image definition identifier. + :type identifier: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageIdentifier + :param recommended: The properties describe the recommended machine configuration for this + Image Definition. These properties are updatable. + :type recommended: ~azure.mgmt.compute.v2020_09_30.models.RecommendedMachineConfiguration + :param disallowed: Describes the disallowed disk types. + :type disallowed: ~azure.mgmt.compute.v2020_09_30.models.Disallowed + :param hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS + disks only. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2020_09_30.models.HyperVGeneration + :param features: A list of gallery image features. + :type features: list[~azure.mgmt.compute.v2020_09_30.models.GalleryImageFeature] + :param purchase_plan: Describes the gallery image definition purchase plan. This is used by + marketplace images. + :type purchase_plan: ~azure.mgmt.compute.v2020_09_30.models.ImagePurchasePlan + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'unique_id': {'key': 'identifier.uniqueId', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'os_state': {'key': 'properties.osState', 'type': 'str'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryImageIdentifier'}, + 'recommended': {'key': 'properties.recommended', 'type': 'RecommendedMachineConfiguration'}, + 'disallowed': {'key': 'properties.disallowed', 'type': 'Disallowed'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + 'features': {'key': 'properties.features', 'type': '[GalleryImageFeature]'}, + 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'ImagePurchasePlan'}, + } + + def __init__( + self, + *, + unique_id: Optional[str] = None, + os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, + os_state: Optional[Union[str, "OperatingSystemStateTypes"]] = None, + end_of_life_date: Optional[datetime.datetime] = None, + identifier: Optional["GalleryImageIdentifier"] = None, + recommended: Optional["RecommendedMachineConfiguration"] = None, + disallowed: Optional["Disallowed"] = None, + hyper_v_generation: Optional[Union[str, "HyperVGeneration"]] = None, + features: Optional[List["GalleryImageFeature"]] = None, + purchase_plan: Optional["ImagePurchasePlan"] = None, + **kwargs + ): + super(SharedGalleryImage, self).__init__(unique_id=unique_id, **kwargs) + self.os_type = os_type + self.os_state = os_state + self.end_of_life_date = end_of_life_date + self.identifier = identifier + self.recommended = recommended + self.disallowed = disallowed + self.hyper_v_generation = hyper_v_generation + self.features = features + self.purchase_plan = purchase_plan + + +class SharedGalleryImageList(msrest.serialization.Model): + """The List Shared Gallery Images operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of shared gallery images. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.SharedGalleryImage] + :param next_link: The uri to fetch the next page of shared gallery images. Call ListNext() with + this to fetch the next page of shared gallery images. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SharedGalleryImage]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["SharedGalleryImage"], + next_link: Optional[str] = None, + **kwargs + ): + super(SharedGalleryImageList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SharedGalleryImageVersion(PirSharedGalleryResource): + """Specifies information about the gallery image version that you want to create or update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + :param unique_id: The unique id of this shared gallery. + :type unique_id: str + :param published_date: The published date of the gallery image version Definition. This + property can be used for decommissioning purposes. This property is updatable. + :type published_date: ~datetime.datetime + :param end_of_life_date: The end of life date of the gallery image version Definition. This + property can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'unique_id': {'key': 'identifier.uniqueId', 'type': 'str'}, + 'published_date': {'key': 'properties.publishedDate', 'type': 'iso-8601'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + unique_id: Optional[str] = None, + published_date: Optional[datetime.datetime] = None, + end_of_life_date: Optional[datetime.datetime] = None, + **kwargs + ): + super(SharedGalleryImageVersion, self).__init__(unique_id=unique_id, **kwargs) + self.published_date = published_date + self.end_of_life_date = end_of_life_date + + +class SharedGalleryImageVersionList(msrest.serialization.Model): + """The List Shared Gallery Image versions operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of shared gallery images versions. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.SharedGalleryImageVersion] + :param next_link: The uri to fetch the next page of shared gallery image versions. Call + ListNext() with this to fetch the next page of shared gallery image versions. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SharedGalleryImageVersion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["SharedGalleryImageVersion"], + next_link: Optional[str] = None, + **kwargs + ): + super(SharedGalleryImageVersionList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SharedGalleryList(msrest.serialization.Model): + """The List Shared Galleries operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of shared galleries. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.PirSharedGalleryResource] + :param next_link: The uri to fetch the next page of shared galleries. Call ListNext() with this + to fetch the next page of shared galleries. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PirSharedGalleryResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["PirSharedGalleryResource"], + next_link: Optional[str] = None, + **kwargs + ): + super(SharedGalleryList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SharingProfile(msrest.serialization.Model): + """Profile for gallery sharing to subscription or tenant. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param permissions: This property allows you to specify the permission of sharing gallery. + :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **Private** + :code:`
`:code:`
` **Groups**. Possible values include: "Private", "Groups". + :type permissions: str or ~azure.mgmt.compute.v2020_09_30.models.GallerySharingPermissionTypes + :ivar groups: A list of sharing profile groups. + :vartype groups: list[~azure.mgmt.compute.v2020_09_30.models.SharingProfileGroup] + """ + + _validation = { + 'groups': {'readonly': True}, + } + + _attribute_map = { + 'permissions': {'key': 'permissions', 'type': 'str'}, + 'groups': {'key': 'groups', 'type': '[SharingProfileGroup]'}, + } + + def __init__( + self, + *, + permissions: Optional[Union[str, "GallerySharingPermissionTypes"]] = None, + **kwargs + ): + super(SharingProfile, self).__init__(**kwargs) + self.permissions = permissions + self.groups = None + + +class SharingProfileGroup(msrest.serialization.Model): + """Group of the gallery sharing profile. + + :param type: This property allows you to specify the type of sharing group. + :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **Subscriptions** + :code:`
`:code:`
` **AADTenants**. Possible values include: "Subscriptions", + "AADTenants". + :type type: str or ~azure.mgmt.compute.v2020_09_30.models.SharingProfileGroupTypes + :param ids: A list of subscription/tenant ids the gallery is aimed to be shared to. + :type ids: list[str] + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'ids': {'key': 'ids', 'type': '[str]'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "SharingProfileGroupTypes"]] = None, + ids: Optional[List[str]] = None, + **kwargs + ): + super(SharingProfileGroup, self).__init__(**kwargs) + self.type = type + self.ids = ids + + +class SharingUpdate(msrest.serialization.Model): + """Specifies information about the gallery sharing profile update. + + All required parameters must be populated in order to send to Azure. + + :param operation_type: Required. This property allows you to specify the operation type of + gallery sharing update. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` + **Add** :code:`
`:code:`
` **Remove** :code:`
`:code:`
` **Reset**. Possible values + include: "Add", "Remove", "Reset". + :type operation_type: str or ~azure.mgmt.compute.v2020_09_30.models.SharingUpdateOperationTypes + :param groups: A list of sharing profile groups. + :type groups: list[~azure.mgmt.compute.v2020_09_30.models.SharingProfileGroup] + """ + + _validation = { + 'operation_type': {'required': True}, + } + + _attribute_map = { + 'operation_type': {'key': 'operationType', 'type': 'str'}, + 'groups': {'key': 'groups', 'type': '[SharingProfileGroup]'}, + } + + def __init__( + self, + *, + operation_type: Union[str, "SharingUpdateOperationTypes"], + groups: Optional[List["SharingProfileGroup"]] = None, + **kwargs + ): + super(SharingUpdate, self).__init__(**kwargs) + self.operation_type = operation_type + self.groups = groups + + +class TargetRegion(msrest.serialization.Model): + """Describes the target region information. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the region. + :type name: str + :param regional_replica_count: The number of replicas of the Image Version to be created per + region. This property is updatable. + :type regional_replica_count: int + :param storage_account_type: Specifies the storage account type to be used to store the image. + This property is not updatable. Possible values include: "Standard_LRS", "Standard_ZRS", + "Premium_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2020_09_30.models.StorageAccountType + :param encryption: Optional. Allows users to provide customer managed keys for encrypting the + OS and data disks in the gallery artifact. + :type encryption: ~azure.mgmt.compute.v2020_09_30.models.EncryptionImages + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'regional_replica_count': {'key': 'regionalReplicaCount', 'type': 'int'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'encryption': {'key': 'encryption', 'type': 'EncryptionImages'}, + } + + def __init__( + self, + *, + name: str, + regional_replica_count: Optional[int] = None, + storage_account_type: Optional[Union[str, "StorageAccountType"]] = None, + encryption: Optional["EncryptionImages"] = None, + **kwargs + ): + super(TargetRegion, self).__init__(**kwargs) + self.name = name + self.regional_replica_count = regional_replica_count + self.storage_account_type = storage_account_type + self.encryption = encryption + + +class UserArtifactManage(msrest.serialization.Model): + """UserArtifactManage. + + All required parameters must be populated in order to send to Azure. + + :param install: Required. Required. The path and arguments to install the gallery application. + This is limited to 4096 characters. + :type install: str + :param remove: Required. Required. The path and arguments to remove the gallery application. + This is limited to 4096 characters. + :type remove: str + :param update: Optional. The path and arguments to update the gallery application. If not + present, then update operation will invoke remove command on the previous version and install + command on the current version of the gallery application. This is limited to 4096 characters. + :type update: str + """ + + _validation = { + 'install': {'required': True}, + 'remove': {'required': True}, + } + + _attribute_map = { + 'install': {'key': 'install', 'type': 'str'}, + 'remove': {'key': 'remove', 'type': 'str'}, + 'update': {'key': 'update', 'type': 'str'}, + } + + def __init__( + self, + *, + install: str, + remove: str, + update: Optional[str] = None, + **kwargs + ): + super(UserArtifactManage, self).__init__(**kwargs) + self.install = install + self.remove = remove + self.update = update + + +class UserArtifactSource(msrest.serialization.Model): + """The source image from which the Image Version is going to be created. + + All required parameters must be populated in order to send to Azure. + + :param media_link: Required. Required. The mediaLink of the artifact, must be a readable + storage page blob. + :type media_link: str + :param default_configuration_link: Optional. The defaultConfigurationLink of the artifact, must + be a readable storage page blob. + :type default_configuration_link: str + """ + + _validation = { + 'media_link': {'required': True}, + } + + _attribute_map = { + 'media_link': {'key': 'mediaLink', 'type': 'str'}, + 'default_configuration_link': {'key': 'defaultConfigurationLink', 'type': 'str'}, + } + + def __init__( + self, + *, + media_link: str, + default_configuration_link: Optional[str] = None, + **kwargs + ): + super(UserArtifactSource, self).__init__(**kwargs) + self.media_link = media_link + self.default_configuration_link = default_configuration_link diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/__init__.py new file mode 100644 index 000000000000..2999cc9432ab --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/__init__.py @@ -0,0 +1,29 @@ +# 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 ._galleries_operations import GalleriesOperations +from ._gallery_images_operations import GalleryImagesOperations +from ._gallery_image_versions_operations import GalleryImageVersionsOperations +from ._gallery_applications_operations import GalleryApplicationsOperations +from ._gallery_application_versions_operations import GalleryApplicationVersionsOperations +from ._gallery_sharing_profile_operations import GallerySharingProfileOperations +from ._shared_galleries_operations import SharedGalleriesOperations +from ._shared_gallery_images_operations import SharedGalleryImagesOperations +from ._shared_gallery_image_versions_operations import SharedGalleryImageVersionsOperations + +__all__ = [ + 'GalleriesOperations', + 'GalleryImagesOperations', + 'GalleryImageVersionsOperations', + 'GalleryApplicationsOperations', + 'GalleryApplicationVersionsOperations', + 'GallerySharingProfileOperations', + 'SharedGalleriesOperations', + 'SharedGalleryImagesOperations', + 'SharedGalleryImageVersionsOperations', +] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_galleries_operations.py new file mode 100644 index 000000000000..448221a7ecbb --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_galleries_operations.py @@ -0,0 +1,621 @@ +# 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 GalleriesOperations(object): + """GalleriesOperations 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.mgmt.compute.v2020_09_30.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 + gallery_name, # type: str + gallery, # type: "_models.Gallery" + **kwargs # type: Any + ): + # type: (...) -> "_models.Gallery" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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(gallery, 'Gallery') + 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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Gallery', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Gallery', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Gallery', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery, # type: "_models.Gallery" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Gallery"] + """Create or update a Shared Image Gallery. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery. The allowed characters are alphabets + and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. + :type gallery_name: str + :param gallery: Parameters supplied to the create or update Shared Image Gallery operation. + :type gallery: ~azure.mgmt.compute.v2020_09_30.models.Gallery + :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: True for ARMPolling, False for no polling, or a + polling object for 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 Gallery or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_09_30.models.Gallery] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] + 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, + gallery_name=gallery_name, + gallery=gallery, + 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('Gallery', 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery, # type: "_models.GalleryUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.Gallery" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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(gallery, 'GalleryUpdate') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Gallery', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery, # type: "_models.GalleryUpdate" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Gallery"] + """Update a Shared Image Gallery. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery. The allowed characters are alphabets + and numbers with dots and periods allowed in the middle. The maximum length is 80 characters. + :type gallery_name: str + :param gallery: Parameters supplied to the update Shared Image Gallery operation. + :type gallery: ~azure.mgmt.compute.v2020_09_30.models.GalleryUpdate + :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: True for ARMPolling, False for no polling, or a + polling object for 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 Gallery or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_09_30.models.Gallery] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] + 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, + gallery_name=gallery_name, + gallery=gallery, + 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('Gallery', 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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.Compute/galleries/{galleryName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + gallery_name, # type: str + select=None, # type: Optional[Union[str, "_models.SelectPermissions"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.Gallery" + """Retrieves information about a Shared Image Gallery. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery. + :type gallery_name: str + :param select: The select expression to apply on the operation. + :type select: str or ~azure.mgmt.compute.v2020_09_30.models.SelectPermissions + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Gallery, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.Gallery + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Gallery"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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 select is not None: + query_parameters['$select'] = self._serialize.query("select", select, '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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Gallery', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + gallery_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-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + gallery_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Delete a Shared Image Gallery. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery to be deleted. + :type gallery_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: True for ARMPolling, False for no polling, or a + polling object for 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, + gallery_name=gallery_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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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.Compute/galleries/{galleryName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.GalleryList"] + """List galleries under a resource group. + + :param resource_group_name: The name of the resource group. + :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 GalleryList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_09_30.models.GalleryList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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('GalleryList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.GalleryList"] + """List galleries under a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GalleryList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_09_30.models.GalleryList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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('GalleryList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/galleries'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_application_versions_operations.py new file mode 100644 index 000000000000..1ad0a7eb7ec3 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_application_versions_operations.py @@ -0,0 +1,630 @@ +# 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 GalleryApplicationVersionsOperations(object): + """GalleryApplicationVersionsOperations 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.mgmt.compute.v2020_09_30.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 + gallery_name, # type: str + gallery_application_name, # type: str + gallery_application_version_name, # type: str + gallery_application_version, # type: "_models.GalleryApplicationVersion" + **kwargs # type: Any + ): + # type: (...) -> "_models.GalleryApplicationVersion" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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(gallery_application_version, 'GalleryApplicationVersion') + 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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('GalleryApplicationVersion', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('GalleryApplicationVersion', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('GalleryApplicationVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_application_name, # type: str + gallery_application_version_name, # type: str + gallery_application_version, # type: "_models.GalleryApplicationVersion" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.GalleryApplicationVersion"] + """Create or update a gallery Application Version. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Application Gallery in which the Application + Definition resides. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application Definition in which the + Application Version is to be created. + :type gallery_application_name: str + :param gallery_application_version_name: The name of the gallery Application Version to be + created. Needs to follow semantic version name pattern: The allowed characters are digit and + period. Digits must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. + :type gallery_application_version_name: str + :param gallery_application_version: Parameters supplied to the create or update gallery + Application Version operation. + :type gallery_application_version: ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersion + :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: True for ARMPolling, False for no polling, or a + polling object for 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 GalleryApplicationVersion or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] + 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, + gallery_name=gallery_name, + gallery_application_name=gallery_application_name, + gallery_application_version_name=gallery_application_version_name, + gallery_application_version=gallery_application_version, + 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('GalleryApplicationVersion', 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_application_name, # type: str + gallery_application_version_name, # type: str + gallery_application_version, # type: "_models.GalleryApplicationVersionUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.GalleryApplicationVersion" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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(gallery_application_version, 'GalleryApplicationVersionUpdate') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GalleryApplicationVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_application_name, # type: str + gallery_application_version_name, # type: str + gallery_application_version, # type: "_models.GalleryApplicationVersionUpdate" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.GalleryApplicationVersion"] + """Update a gallery Application Version. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Application Gallery in which the Application + Definition resides. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application Definition in which the + Application Version is to be updated. + :type gallery_application_name: str + :param gallery_application_version_name: The name of the gallery Application Version to be + updated. Needs to follow semantic version name pattern: The allowed characters are digit and + period. Digits must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. + :type gallery_application_version_name: str + :param gallery_application_version: Parameters supplied to the update gallery Application + Version operation. + :type gallery_application_version: ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersionUpdate + :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: True for ARMPolling, False for no polling, or a + polling object for 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 GalleryApplicationVersion or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] + 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, + gallery_name=gallery_name, + gallery_application_name=gallery_application_name, + gallery_application_version_name=gallery_application_version_name, + gallery_application_version=gallery_application_version, + 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('GalleryApplicationVersion', 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_application_name, # type: str + gallery_application_version_name, # type: str + expand=None, # type: Optional[Union[str, "_models.ReplicationStatusTypes"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.GalleryApplicationVersion" + """Retrieves information about a gallery Application Version. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Application Gallery in which the Application + Definition resides. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application Definition in which the + Application Version resides. + :type gallery_application_name: str + :param gallery_application_version_name: The name of the gallery Application Version to be + retrieved. + :type gallery_application_version_name: str + :param expand: The expand expression to apply on the operation. + :type expand: str or ~azure.mgmt.compute.v2020_09_30.models.ReplicationStatusTypes + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GalleryApplicationVersion, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GalleryApplicationVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_application_name, # type: str + gallery_application_version_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-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_application_name, # type: str + gallery_application_version_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Delete a gallery Application Version. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Application Gallery in which the Application + Definition resides. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application Definition in which the + Application Version resides. + :type gallery_application_name: str + :param gallery_application_version_name: The name of the gallery Application Version to be + deleted. + :type gallery_application_version_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: True for ARMPolling, False for no polling, or a + polling object for 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, + gallery_name=gallery_name, + gallery_application_name=gallery_application_name, + gallery_application_version_name=gallery_application_version_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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_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.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} # type: ignore + + def list_by_gallery_application( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_application_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.GalleryApplicationVersionList"] + """List gallery Application Versions in a gallery Application Definition. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Application Gallery in which the Application + Definition resides. + :type gallery_name: str + :param gallery_application_name: The name of the Shared Application Gallery Application + Definition from which the Application Versions are to be listed. + :type gallery_application_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GalleryApplicationVersionList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersionList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationVersionList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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_gallery_application.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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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('GalleryApplicationVersionList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_gallery_application.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_applications_operations.py new file mode 100644 index 000000000000..0bf8b612236c --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_applications_operations.py @@ -0,0 +1,587 @@ +# 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 GalleryApplicationsOperations(object): + """GalleryApplicationsOperations 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.mgmt.compute.v2020_09_30.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 + gallery_name, # type: str + gallery_application_name, # type: str + gallery_application, # type: "_models.GalleryApplication" + **kwargs # type: Any + ): + # type: (...) -> "_models.GalleryApplication" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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(gallery_application, 'GalleryApplication') + 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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('GalleryApplication', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('GalleryApplication', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('GalleryApplication', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_application_name, # type: str + gallery_application, # type: "_models.GalleryApplication" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.GalleryApplication"] + """Create or update a gallery Application Definition. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Application Gallery in which the Application + Definition is to be created. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application Definition to be created + or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods + allowed in the middle. The maximum length is 80 characters. + :type gallery_application_name: str + :param gallery_application: Parameters supplied to the create or update gallery Application + operation. + :type gallery_application: ~azure.mgmt.compute.v2020_09_30.models.GalleryApplication + :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: True for ARMPolling, False for no polling, or a + polling object for 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 GalleryApplication or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_09_30.models.GalleryApplication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] + 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, + gallery_name=gallery_name, + gallery_application_name=gallery_application_name, + gallery_application=gallery_application, + 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('GalleryApplication', 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_application_name, # type: str + gallery_application, # type: "_models.GalleryApplicationUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.GalleryApplication" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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(gallery_application, 'GalleryApplicationUpdate') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GalleryApplication', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_application_name, # type: str + gallery_application, # type: "_models.GalleryApplicationUpdate" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.GalleryApplication"] + """Update a gallery Application Definition. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Application Gallery in which the Application + Definition is to be updated. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application Definition to be updated. + The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the + middle. The maximum length is 80 characters. + :type gallery_application_name: str + :param gallery_application: Parameters supplied to the update gallery Application operation. + :type gallery_application: ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationUpdate + :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: True for ARMPolling, False for no polling, or a + polling object for 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 GalleryApplication or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_09_30.models.GalleryApplication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] + 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, + gallery_name=gallery_name, + gallery_application_name=gallery_application_name, + gallery_application=gallery_application, + 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('GalleryApplication', 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_application_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.GalleryApplication" + """Retrieves information about a gallery Application Definition. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Application Gallery from which the Application + Definitions are to be retrieved. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application Definition to be + retrieved. + :type gallery_application_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GalleryApplication, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.GalleryApplication + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplication"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GalleryApplication', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_application_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-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_application_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Delete a gallery Application. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Application Gallery in which the Application + Definition is to be deleted. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application Definition to be deleted. + :type gallery_application_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: True for ARMPolling, False for no polling, or a + polling object for 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, + gallery_name=gallery_name, + gallery_application_name=gallery_application_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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_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.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} # type: ignore + + def list_by_gallery( + self, + resource_group_name, # type: str + gallery_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.GalleryApplicationList"] + """List gallery Application Definitions in a gallery. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Application Gallery from which Application + Definitions are to be listed. + :type gallery_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GalleryApplicationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryApplicationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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_gallery.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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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('GalleryApplicationList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_gallery.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_image_versions_operations.py new file mode 100644 index 000000000000..86712d4e28d1 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_image_versions_operations.py @@ -0,0 +1,628 @@ +# 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 GalleryImageVersionsOperations(object): + """GalleryImageVersionsOperations 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.mgmt.compute.v2020_09_30.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 + gallery_name, # type: str + gallery_image_name, # type: str + gallery_image_version_name, # type: str + gallery_image_version, # type: "_models.GalleryImageVersion" + **kwargs # type: Any + ): + # type: (...) -> "_models.GalleryImageVersion" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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(gallery_image_version, 'GalleryImageVersion') + 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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('GalleryImageVersion', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('GalleryImageVersion', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('GalleryImageVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_image_name, # type: str + gallery_image_version_name, # type: str + gallery_image_version, # type: "_models.GalleryImageVersion" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.GalleryImageVersion"] + """Create or update a gallery image version. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery in which the Image Definition + resides. + :type gallery_name: str + :param gallery_image_name: The name of the gallery image definition in which the Image Version + is to be created. + :type gallery_image_name: str + :param gallery_image_version_name: The name of the gallery image version to be created. Needs + to follow semantic version name pattern: The allowed characters are digit and period. Digits + must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. + :type gallery_image_version_name: str + :param gallery_image_version: Parameters supplied to the create or update gallery image version + operation. + :type gallery_image_version: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersion + :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: True for ARMPolling, False for no polling, or a + polling object for 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 GalleryImageVersion or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] + 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, + gallery_name=gallery_name, + gallery_image_name=gallery_image_name, + gallery_image_version_name=gallery_image_version_name, + gallery_image_version=gallery_image_version, + 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('GalleryImageVersion', 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_image_name, # type: str + gallery_image_version_name, # type: str + gallery_image_version, # type: "_models.GalleryImageVersionUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.GalleryImageVersion" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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(gallery_image_version, 'GalleryImageVersionUpdate') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GalleryImageVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_image_name, # type: str + gallery_image_version_name, # type: str + gallery_image_version, # type: "_models.GalleryImageVersionUpdate" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.GalleryImageVersion"] + """Update a gallery image version. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery in which the Image Definition + resides. + :type gallery_name: str + :param gallery_image_name: The name of the gallery image definition in which the Image Version + is to be updated. + :type gallery_image_name: str + :param gallery_image_version_name: The name of the gallery image version to be updated. Needs + to follow semantic version name pattern: The allowed characters are digit and period. Digits + must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. + :type gallery_image_version_name: str + :param gallery_image_version: Parameters supplied to the update gallery image version + operation. + :type gallery_image_version: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersionUpdate + :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: True for ARMPolling, False for no polling, or a + polling object for 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 GalleryImageVersion or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] + 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, + gallery_name=gallery_name, + gallery_image_name=gallery_image_name, + gallery_image_version_name=gallery_image_version_name, + gallery_image_version=gallery_image_version, + 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('GalleryImageVersion', 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_image_name, # type: str + gallery_image_version_name, # type: str + expand=None, # type: Optional[Union[str, "_models.ReplicationStatusTypes"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.GalleryImageVersion" + """Retrieves information about a gallery image version. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery in which the Image Definition + resides. + :type gallery_name: str + :param gallery_image_name: The name of the gallery image definition in which the Image Version + resides. + :type gallery_image_name: str + :param gallery_image_version_name: The name of the gallery image version to be retrieved. + :type gallery_image_version_name: str + :param expand: The expand expression to apply on the operation. + :type expand: str or ~azure.mgmt.compute.v2020_09_30.models.ReplicationStatusTypes + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GalleryImageVersion, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GalleryImageVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_image_name, # type: str + gallery_image_version_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-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_image_name, # type: str + gallery_image_version_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Delete a gallery image version. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery in which the Image Definition + resides. + :type gallery_name: str + :param gallery_image_name: The name of the gallery image definition in which the Image Version + resides. + :type gallery_image_name: str + :param gallery_image_version_name: The name of the gallery image version to be deleted. + :type gallery_image_version_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: True for ARMPolling, False for no polling, or a + polling object for 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, + gallery_name=gallery_name, + gallery_image_name=gallery_image_name, + gallery_image_version_name=gallery_image_version_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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore + + def list_by_gallery_image( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_image_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.GalleryImageVersionList"] + """List gallery image versions in a gallery image definition. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery in which the Image Definition + resides. + :type gallery_name: str + :param gallery_image_name: The name of the Shared Image Gallery Image Definition from which the + Image Versions are to be listed. + :type gallery_image_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GalleryImageVersionList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersionList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageVersionList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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_gallery_image.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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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('GalleryImageVersionList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_gallery_image.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_images_operations.py new file mode 100644 index 000000000000..509f62eb2577 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_images_operations.py @@ -0,0 +1,585 @@ +# 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 GalleryImagesOperations(object): + """GalleryImagesOperations 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.mgmt.compute.v2020_09_30.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 + gallery_name, # type: str + gallery_image_name, # type: str + gallery_image, # type: "_models.GalleryImage" + **kwargs # type: Any + ): + # type: (...) -> "_models.GalleryImage" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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(gallery_image, 'GalleryImage') + 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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('GalleryImage', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('GalleryImage', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('GalleryImage', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_image_name, # type: str + gallery_image, # type: "_models.GalleryImage" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.GalleryImage"] + """Create or update a gallery image definition. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to + be created. + :type gallery_name: str + :param gallery_image_name: The name of the gallery image definition to be created or updated. + The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the + middle. The maximum length is 80 characters. + :type gallery_image_name: str + :param gallery_image: Parameters supplied to the create or update gallery image operation. + :type gallery_image: ~azure.mgmt.compute.v2020_09_30.models.GalleryImage + :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: True for ARMPolling, False for no polling, or a + polling object for 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 GalleryImage or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_09_30.models.GalleryImage] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] + 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, + gallery_name=gallery_name, + gallery_image_name=gallery_image_name, + gallery_image=gallery_image, + 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('GalleryImage', 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_image_name, # type: str + gallery_image, # type: "_models.GalleryImageUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.GalleryImage" + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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(gallery_image, 'GalleryImageUpdate') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GalleryImage', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_image_name, # type: str + gallery_image, # type: "_models.GalleryImageUpdate" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.GalleryImage"] + """Update a gallery image definition. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to + be updated. + :type gallery_name: str + :param gallery_image_name: The name of the gallery image definition to be updated. The allowed + characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The + maximum length is 80 characters. + :type gallery_image_name: str + :param gallery_image: Parameters supplied to the update gallery image operation. + :type gallery_image: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageUpdate + :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: True for ARMPolling, False for no polling, or a + polling object for 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 GalleryImage or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_09_30.models.GalleryImage] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] + 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, + gallery_name=gallery_name, + gallery_image_name=gallery_image_name, + gallery_image=gallery_image, + 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('GalleryImage', 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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.Compute/galleries/{galleryName}/images/{galleryImageName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_image_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.GalleryImage" + """Retrieves information about a gallery image definition. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery from which the Image Definitions are + to be retrieved. + :type gallery_name: str + :param gallery_image_name: The name of the gallery image definition to be retrieved. + :type gallery_image_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GalleryImage, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.GalleryImage + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('GalleryImage', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_image_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-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + gallery_name, # type: str + gallery_image_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Delete a gallery image. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery in which the Image Definition is to + be deleted. + :type gallery_name: str + :param gallery_image_name: The name of the gallery image definition to be deleted. + :type gallery_image_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: True for ARMPolling, False for no polling, or a + polling object for 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, + gallery_name=gallery_name, + gallery_image_name=gallery_image_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'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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.Compute/galleries/{galleryName}/images/{galleryImageName}'} # type: ignore + + def list_by_gallery( + self, + resource_group_name, # type: str + gallery_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.GalleryImageList"] + """List gallery image definitions in a gallery. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery from which Image Definitions are to + be listed. + :type gallery_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GalleryImageList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_09_30.models.GalleryImageList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GalleryImageList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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_gallery.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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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('GalleryImageList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_gallery.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_sharing_profile_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_sharing_profile_operations.py new file mode 100644 index 000000000000..951086b46277 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_sharing_profile_operations.py @@ -0,0 +1,177 @@ +# 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.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, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class GallerySharingProfileOperations(object): + """GallerySharingProfileOperations 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.mgmt.compute.v2020_09_30.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 _update_initial( + self, + resource_group_name, # type: str + gallery_name, # type: str + sharing_update, # type: "_models.SharingUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.SharingUpdate" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharingUpdate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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(sharing_update, 'SharingUpdate') + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SharingUpdate', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SharingUpdate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/share'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + gallery_name, # type: str + sharing_update, # type: "_models.SharingUpdate" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.SharingUpdate"] + """Update sharing profile of a gallery. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Image Gallery. + :type gallery_name: str + :param sharing_update: Parameters supplied to the update gallery sharing profile. + :type sharing_update: ~azure.mgmt.compute.v2020_09_30.models.SharingUpdate + :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: True for ARMPolling, False for no polling, or a + polling object for 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 SharingUpdate or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_09_30.models.SharingUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharingUpdate"] + 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, + gallery_name=gallery_name, + sharing_update=sharing_update, + 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('SharingUpdate', 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'), + 'galleryName': self._serialize.url("gallery_name", gallery_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.Compute/galleries/{galleryName}/share'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_galleries_operations.py new file mode 100644 index 000000000000..0758cb999da9 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_galleries_operations.py @@ -0,0 +1,182 @@ +# 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, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SharedGalleriesOperations(object): + """SharedGalleriesOperations 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.mgmt.compute.v2020_09_30.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, + location, # type: str + shared_to=None, # type: Optional[Union[str, "_models.SharedToValues"]] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SharedGalleryList"] + """List shared galleries by subscription id or tenant id. + + :param location: Resource location. + :type location: str + :param shared_to: The query parameter to decide what shared galleries to fetch when doing + listing operations. + :type shared_to: str or ~azure.mgmt.compute.v2020_09_30.models.SharedToValues + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SharedGalleryList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_09_30.models.SharedGalleryList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedGalleryList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'location': self._serialize.url("location", location, '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 shared_to is not None: + query_parameters['sharedTo'] = self._serialize.query("shared_to", shared_to, '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('SharedGalleryList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries'} # type: ignore + + def get( + self, + location, # type: str + gallery_unique_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PirSharedGalleryResource" + """Get a shared gallery by subscription id or tenant id. + + :param location: Resource location. + :type location: str + :param gallery_unique_name: The unique name of the Shared Gallery. + :type gallery_unique_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PirSharedGalleryResource, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.PirSharedGalleryResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PirSharedGalleryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'location': self._serialize.url("location", location, 'str'), + 'galleryUniqueName': self._serialize.url("gallery_unique_name", gallery_unique_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PirSharedGalleryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_gallery_image_versions_operations.py new file mode 100644 index 000000000000..517d6a81be3b --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_gallery_image_versions_operations.py @@ -0,0 +1,203 @@ +# 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, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SharedGalleryImageVersionsOperations(object): + """SharedGalleryImageVersionsOperations 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.mgmt.compute.v2020_09_30.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, + location, # type: str + gallery_unique_name, # type: str + gallery_image_name, # type: str + shared_to=None, # type: Optional[Union[str, "_models.SharedToValues"]] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SharedGalleryImageVersionList"] + """List shared gallery image versions by subscription id or tenant id. + + :param location: Resource location. + :type location: str + :param gallery_unique_name: The unique name of the Shared Gallery. + :type gallery_unique_name: str + :param gallery_image_name: The name of the Shared Gallery Image Definition from which the Image + Versions are to be listed. + :type gallery_image_name: str + :param shared_to: The query parameter to decide what shared galleries to fetch when doing + listing operations. + :type shared_to: str or ~azure.mgmt.compute.v2020_09_30.models.SharedToValues + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SharedGalleryImageVersionList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_09_30.models.SharedGalleryImageVersionList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedGalleryImageVersionList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'location': self._serialize.url("location", location, 'str'), + 'galleryUniqueName': self._serialize.url("gallery_unique_name", gallery_unique_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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 shared_to is not None: + query_parameters['sharedTo'] = self._serialize.query("shared_to", shared_to, '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('SharedGalleryImageVersionList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions'} # type: ignore + + def get( + self, + location, # type: str + gallery_unique_name, # type: str + gallery_image_name, # type: str + gallery_image_version_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SharedGalleryImageVersion" + """Get a shared gallery image version by subscription id or tenant id. + + :param location: Resource location. + :type location: str + :param gallery_unique_name: The unique name of the Shared Gallery. + :type gallery_unique_name: str + :param gallery_image_name: The name of the Shared Gallery Image Definition from which the Image + Versions are to be listed. + :type gallery_image_name: str + :param gallery_image_version_name: The name of the gallery image version to be created. Needs + to follow semantic version name pattern: The allowed characters are digit and period. Digits + must be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. + :type gallery_image_version_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SharedGalleryImageVersion, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.SharedGalleryImageVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedGalleryImageVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'location': self._serialize.url("location", location, 'str'), + 'galleryUniqueName': self._serialize.url("gallery_unique_name", gallery_unique_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SharedGalleryImageVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_gallery_images_operations.py new file mode 100644 index 000000000000..df928f00d497 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_gallery_images_operations.py @@ -0,0 +1,191 @@ +# 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, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SharedGalleryImagesOperations(object): + """SharedGalleryImagesOperations 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.mgmt.compute.v2020_09_30.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, + location, # type: str + gallery_unique_name, # type: str + shared_to=None, # type: Optional[Union[str, "_models.SharedToValues"]] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SharedGalleryImageList"] + """List shared gallery images by subscription id or tenant id. + + :param location: Resource location. + :type location: str + :param gallery_unique_name: The unique name of the Shared Gallery. + :type gallery_unique_name: str + :param shared_to: The query parameter to decide what shared galleries to fetch when doing + listing operations. + :type shared_to: str or ~azure.mgmt.compute.v2020_09_30.models.SharedToValues + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SharedGalleryImageList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_09_30.models.SharedGalleryImageList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedGalleryImageList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'location': self._serialize.url("location", location, 'str'), + 'galleryUniqueName': self._serialize.url("gallery_unique_name", gallery_unique_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 shared_to is not None: + query_parameters['sharedTo'] = self._serialize.query("shared_to", shared_to, '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('SharedGalleryImageList', 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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images'} # type: ignore + + def get( + self, + location, # type: str + gallery_unique_name, # type: str + gallery_image_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SharedGalleryImage" + """Get a shared gallery image by subscription id or tenant id. + + :param location: Resource location. + :type location: str + :param gallery_unique_name: The unique name of the Shared Gallery. + :type gallery_unique_name: str + :param gallery_image_name: The name of the Shared Gallery Image Definition from which the Image + Versions are to be listed. + :type gallery_image_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SharedGalleryImage, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.SharedGalleryImage + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedGalleryImage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + 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'), + 'location': self._serialize.url("location", location, 'str'), + 'galleryUniqueName': self._serialize.url("gallery_unique_name", gallery_unique_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SharedGalleryImage', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/py.typed b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file